Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible for me to use .NET language to create a system, which can then also include a separate module that uses C++ (not .NET, the old one)?

 

What must I do?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
  • *Experts*
Posted

You can mix them in separate projects, not within the same project. Each project would be a separate DLL (Class Library project type) and use it's own language. The main EXE could also be whatever .NET language you wanted.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
so how do i link the4se separate dlls to the main exe? or how do these DLL files of different languages communicate with each other, if trhat is possible?
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
  • *Experts*
Posted

You add DLLs references through your project's References. In the solution explorer, you right click References and click Add. Locate the DLL and select it. Now that namespace and any classes in it can be instantiated (well, public ones and such).

 

You can also put all the projects together in one solution. If you have one project open, you can right click the solution node (the topmost entry in the solution explorer) and click Add. You can then add a new project or an existing one. Once added, go to the references and click add but this time click on the Project tab - it will show all the projects in the current solution. Now that namespace and any classes in it can be instantiated (well, public ones and such).

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Gurus*
Posted

Of course that's assuming the unmanaged C++ DLL (as was requested above) is using COM, and can be exposed in that fashion. If it's not using COM you'll have to invoke its methods using platform invoke.

 

I don't understand why you'd bother to do this though, since you can recompile the unmanaged C++ code into managed C++ code without changing a single character using the /clr compiler switch.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...