> To people wiser than myself:
> I'm calling a native dll in C# that takes a frame number and a pointer to
[quoted text clipped - 21 lines]
>
> --Patrick
Could be wrong, but it looks like you are trying to call a C++ class member
method, which is impossible from C#. The reason why I'm saying this is that
you are seting the entry point to the mangled name, which makes me believe
that GetFrame isn't exported as a C function (using C bindings). Do you have
any API description for that library that you could consult, before you
start calling into something?
To answer you question about unsigned char*, it's simply a pointer( to a
memory location) that will be threated as pointing to an unsigned char. when
you dereference the pointer (read the contents).
Willy.
Patrick - 20 Nov 2005 05:50 GMT
Your right, it is a C++ class member method, and I don't have any
documentation for the API library (but I do have the source). I'm trying to
convert some delphi code that uses that library dll over to csharp. Here's
how delphi calls GetFrame:
function getFrameDll(frame: integer): PByteArray; cdecl; external
'vidframe.dll' name '?getFrame@@YAPAEH@Z';
It is a function. But the actual C++ source to GetFrame is this:
void DirectShowSource::GetFrame(int n, unsigned char* buf)
>> To people wiser than myself:
>> I'm calling a native dll in C# that takes a frame number and a pointer
[quoted text clipped - 34 lines]
>
> Willy.
Willy Denoyette [MVP] - 19 Nov 2005 20:20 GMT
Well, as I said in my previous reply, C# can't call C++ member functions,
member functions are called using the 'this' pointer (a pointer to the class
instance) which you can't obtain from C# as you can't create instances of
unmaged classes from C#. Don't know how you managed this to be called from
Delphi though - are you really sure it's a member function?.
Anyway to solve your problem (without the need to change the library), is to
build a wrapper class using MC++ (VS2003) or C++/CLI (VS2005). You can check
MSDN for sample how to do this.
Willy.
> Your right, it is a C++ class member method, and I don't have any
> documentation for the API library (but I do have the source). I'm trying
[quoted text clipped - 46 lines]
>>
>> Willy.
Patrick - 22 Nov 2005 01:50 GMT
Thanks Willy :)
> Well, as I said in my previous reply, C# can't call C++ member functions,
> member functions are called using the 'this' pointer (a pointer to the
[quoted text clipped - 58 lines]
>>>
>>> Willy.