Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

Ungi

@Ungi
About
Posts
19
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • System.Collections.Generic.SynchronizedKeyedCollection<k,t></k,t>
    U Ungi

    With .NET Framework 3.0 MS shipped some extensions to System.Collections.Generic namespace. One of it is the generic class SynchronizedKeyedCollection. First seen I thought, wow I have ever wanted a thread-safe dictionary. So I tried to use that class in current project. But: What the hell. Those framework designer were not able to have same interface to that class like dictionary has. The method Add() only takes a . To assign a key you have to call ChangeItemKey method. There is no method such TryGetValue to check if an object with requested key exists. And so on. Did I miss something on understanding that class or is there a deeper reason changing the "interface-pattern" of the Dictionary class? Have you ever dealed with that class? I didn't find anything in google about this....

    C# csharp dotnet regex question

  • Source Database
    U Ungi

    I absolutly agree! Nothing over Subersion and Tortoises!

    The Lounge php database com collaboration tools

  • Receving newsletter as HTML ...
    U Ungi

    Oh yes, it works!!! Thanx alot!

    The Lounge html

  • Receving newsletter as HTML ...
    U Ungi

    ... in the last two days but I anounced to it as plain text. My Mailingprog is not able to display those html EMails correctly... (Thank to Lotus...)

    The Lounge html

  • Is string a primitive type??
    U Ungi

    Thanks for the answer. I think I understand now a little more about those value/reference types... Heath Stewart wrote: As was already proven about that author, not everyone is as right as they claim to be. Whoever said that is wrong. What do you mean with it, does Jeffrey Richter have more mistakes in his articels than it seem to be there??

    C# csharp dotnet question

  • Is string a primitive type??
    U Ungi

    Thanks!! Good explanation :cool: It says that string is no primitive type. But another question: This discussion also says that only on primitive types consts could be defined; but I am also able to define a string const with the following statement: private const string cMYCONST = "asdfjkl"; ???? :confused:

    C# csharp dotnet question

  • Is string a primitive type??
    U Ungi

    Yes, I know. int is also just a shortcut for System.Int32. What I'm wondering about is, that Mr. Richter writes in his book, that string is a Primitive type and the command returns false at this method call. It also does with decimal datatype (decimal is no class), but it does not with int.

    C# csharp dotnet question

  • Is string a primitive type??
    U Ungi

    Is string a primitive type or is it not? I read in Jeffrey Richter's "Applied Microsoft .NET Framework" that string (and decimal too) should be primitive types but than I tried following lines of code: string s=""; Console.WriteLine (s.GetType().IsPrimitive.ToString()); It prints false!! Do I make something false, or does anybody have an explanation for that?? mfg

    C# csharp dotnet question

  • COM Interop
    U Ungi

    I had to use SafeArrays as described in the msdn.

    C# com csharp database data-structures

  • COM Interop
    U Ungi

    Of course I will post if I have the solution. I really think that it is a boxing failure: I have an array with four elements. To call the method of the ocx I have pass a reference to the first element of the array. But this element is a TypeValue and no reference value. So it is boxed --> put into the heap. But only the first(!!) element!!! So the ocx gets a reference to that element and writes the data into it and also writes data into the next 3 elements. But the other 3 elements aren't in the heap. At the end of the call my first element gets unboxed back into the stack and it has the correct value but the other 3 haven't. Currently I try to pass through a SAFEARRAY. But there is a lot of studiing because I never used to work with MFC and ClassWizard and so on (only C/C++). But I think I am on the right way!

    C# com csharp database data-structures

  • COM Interop
    U Ungi

    Could this be a boxing fault??? Gets "ref parArray[0]" boxed before it is passed to the COM-interface and so the other elements get no values.

    C# com csharp database data-structures

  • COM Interop
    U Ungi

    Hallo! If I do that the following message occurs: "Argument '1': cannot convert from 'int[]' to 'ref int'" I think I have already tried almost all combinations of parameter and the one I used seems to be the only one that works. I wrote a litte VB6-TestingApplication for the dll. There I passed the arrays in the same way as I did in C#. It is really strange.

    C# com csharp database data-structures

  • COM Interop
    U Ungi

    Thanks for your reply! That doesn't work because of a compiler error: "Argument '1': cannot convert from 'ref int[]' to 'ref int'"

    C# com csharp database data-structures

  • COM Interop
    U Ungi

    I have the following problem: I use an ocx that provides a method with following parameters (from documentation): GetMasSysDataS ( long parArray(4), String startTime, String osInfo, String sysName, String prtNode(2)) The COM interface is created as following: short GetMasSysDataS( long* parArray, BSTR* startTime, BSTR* osInfo, BSTR* sysName, BSTR* prtNode); I try to use this method in my C# application: int[] parArray = new int[4] { -1, -1, -1, -1 }; string startTime = ""; string osInfo = ""; string sysName = ""; string[] prtNode = new string[2] { "", "" }; // instance the wrapperclass m_MasDsp = new cominterop.MasDsp (); /* ... do some configurations ... */ // get the data m_MasDsp.GetMasSysDataS(ref parArray[0], ref startTime, ref osInfo, ref sysName, ref prtNode[0]); Almost all data is passed correctly except of the parameters in the array with an index greater than 0. The first element of the array is correct all other elements stay on initial value. Has anybody a tip what the problem could be? [edit]I forgot to post that I had no problems to call that method from a VB6 Application for testing purposes.[/edit]

    C# com csharp database data-structures

  • Convert String[] to System.Array
    U Ungi

    Take a look at this post. I think it solves your problem.

    C# com question data-structures

  • COM Interop
    U Ungi

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;146120

    C# com help csharp question

  • COM Interop
    U Ungi

    I tried to use tlbimp before and it took the same error. I don't think that it is an error on marshalling because the same error is raised if I call a method with no arguments or if I want to set a property of the class. Perhaps something on threading... Will try to get more information. Thank you very much for your help!

    C# com help csharp question

  • COM Interop
    U Ungi

    Thank you for your answer! The component is running on the same machine. The threading model could really be a factory. A colleague created the component with C++/MFC. What could there be a problem? I instance the class like: MasDspMetadata.MasDspClass mMasDsp = new MasDspMetadata.MasDspClass(); mMasDsp.Connect (strHostname,dPort,dTimeout); //raises the error With the ActiveX Control Test Container I have no problems on calling methods.

    C# com help csharp question

  • COM Interop
    U Ungi

    I have a big Problem: I want to use a OCX in my C# Application. To achive this I used the Project/Add Reference... menu and browsed for the Component in the COM Tab. There are no problems on viewing the component in the Object Browser or to instance any class of the component. But if I try to call a method or set any property of any instanced class I get the following error: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll Additional information: Catastrophic failure Does any one of you know, what that could be?

    C# com help csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups