|
-
Oct 17th, 2006, 03:43 AM
#1
Thread Starter
Member
[2005] Interact with C++ Project
Hey,
I was wondering how do you interact with a C++ project in VB that are both in the same solution. I tried to Add Reference - Projects but I got an error message.
Actually the file in the C++ project is actually a C file so I don't know if that complicates things anymore. In the Debug folder I see the project is outputted as a .obj file if that helps.
-
Oct 17th, 2006, 03:53 AM
#2
Re: [2005] Interact with C++ Project
There are really only three ways that a .NET app can interact with external libraries. If the library is a .NET assembly then it can be referenced directly. if the library isa COM component then it can be referenced indirectly via COM interop. Otherwise the library would have to export functions which can then be declared as external functions using either the 'Declare' statement or the 'DllImport' attribute. If your C++ project is not managed then the first option is not open to you. If you have not compiled the C++ project as a COM component then the second option is not open to you either. If you're using C code files then the third option is likely to be the only one available to you.
-
Oct 17th, 2006, 10:27 AM
#3
Thread Starter
Member
Re: [2005] Interact with C++ Project
Hmm, looks like I have another problem that may not be fixable. Right now the C++ Project outputs values to the console using printf().
Is there a way to call the main executable and then store whatever values are outputting into a string using C#? This is pretty far fetched and I wouldn't be surprised if this isn't possible...
-
Oct 17th, 2006, 03:10 PM
#4
Re: [2005] Interact with C++ Project
 Originally Posted by r_barlow
Hmm, looks like I have another problem that may not be fixable. Right now the C++ Project outputs values to the console using printf().
Is there a way to call the main executable and then store whatever values are outputting into a string using C#? This is pretty far fetched and I wouldn't be surprised if this isn't possible...
Checkout the CodeBanks... Gigemboy has an example on how to redirect command window's output into your app.
http://www.vbforums.com/showthread.p...utput+redirect
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|