471,120 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,120 software developers and data experts.

Passing managed callback class to unmanaged code

I have an unmanaged library that can accept an instance of an abstract
class and call back into it. I'm writing a wrapper for this library.

How do I wrap a managed callback in a class derived from the unmanaged
class to pass to the library?

I tried creating a managed class that carries an unmanaged callback class
which calls back into the managed class, but I can't put a handle to the
unmanaged class in the unmanaged class. (I get C3265.) So how does the
unmanaged wrapper carry something to let it call up into the managed code?
Jul 12 '08 #1
1 4387
As usual, no sooner do I frame the question than I find the answer. In this
case, it's the gcroot template class.

A HOWTO article:

http://www.codeproject.com/KB/mcpp/ijw_unmanaged.aspx

Jul 12 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sasha Nikolic | last post: by
9 posts views Thread by =?Utf-8?B?RWR3YXJkUw==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.