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

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
 
I

ismailp

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
 
F

Fredrik Wahlgren

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
 
I

ismailp

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

Ismail
 

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