You'll get in even more difficulty. You need to spend some time learning the difference between managed and unmanaged code in C++. I am not sure what you are trying to achieve here, but suffice it to say that what you are attempting is not straightforward. C++ was never designed to work in .NET and unless you have a compelling reason to mix the two languages you should not bother. Stick to either unmanaged C++ or C#, and make life easier for yourself.
Please help me with a step by step process how can I do it .
Sorry, I don't have one, you will have to figure it out from the documentation and articles on the subject. I still do not understand what you are trying to achieve here, calling managed code from unmanaged is not such a simple matter.
It isn't clear if there is a real business problem here but mixed mode programming can often be tricky.
So it is easier to just not do it.
1. Create a executable of the targeted functionality.
2. Provide an management API for that: sockets, files or std io.
3. Use the client application to manage a "process" to run the above executable.
4. The client application uses the management api to produce the desired functionality.
The advantage to this is that both pieces, with care, can be tested independently and debugged independently as well. And the target functionality cannot take done the client application should it fail in a catastrophic way.
You have already asked the question there. I kindly ask you to not create cross-posts. If the author is still active on CP he will see your question there and answer it. If not you can delete the post in the comments there and ask your question in the Q&A section.
When I type in ,call vcvarsall.bat in command prompt window myself and run this codes, it works. No exception. But when I run this code in another command prompt window without calling vcvarsall.bat, it throws exception. Calling vcvarsall.bat with Process::Start method doesn't work!
Pls, advise me how to call vcvarsall.bat with Process::Start method. Thanks in advance.
You cannot execute these processes independently in this way. vcvarsall.bat needs to be called in the same environment that the compiler will be called. You need to create a new batch file that contains all the commands that you wish to run, and execute that batch file.
the 'input' struct in the argument list is comprised of ints doubles, stuff like that. Not a managed struct. It's saying the candidate function M_AT is not accessible. How do I resolve this? thanks, sb
Last Visit: 31-Dec-99 18:00 Last Update: 3-Aug-21 4:20