fkheng Posted August 28, 2003 Posted August 28, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
*Experts* mutant Posted August 28, 2003 *Experts* Posted August 28, 2003 You can mix managed C++ and C++ in a managed C++ application, if thats what you mean. Quote
*Experts* Nerseus Posted August 28, 2003 *Experts* Posted August 28, 2003 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 Quote "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
fkheng Posted August 29, 2003 Author Posted August 29, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
*Experts* Nerseus Posted August 29, 2003 *Experts* Posted August 29, 2003 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 Quote "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* Derek Stone Posted August 29, 2003 *Gurus* Posted August 29, 2003 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. Quote Posting Guidelines
samsmithnz Posted September 3, 2003 Posted September 3, 2003 AND using a C++ dll with the managed dll will cause you all sorts of problems. Its nowhere near as easy as it sounds (in my opinion and experience!!!) Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.