Nice... but,
doesn't seem to work with ActiveX controls.
Looking into it I have observed that the designer creates another kind of
wrapper for ActiveX controls, if I create a reference via the toolbox.
The Objectbrowser shows that reference as "axinterop.NameOfTheImportedLib".
Using the wrapper contained there just works fine for me.
The code looks like this:
....
using AxNameOfTheImportedLib; //The wrappers namespace created by the
designer
....
{
//AxNameOfTheImported is just the wrapper class available in
//namespace AxNameOfTheImportedLib
AxNameOfTheImported myInstance = new AxNameOfTheImported ();
myInstance.CreateControl(); //Just force the damn thing to be created
;-)
myInstance.DoSumptin(); //You can now start to use the controls members
...
}
Scarfeet
"Kevin" <cw****@insight.rr.com> schrieb im Newsbeitrag
news:18*************************@posting.google.co m...
Stefan,
I had to do this very thing yesterday with CreateObject. Here's what
worked for me.
VB
Set xmlReq = CreateObject("Microsoft.XMLHTTP")
C#
MSXML.XMLHTTPRequest xmlReq = (MSXML.XMLHTTPRequest)
Activator.CreateInstance(Type.GetTypeFromProgID("M icrosoft.XMLHTTP"));
seems like a lot more to write out.. but it works like a charm.
Kevin
"Stefan Saur" <an*******@discussions.microsoft.com> wrote in message
news:<09****************************@phx.gbl>...
Hello,
I have the commands to access the AutoCAD database via
ActiveX within a VB application. Now I am searching for
the equivalent commands in C#:
VB --> C#
GetObject --> ???
CreateObject --> ???
Can you help me?
Thx
Stefan