Click here to Skip to main content
15,889,216 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to create this form? Pin
Wes Aday23-Sep-12 4:21
professionalWes Aday23-Sep-12 4:21 
AnswerRe: how to create this form? Pin
BillWoodruff24-Sep-12 19:25
professionalBillWoodruff24-Sep-12 19:25 
QuestionVS2010 solution file cleaning Pin
PozzaVecia22-Sep-12 22:59
PozzaVecia22-Sep-12 22:59 
AnswerRe: VS2010 solution file cleaning Pin
Wes Aday22-Sep-12 23:45
professionalWes Aday22-Sep-12 23:45 
QuestionGetting Data from Methods of Type Void Pin
ASPnoob22-Sep-12 20:01
ASPnoob22-Sep-12 20:01 
AnswerRe: Getting Data from Methods of Type Void Pin
Pete O'Hanlon22-Sep-12 21:21
mvePete O'Hanlon22-Sep-12 21:21 
AnswerRe: Getting Data from Methods of Type Void Pin
Dave Kreskowiak23-Sep-12 4:30
mveDave Kreskowiak23-Sep-12 4:30 
QuestionGetting Data from methods of Type Void Pin
ASPnoob22-Sep-12 20:00
ASPnoob22-Sep-12 20:00 
QuestionC# pass variable to console application Pin
classy_dog22-Sep-12 10:48
classy_dog22-Sep-12 10:48 
AnswerRe: C# pass variable to console application Pin
Wes Aday22-Sep-12 12:42
professionalWes Aday22-Sep-12 12:42 
QuestionHow to Use Array As Value Type Pin
mohammadkaab22-Sep-12 9:11
mohammadkaab22-Sep-12 9:11 
AnswerRe: How to Use Array As Value Type Pin
Dave Kreskowiak22-Sep-12 9:19
mveDave Kreskowiak22-Sep-12 9:19 
GeneralRe: How to Use Array As Value Type Pin
mohammadkaab22-Sep-12 10:24
mohammadkaab22-Sep-12 10:24 
GeneralRe: How to Use Array As Value Type Pin
Wes Aday22-Sep-12 10:42
professionalWes Aday22-Sep-12 10:42 
GeneralRe: How to Use Array As Value Type PinPopular
Dave Kreskowiak22-Sep-12 13:15
mveDave Kreskowiak22-Sep-12 13:15 
QuestionCreate Instance or invoke members of a class from a loaded assembly Pin
Danzy8322-Sep-12 1:57
Danzy8322-Sep-12 1:57 
I have classes in an assembly that I have been able to load using Assembly.LoadFrom() method. I now need to call a method in a class from the loaded assembly but I don't know how to do that.

I tried the following:

Assembly asm = Assembly.LoadFrom("LibTry.dll");

if (asm != null)
{
    object obj = asm.CreateInstance("LibTry.Try");
    Type[] types = asm.GetExportedTypes();

    // I now need to invoke a method from the class for further processing.
}


I'm able to create an instance of a class in the assembly and the return value in
'obj' is valid and not null.
By running the debugger, I set a breakpoint at the line

Type[] types = asm.GetExportedTypes();


I hovered the mouse over the return values and I saw the name of the class in the
'obj' and the exported types in 'types'.

The problem now is to make function calls from the class. Is there any way I can create an instance of the exported types using the name of the class rather than 'object' or call and use the public members in the class? Please help and thanks in advance.

modified 22-Sep-12 8:34am.

AnswerRe: Create Instance or invoke members of a class from a loaded assembly Pin
Eddy Vluggen22-Sep-12 2:54
professionalEddy Vluggen22-Sep-12 2:54 
GeneralRe: Create Instance or invoke members of a class from a loaded assembly Pin
Danzy8322-Sep-12 4:18
Danzy8322-Sep-12 4:18 
GeneralRe: Create Instance or invoke members of a class from a loaded assembly Pin
Eddy Vluggen22-Sep-12 5:01
professionalEddy Vluggen22-Sep-12 5:01 
AnswerRe: Create Instance or invoke members of a class from a loaded assembly Pin
jschell22-Sep-12 8:44
jschell22-Sep-12 8:44 
AnswerRe: Create Instance or invoke members of a class from a loaded assembly Pin
BobJanova24-Sep-12 0:52
BobJanova24-Sep-12 0:52 
QuestionC# Application With MS Access Pin
SUBODH.SB21-Sep-12 23:39
SUBODH.SB21-Sep-12 23:39 
AnswerRe: C# Application With MS Access Pin
Eddy Vluggen22-Sep-12 2:56
professionalEddy Vluggen22-Sep-12 2:56 
AnswerRe: C# Application With MS Access Pin
Smart Arab23-Sep-12 10:39
Smart Arab23-Sep-12 10:39 
QuestionC# linq problem Pin
classy_dog21-Sep-12 11:38
classy_dog21-Sep-12 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.