C++ to C# Wrapper

  • Thread starter Thread starter Kuba Florczyk
  • Start date Start date
K

Kuba Florczyk

Hi

How to write method in wrapper for method from C++:

HRESULT Add(WCHAR *wcPath)

???

I've write something like this

int Add(string wcPath)

and it's doesn't work :(

regards
kuba florczyk
 
How about ...

public class MyWrapper
{
[DllImport("MyDll.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static IntPtr Add(string wcPath);
}

Since, however, this is returning an HRESULT, is this method on a COM
object? If yse you must use COM Interop.

Hope this helps
Brian W
 
Thx. It's work!

kuba florczyk

U¿ytkownik "Brian W said:
How about ...

public class MyWrapper
{
[DllImport("MyDll.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static IntPtr Add(string wcPath);
}

Since, however, this is returning an HRESULT, is this method on a COM
object? If yse you must use COM Interop.

Hope this helps
Brian W



Kuba Florczyk said:
Hi

How to write method in wrapper for method from C++:

HRESULT Add(WCHAR *wcPath)

???

I've write something like this

int Add(string wcPath)

and it's doesn't work :(

regards
kuba florczyk
 
Back
Top