3

I have created a COM dll in .Net and build it under Any CPU. I am using that COM dll in Vcpp code but getting Microsoft C++ exception: _com_error at memory location error when creating the pointer reference to COM class. The VCPP code works perfectly fine if the Build configuration is Win32 but if i change the configuration to X64 mode then teh application crashes.

Please Help

1 Answer 1

3

Since you're using a so-called in process DLL, you have to use the 64 bits version of that DLL in your program.

This question discusses it. It seems that you have to use the 64 bit regasm tool to register your .NET DLL.

Sign up to request clarification or add additional context in comments.

3 Comments

Either this or host it in a surrogate process.
Thanks for the post, the problem is solved using 64 bit regasm. I have another query and tried doing a lot of google but no success. I am using the COM dll in VCPP dll (Active Directory dll) and the import path i gave was relative(only Comdll name), i added the absolute path in Tools-> Additional Include Directory. i stored my vcpp dll in system32 folder, which is invoking the COM dll method stored in "C:\test" folder. how can i make the tlb path dynamic? as my VCPP dll is stored in system32 folder.
@Haseena: please open another question for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.