I have been using:
Type typeofobj = Type.GetTypeFromProgID( "AESRegLib.AESRegistryObject" );
object newobj = Activator.CreateInstance( typeofobj );
MemberInfo[] Mymemberinfoarray = typeofobj.GetMembers();
//Get and display the DeclaringType method.
Console.Write( "\nThere are {0} members in ",
Mymemberinfoarray.GetLength(0) );
Console.Write( "{0}.", typeofobj.FullName );
foreach ( MemberInfo Mymemberinfo in Mymemberinfoarray )
{
Console.Write( "\n" + Mymemberinfo.Name + " declaring type - " +
Mymemberinfo.DeclaringType );
}
But I get this in console:
There are 7 members in System.__ComObject.
CreateObjRef declaring type - System.MarshalByRefObject
InitializeLifetimeService declaring type - System.MarshalByRefObject
GetLifetimeService declaring type - System.MarshalByRefObject
GetHashCode declaring type - System.Object
Equals declaring type - System.Object
ToString declaring type - System.Object\
It doesnt seem to get the right info, not sure what I'm doing wrong.
Any ideas?
Thanks!
Aravind C said:
Hi Chris,
Have you tried using Activator.CreateInstance()
using the type of the AxImp.exe generated Activex wrapper class ?.
Control ctrl = (Control)Activator.CreateInstance(
Type.GetType("....typeNameOfAxInteropWrapper..."));
// Add it to the form's control collection using the Controls property
Controls.Add(ctrl);
ctrl.Show();
Regards,
Aravind C