C++/C# Interop and gacutil/regasm DOS commands

T

trantanm

Hello everybody,
I am getting in the tough issue in my application. I hope I can get
some advice from you. My application CatchAllMessages is mainly written
in C++ and is used to catch messages from the internal network. I have
many interfaces to display message data. But for some unlucky reason,
we designed the new interface written in C# to catch a new message
which has the different platform compared to messages caught in
CatchAllMessages application. That's why I am using Interop to regsiter
the C# DLL as the COM object.
What I did was to create the DataWrapper.cpp class( in DataWrapper
project ) which translates some basic data of the message, such as
IPAddress and the content of the message. Then, I created the
NewMessage.cs( written in C#) in the NewMessage project. My
NewMessage.cs class can catch the content of the message sent by the
DataWrapper.cpp and then display to the NewMessage interface.
To open the NewMessage interface, I have to run the following DOS
commands after compiling to produce CatchAllMessages.dll,
DataWrapper.dll, and NewMessage.dll:
gacutil /i DataWrapper.dll CatchAllMessages\Debug
gacutil /i NewMessage.dll CatchAllMessages\Debug
regasm DataWrapper.dll
/tlb:CatchAllMessages\Debug\com.DataWrapper.tlb
regasm NewMessage.dll /tlb:CatchAllMessages\Debug\com.NewMessage.tlb

Two tools, gacutil and regasm, are provided by .NET Framework 1.1.
After that, I execute my application CatchAllMessages from the .NET
2003 IDE. The code works fine. My problem is that I don't want the user
to run those DOS commands. The user just needs to double click
CatchAllMessages.exe to run the application.
Do you know any way to run those commands programmatically? I really
appreciate your help and thank you for reading the message.
Jared.
 
N

Noah Roberts

Hello everybody,
I am getting in the tough issue in my application. I hope I can get
some advice from you. My application CatchAllMessages is mainly written
in C++ and is used to catch messages from the internal network. I have
many interfaces to display message data. But for some unlucky reason,
we designed the new interface written in C# to catch a new message
which has the different platform compared to messages caught in
CatchAllMessages application. That's why I am using Interop to regsiter
the C# DLL as the COM object.
What I did was to create the DataWrapper.cpp class( in DataWrapper
project ) which translates some basic data of the message, such as
IPAddress and the content of the message. Then, I created the
NewMessage.cs( written in C#) in the NewMessage project. My
NewMessage.cs class can catch the content of the message sent by the
DataWrapper.cpp and then display to the NewMessage interface.
To open the NewMessage interface, I have to run the following DOS
commands after compiling to produce CatchAllMessages.dll,
DataWrapper.dll, and NewMessage.dll:
gacutil /i DataWrapper.dll CatchAllMessages\Debug
gacutil /i NewMessage.dll CatchAllMessages\Debug
regasm DataWrapper.dll
/tlb:CatchAllMessages\Debug\com.DataWrapper.tlb
regasm NewMessage.dll /tlb:CatchAllMessages\Debug\com.NewMessage.tlb

Two tools, gacutil and regasm, are provided by .NET Framework 1.1.
After that, I execute my application CatchAllMessages from the .NET
2003 IDE. The code works fine. My problem is that I don't want the user
to run those DOS commands. The user just needs to double click
CatchAllMessages.exe to run the application.
Do you know any way to run those commands programmatically? I really
appreciate your help and thank you for reading the message.

None of that crap has anything to do with C++. C++.NET is not the same
language and none of those commands are part of any normal C++ toolkit
either. You need to go talk to MS people about these problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top