Skip to main content
gamedev.net
🔒 Locked

C++ COM Problem (Fixed)

Started by MooMooCow Dec 9, 2008 at 9:53 AM 0 replies 900+ views
Original Post
MooMooCow
MooMooCow
Hello, hopefully this is in the right place. I am programming in C++ and I currently have a problem I've been trying to solve for a couple of days. I have a DLL project with unmanaged code and I have another DLL project with managed/.NET code. I am trying to access the functions from the .NET dll in my unmanaged project, but they are having a hard time becoming friends. I get the following error: Error loading type library/DLL. I was told that I needed to turn the managed/.NET DLL into a COM object. I started moving the managed classes into the COM object, but was faced with another problem. I needed to add "using namespace System" which gives me the error: A namespace with this name does not exist. I have added System to the project as a refernce and I even tryed using #import /#using , but have had no luck. Also, switching the project to /clr gives me many errors. The error that I'm currently stuck on would be about 15 like this: error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std.range_error): (0x02000023). I can not seem to find the answer to LNK2022 error. Nothing I have tried works. Basically, I need some way to access the .NET dll from my unmanaged DLL project. Thank you greatly for any help! EDIT: I figured out the solution to my current problem regarding LNK2022. I just simply changed runtime library to multi-threaded Debug DLL and it seems to work fine. Hopefully it will still run on other machines when needed. [Edited by - MooMooCow on December 9, 2008 2:06:45 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.