Convert unmanaged void* to managed object ?

G

Guest

Hi,

my unmanaged method return void* pointer to my managed c++ wrapper class.
How do i convert this pointer to a managed object so that a c# client could
use it ?

Thanks.
 
J

Jochen Kalmbach [MVP]

Hi yaron!
my unmanaged method return void* pointer to my managed c++ wrapper class.
How do i convert this pointer to a managed object so that a c# client could
use it ?

"void" is 'nothing', so it is useless in a managed world (where the
datatype can be reflected)...

If you want to pass an pointer you can use "IntPtr"...

But in general you should make an wrapper around the unmanaged
class/data; this also means that you should never returns som unknown
object to the managed world...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top