G
Guest
I have a 3rd party unmanged .dll. This has functions that will look up
information and fill a C string passed to it with data. I want to use this
data in .NET classes after it has been filled and I am programming in C++. I
believe that I should use pinvoke, but I see a problem that I can't figure
how to get around. I don't think I can declare the string I want as a String
class since when I pass it to unmanged function it is not yet allocated and
the unmanged function does not allocate space it just fills it. So I would
think this would cause memory corruption. I was also thinking that I could
create the String class and fill it with blanks so memory was allocated, but
I don't know if the marshling will correctly change value since String class
are basically a static value unless you use correct member function that
deletes old value and then adds new value.
If any one can tell me the correct way to set this up it would be very much
appreciated.
Thanks
information and fill a C string passed to it with data. I want to use this
data in .NET classes after it has been filled and I am programming in C++. I
believe that I should use pinvoke, but I see a problem that I can't figure
how to get around. I don't think I can declare the string I want as a String
class since when I pass it to unmanged function it is not yet allocated and
the unmanged function does not allocate space it just fills it. So I would
think this would cause memory corruption. I was also thinking that I could
create the String class and fill it with blanks so memory was allocated, but
I don't know if the marshling will correctly change value since String class
are basically a static value unless you use correct member function that
deletes old value and then adds new value.
If any one can tell me the correct way to set this up it would be very much
appreciated.
Thanks