HOWTO: Call a Managed DLL from MFC C++ Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have done exactly like stated in 'HOW TO: Call a Managed DLL from Native
C++ Code' from Knowledge Base, but in my MFC application I have implemented
the tmain section in it's own MFC class. All is looking good until a call to
interfaced Method is done, then I recieve a negative HRESULT. Why?

Best regards,
Bertil Morefält
 
can you please provide a sample? did you compile your MFC application
with /clr?

i have a quick and dirty sample for you, but it does not use MFC or
interfaces. please be more clear about the problem.

Ismail
 
Morefeldt said:
Hi!

I have done exactly like stated in 'HOW TO: Call a Managed DLL from Native
C++ Code' from Knowledge Base, but in my MFC application I have implemented
the tmain section in it's own MFC class. All is looking good until a call to
interfaced Method is done, then I recieve a negative HRESULT. Why?

Best regards,
Bertil Morefält

Exactly what is the value of the HRESULT? If you convert it to hexadecimal,
you can search for it on google.

/Fredrik
 
One "awkward" question; did you call CoInitialize() in that thread?
Does the object require MTA?

Ismail
 
Back
Top