calling c++-exported dll functions from vb.net

  • Thread starter Thread starter RA Scheltema
  • Start date Start date
R

RA Scheltema

hi all,

I have the following function defined in the header-file of a c++ project


struct DataType
{
...
};

long __stdcall my_func(DataType** ptr);



Now we have a double pointer (this has something to do with hidden
data-types, so this is un-avoidable). My question is, how would i go about
calling this function from a visual basic project (complete with marshaling
code).

Any help would be greatly appreciated !

richard
 
Now we have a double pointer (this has something to do with hidden
data-types, so this is un-avoidable). My question is, how would i go about
calling this function from a visual basic project (complete with marshaling
code).

It depends on if the double indirection is there because you're
supposed to pass in an array of DataType pointers, or if the function
returns a DataType pointer to you. One of these should hopefully work

Declare Function my_func Lib "your.dll" (ByRef ptr As IntPtr) As
Integer

Declare Function my_func Lib "your.dll" (ByVal ptr() As IntPtr) As
Integer



Mattias
 
Back
Top