R
Rui Mota
hello there!
I've been trying to translate some code in C++ into C#.
I've an object in a DLL wich has a Method that recieves an Interface pointer
as parameter.
something like this:
HRESULT _stdcall MyMethod([out] unsigned long* nElem, [out] IMyData**
aData);
In C++ I simply do this:
....
ULONG nElem;
MyLib::IMyData* aData = null;
myobj->MyMethod( &nElem, &aData);
....
but when I add the same object in the references in a C# project the method
becomes something like this:
void MyMethod(out uint nElem, System.IntPtr aData);
The method is not accepting my 'MyLib.IMyData aData' as a parameter and the
value IntPtr cannot be null.
I realy don't know how to parse MyLib.IMyData interface into a IntPtr Type.
Can you give me a clue?
I've been trying to translate some code in C++ into C#.
I've an object in a DLL wich has a Method that recieves an Interface pointer
as parameter.
something like this:
HRESULT _stdcall MyMethod([out] unsigned long* nElem, [out] IMyData**
aData);
In C++ I simply do this:
....
ULONG nElem;
MyLib::IMyData* aData = null;
myobj->MyMethod( &nElem, &aData);
....
but when I add the same object in the references in a C# project the method
becomes something like this:
void MyMethod(out uint nElem, System.IntPtr aData);
The method is not accepting my 'MyLib.IMyData aData' as a parameter and the
value IntPtr cannot be null.
I realy don't know how to parse MyLib.IMyData interface into a IntPtr Type.
Can you give me a clue?