Click here to Skip to main content
15,899,937 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionBorlad C++ Pin
Zantabri16-Apr-06 11:25
Zantabri16-Apr-06 11:25 
AnswerRe: Borlad C++ Pin
Gerald Schwab16-Apr-06 11:46
Gerald Schwab16-Apr-06 11:46 
QuestionRe: Borlad C++ Pin
Zantabri17-Apr-06 0:23
Zantabri17-Apr-06 0:23 
AnswerRe: Borlad C++ Pin
Prakash Nadar17-Apr-06 5:15
Prakash Nadar17-Apr-06 5:15 
GeneralRe: Borlad C++ Pin
Zantabri18-Apr-06 4:37
Zantabri18-Apr-06 4:37 
GeneralRe: Borlad C++ Pin
Zantabri18-Apr-06 8:09
Zantabri18-Apr-06 8:09 
Questiondeployment Pin
pankajgarg1216-Apr-06 4:45
pankajgarg1216-Apr-06 4:45 
Questiongcroots and App Domains Pin
Joel Holdsworth15-Apr-06 5:58
Joel Holdsworth15-Apr-06 5:58 
Quick question: I'm working on a managed plugin to an open source unmanaged application. To achieve this I have an MC++ bridging dll plugged into the unmanaged host, which itself hosts a C# dll which does the real work:

Host App ---> MC++ Bridging Dll (a thin interface) ---> C# Dll (does the real work)

When the host app calls a Run function, my plugin bursts into life. I instantiate a whole bunch of managed objects exposed by the C# dll into an unmanaged structure by using the gcroot template; so as to be able to "store" managed objects inside that unmanged data structure jointly owned by the host app and the MC++ bridge. It works pretty well.

But here's the catch; to add more functionality to my plugin, my bridging dll will need to handle a few callbacks from the host app. My original plan was that'd I'd write a callback procedure which simply forwards the event into the C# dll through the use of a delegate. The catch is that to do any delegate invoking, I need to access my managed objects (which are the interfaces) in their gcroots - however the .net framework seems to balk at this, complaining that thread of the callback is in another AppDomain.

I presume the solution to this problem is to somehow get a thread that is in the correct app domain to handle the event. However, the only ways to do this, that I can think of involve yucky polling, or OS thread synchronisation Events.

Can anyone suggest a really elegent way around this little problem of mine?

Joel Holdsworth

Want to give me a job this summer?
Take a look at my online CV
Questionmeaning of system("cls"); Pin
cusack14-Apr-06 15:19
cusack14-Apr-06 15:19 
AnswerRe: meaning of system("cls"); Pin
Michael Dunn14-Apr-06 16:26
sitebuilderMichael Dunn14-Apr-06 16:26 
AnswerRe: meaning of system("cls"); Pin
Bamaco215-Apr-06 12:59
Bamaco215-Apr-06 12:59 
AnswerRe: meaning of system("cls"); Pin
Judah Gabriel Himango16-Apr-06 16:20
sponsorJudah Gabriel Himango16-Apr-06 16:20 
Questionhotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 2:09
TAREQ F ABUZUHRI14-Apr-06 2:09 
QuestionRe: hotmail account Pin
toxcct14-Apr-06 2:24
toxcct14-Apr-06 2:24 
AnswerRe: hotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 2:28
TAREQ F ABUZUHRI14-Apr-06 2:28 
JokeRe: hotmail account Pin
toxcct14-Apr-06 2:29
toxcct14-Apr-06 2:29 
GeneralRe: hotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 2:38
TAREQ F ABUZUHRI14-Apr-06 2:38 
GeneralRe: hotmail account Pin
toxcct14-Apr-06 3:30
toxcct14-Apr-06 3:30 
AnswerRe: hotmail account Pin
Don Miguel14-Apr-06 3:35
Don Miguel14-Apr-06 3:35 
GeneralRe: hotmail account Pin
Prakash Nadar17-Apr-06 5:12
Prakash Nadar17-Apr-06 5:12 
GeneralRe: hotmail account Pin
Don Miguel17-Apr-06 5:54
Don Miguel17-Apr-06 5:54 
Questioninclude files Pin
uriblum14-Apr-06 1:20
uriblum14-Apr-06 1:20 
QuestionRe: include files Pin
toxcct14-Apr-06 2:26
toxcct14-Apr-06 2:26 
AnswerRe: include files Pin
Michael Dunn14-Apr-06 8:00
sitebuilderMichael Dunn14-Apr-06 8:00 
GeneralRe: include files Pin
2bee 14-Apr-06 9:01
2bee 14-Apr-06 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.