For Programmers: Free Programming Magazines  


Home > Archive > C# > March 2005 > Invoke a free threaded unmanaged object from c#









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Invoke a free threaded unmanaged object from c#
RobAHali

2005-03-31, 8:57 pm

Hello,
I'm trying to hook up a legacy c++ object into my c# code.
I need to get it a handle to it genericly so I'm calling GetTypeFromCLSID
to get a reference to it. I'm calling InvokeMember() , after I call invoke
member the function in the unmaged C++ i'm calling runs and gets an error.
This error is attempted to be passed back via COM using
GetClassPtr()->Error.

Problems started arrising after the C++ was changed to be a free threaded
model. When errors were found and attempted to be passed back, something is
blowing up in thr ATL code and passing "Unknown Error" back to the C#
instead on the error trying to be set using GetClassPtr()->Error. Everthing
worked fine while the objects in the C++ were appartment thread.

Has anyone seen anything like this before.

Thanks for the assistance


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com