.NET and ActiveX

J

James Pannozzi

I'm just starting a C++ application which will send data to someone
else's program (written as a VB ActiveX COM app)
and receive some data back from it.

I have the Visual Studio .NET 2003 develoopment environment
and I decided to use C++.

Just as #import once built the interface for me in the Visual Studio 6.0
compiler,
what .NET framework tools might I use to build the interface to the other
app?

The C++ app will be on a web server.

Thanks for any suggestions, this is my first .NET app.

Jim
 
J

James Pannozzi

I'm not sure I understand your question. Specifically, I'm not clear on
why you'd need to use something other than >#import unless you are writing a
managed app in a lanaguage other than in C++. So, I'll try to answer by
assuming that >your situation is that you want to write a managed app that
interacts with an ActiveX app

in respose to a previous posting from James Pannozzi that read:


Thanks, your assumption was right on, I should have specified that I was
considering a managed app.
I want to end up with an app that has a Datagrid control in an ASP .NET
page
and data from the grid flows to and from the external ActiveX app.

Your answer seems exactly what I was looking for.

I suspect that doing it as a managed app may actually end up being less work
that then #import way though I will of course proceed somewhat more slowly
with the plethora of new tools and concepts available.


Thanks Again
Jim




Aaron Hare said:
James:

I'm not sure I understand your question. Specifically, I'm not clear on
why you'd need to use something other than #import unless you are writing a
managed app in a lanaguage other than in C++. So, I'll try to answer by
assuming that your situation is that you want to write a managed app that
interacts with an ActiveX app.
In that case, you'll probably want to use tlbimp, which creates managed
assemblies that can communicate with the activex control (aka "Interop
Assemblies" or "Runitme Callable Wrappers"). You can then add a reference
to the interop assembly to your managed project to access the unmanaged
object model. (see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfTypeLibraryImporterTlbimpexe.asp for a description.)
Also, if the unamanged application is publicly available, you might want
to find out if the vendor has a Primary Interop Assembly ("PIA") available
instead of using tlbimp. MS Office apps, for example, ship PIAs for
developers to use in exactly this situation. Using a PIA that was created
by the vendor has numerous benefits over using tlbimp yourself, as discussed
at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/whypriinterop.asp.
 

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

Top