Click here to Skip to main content
15,916,835 members
Home / Discussions / C#
   

C#

 
AnswerRe: Formatting problem in SmtpClient Pin
led mike2-Feb-07 5:20
led mike2-Feb-07 5:20 
QuestionAlternative WebBrowser Pin
el_MKay2-Feb-07 4:05
el_MKay2-Feb-07 4:05 
AnswerRe: Alternative WebBrowser Pin
Judah Gabriel Himango2-Feb-07 4:57
sponsorJudah Gabriel Himango2-Feb-07 4:57 
QuestionShowing a record Set on WIndows C# form Pin
Muhammad Ahmed2-Feb-07 4:03
Muhammad Ahmed2-Feb-07 4:03 
AnswerRe: Showing a record Set on WIndows C# form Pin
bobsugar2222-Feb-07 4:08
bobsugar2222-Feb-07 4:08 
Questiondeserialization Pin
mihksoft2-Feb-07 3:49
mihksoft2-Feb-07 3:49 
AnswerRe: deserialization Pin
Judah Gabriel Himango2-Feb-07 4:58
sponsorJudah Gabriel Himango2-Feb-07 4:58 
QuestionInvoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 3:47
Abhi Lahare2-Feb-07 3:47 
Hi all,
I am new in C# World and working on C# project which uses reflection.

Problem:
I am calling a function from a DLL say ServerDLL (C#)which is loaded by an C# application say MyApp.

I want to invoke some funcition say (SomeFunction)of Class Class1 from another DLL say ClientDLL.

For this I am using following.
<br />
//In ClientDLL<br />
object MyObj  = Marshal.GetActiveObject("ServerDLL.Class1") // Object reference <br />
object[] args = new object[1];<br />
args[0] = my_data_to_pass; // my data to pass<br />
MyObj.GetType().InvokeMember("SomeFunction", BindingFlags.InvokeMethod, null, MyObj, args);<br />


This works fine, but I found these very expensive and taking too much time. Seems that MyObj.GetType() is loading everytime.
I have googled and come to know that these is heavy operation (see reference)
http://msdn.microsoft.com/msdnmag/issues/05/07/Reflection/[^]

I have changed the code to work to load it once,

<br />
<br />
//In ClientDLL<br />
MethodInfo g_MFinfo = MyObj.GetType().GetMethod("SomeFunction", BindingFlags.InvokeMethod);<br />

But I am getting null value g_MFinfo?

Does anyone know what i am doing wrong or probably a good approach?

Thanks in Advance
Abhi Lahare
AnswerRe: Invoking function from out of process DLL Pin
parsiphal2-Feb-07 5:00
parsiphal2-Feb-07 5:00 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 6:33
Abhi Lahare2-Feb-07 6:33 
GeneralRe: Invoking function from out of process DLL Pin
parsiphal5-Feb-07 2:59
parsiphal5-Feb-07 2:59 
AnswerRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango2-Feb-07 5:00
sponsorJudah Gabriel Himango2-Feb-07 5:00 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 6:10
Abhi Lahare2-Feb-07 6:10 
GeneralRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango2-Feb-07 6:33
sponsorJudah Gabriel Himango2-Feb-07 6:33 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare5-Feb-07 9:21
Abhi Lahare5-Feb-07 9:21 
GeneralRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango5-Feb-07 9:43
sponsorJudah Gabriel Himango5-Feb-07 9:43 
Questioncompact framework Pin
Edwin_Olo2-Feb-07 3:12
Edwin_Olo2-Feb-07 3:12 
AnswerRe: compact framework Pin
george ivanov2-Feb-07 3:20
george ivanov2-Feb-07 3:20 
GeneralRe: Which user has the file open? Pin
RugbyLeague2-Feb-07 2:32
RugbyLeague2-Feb-07 2:32 
Questionjavascript code Pin
acodman2-Feb-07 2:21
acodman2-Feb-07 2:21 
AnswerRe: javascript code Pin
Ravi Bhavnani2-Feb-07 3:00
professionalRavi Bhavnani2-Feb-07 3:00 
GeneralRe: javascript code Pin
badgrs2-Feb-07 4:14
badgrs2-Feb-07 4:14 
QuestionHow to set CurrentCell in DataGrid Pin
george ivanov2-Feb-07 2:11
george ivanov2-Feb-07 2:11 
AnswerRe: How to set CurrentCell in DataGrid Pin
andre_swnpl2-Feb-07 2:21
andre_swnpl2-Feb-07 2:21 
GeneralRe: How to set CurrentCell in DataGrid Pin
george ivanov2-Feb-07 2:38
george ivanov2-Feb-07 2: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.