Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# and C++ together... is it possible?

Status
Not open for further replies.

TomaHawKPT

Programmer
Apr 26, 2003
6
0
0
PT
Hi,

I have no experience at all in the .NET world, and I'd like to ask you if it is possible to mix together C# and C++.

The problem is that I must develop a GIS application in .NET that will use a ActiveX that has an interface in C++.
Can I "comunicate" with that ActiveX from a C# application?

Thank you,
TomaHawK
 
Dunno much about activeX, but I would use COM to communication between c++ and C#. I do all the time.

Tom
 
Yes, it is very possible and in fact not very hard. Once you create your C# project, add your C++ ActiveX code as a reference by right-clicking References, going to the COM tab, and then browsing for your component. This will automagically create an Interop.whatever.dll so that your C# can communicate with the ActiveX.

Alternatively, you can probably add your ActiveX as a control, if it is one, by richt clicking on the controls section on the left side of the IDE and choosing add control or something along those lines.

"Programming is like sex, one mistake and you have to support it forever."

John

johnmc@mvmills.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top