Click here to Skip to main content
15,903,388 members
Home / Discussions / C#
   

C#

 
AnswerRe: Inheritance problem Pin
Le centriste18-Apr-06 6:41
Le centriste18-Apr-06 6:41 
AnswerRe: Inheritance problem Pin
Ricardo Mendes18-Apr-06 6:42
Ricardo Mendes18-Apr-06 6:42 
QuestionWeb service request does not reach IIS Pin
Ricardo Mendes18-Apr-06 6:22
Ricardo Mendes18-Apr-06 6:22 
QuestionDynamically loadning Menu Items Pin
sjpjs18-Apr-06 5:52
sjpjs18-Apr-06 5:52 
AnswerRe: Dynamically loadning Menu Items Pin
Robert Rohde18-Apr-06 6:03
Robert Rohde18-Apr-06 6:03 
GeneralRe: Dynamically loadning Menu Items Pin
sjpjs18-Apr-06 7:01
sjpjs18-Apr-06 7:01 
AnswerRe: Dynamically loadning Menu Items Pin
LongRange.Shooter18-Apr-06 10:12
LongRange.Shooter18-Apr-06 10:12 
AnswerRe: Dynamically loadning Menu Items Pin
vatzcar18-Apr-06 18:17
vatzcar18-Apr-06 18:17 
I didn't understand your requirement fully, but assuming that you're trying to load menu,froms and assmblies dynamically (all are unknown to you), can be be done this way:

<br />
// assuming you load-up the assembly dynamically depending upon the menu press<br />
// i've used mod name 'cause i called the main form of the desired assembly directly and as my assembly is a dll so don't have an entry point exactly so i needed to make one entry point(virtually)<br />
public void invokeProcess (string assemblyName, string strModName) <br />
{<br />
    Assembly assembly = Assembly.LoadFrom (assemblyName);<br />
   <br />
    // Walk through each type in the assembly<br />
    foreach (Type type in assembly.GetTypes ()) <br />
    {<br />
	// Pick up a class<br />
	if (type.IsClass == true) <br />
	{<br />
	    // if it's not using right class skip it<br />
	    if (type.FullName != strModName + "." + strModClass) <br />
	    {<br />
		continue;<br />
	    }<br />
     <br />
	   // create an instance of the object<br />
	   object ibaseObject = Activator.CreateInstance (type);<br />
	   <br />
           // this has been done 'cause i couldn't pass the ref. of main MDI 	directly		<br />
	   frmDummy frmParent = new frmDummy();<br />
	   frmParent.MdiParent = this;<br />
<br />
	   // Create the parameter list ('course without it we won't be able to determine our MDI parent)<br />
	   object[] arguments = new object [] {frmParent};<br />
					<br />
	   // Dynamically Invoke the Object                    <br />
	   foreach (MemberInfo mi in type.GetMember(strModEntry))<br />
	   {<br />
                type.InvokeMember (mi.Name.ToString(), <br />
		BindingFlags.Default | BindingFlags.InvokeMethod,<br />
		null,<br />
		ibaseObject,<br />
		arguments);<br />
	   }<br />
	}<br />
    }<br />
}


hope this will help.
QuestionRe: Dynamically loadning Menu Items Pin
sjpjs18-Apr-06 23:09
sjpjs18-Apr-06 23:09 
AnswerRe: Dynamically loadning Menu Items Pin
vatzcar19-Apr-06 0:26
vatzcar19-Apr-06 0:26 
QuestionWebservice Pin
dj_jay_smith18-Apr-06 4:48
dj_jay_smith18-Apr-06 4:48 
QuestionWebservice Pin
dj_jay_smith18-Apr-06 4:48
dj_jay_smith18-Apr-06 4:48 
QuestionnsWebservice Pin
dj_jay_smith18-Apr-06 4:47
dj_jay_smith18-Apr-06 4:47 
AnswerRe: nsWebservice Pin
J4amieC18-Apr-06 5:07
J4amieC18-Apr-06 5:07 
GeneralRe: nsWebservice Pin
dj_jay_smith18-Apr-06 21:11
dj_jay_smith18-Apr-06 21:11 
QuestionC# and XML Question Pin
seschu0118-Apr-06 4:35
seschu0118-Apr-06 4:35 
AnswerRe: C# and XML Question Pin
Robert Rohde18-Apr-06 5:33
Robert Rohde18-Apr-06 5:33 
AnswerRe: C# and XML Question Pin
LongRange.Shooter18-Apr-06 10:20
LongRange.Shooter18-Apr-06 10:20 
Questionpassing array byval versus byref Pin
bnathvbdotnet18-Apr-06 4:08
bnathvbdotnet18-Apr-06 4:08 
AnswerRe: passing array byval versus byref Pin
Judah Gabriel Himango18-Apr-06 4:50
sponsorJudah Gabriel Himango18-Apr-06 4:50 
AnswerRe: passing array byval versus byref Pin
Robert Rohde18-Apr-06 5:23
Robert Rohde18-Apr-06 5:23 
AnswerRe: passing array byval versus byref Pin
Guffa18-Apr-06 6:02
Guffa18-Apr-06 6:02 
QuestionI/O Threading Pin
eric_tran18-Apr-06 3:59
eric_tran18-Apr-06 3:59 
AnswerRe: I/O Threading Pin
Judah Gabriel Himango18-Apr-06 4:52
sponsorJudah Gabriel Himango18-Apr-06 4:52 
AnswerRe: I/O Threading Pin
Robert Rohde18-Apr-06 5:43
Robert Rohde18-Apr-06 5:43 

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.