D
Doug Riley
I am using CreateInstance to create an instance of a class and invoke
a function of that class. I really need it to execute in a single
line of code (long story, but I want to execute this code in the
command window on demand, without declaring any variables).
This code WORKS (but requires 2 lines of code and a variable
declaration):
Type typ = Type.GetTypeFromProgID("MyDLLx.clsMyClass");
Activator.CreateInstance(typ).mNoShow("Test");
This Code DOES NOT WORK:
Activator.CreateInstance((System.Type)Type.GetTypeFromProgID("MyDLLx.clsMyClass")))).mNoShow("Test");
The error, when executed from the command window is:
arguments do not match parameters for function ...
The error (compile), when coded in the application is:
\'object' does not contain a definition for 'mNoShow'
Any help is most appreciated.
a function of that class. I really need it to execute in a single
line of code (long story, but I want to execute this code in the
command window on demand, without declaring any variables).
This code WORKS (but requires 2 lines of code and a variable
declaration):
Type typ = Type.GetTypeFromProgID("MyDLLx.clsMyClass");
Activator.CreateInstance(typ).mNoShow("Test");
This Code DOES NOT WORK:
Activator.CreateInstance((System.Type)Type.GetTypeFromProgID("MyDLLx.clsMyClass")))).mNoShow("Test");
The error, when executed from the command window is:
arguments do not match parameters for function ...
The error (compile), when coded in the application is:
\'object' does not contain a definition for 'mNoShow'
Any help is most appreciated.