Click here to Skip to main content
15,907,497 members
Home / Discussions / C#
   

C#

 
QuestionLCG issue (DynamicMethod / ILGenerator) Pin
rcollina12-Jan-07 5:03
rcollina12-Jan-07 5:03 
AnswerRe: LCG issue (DynamicMethod / ILGenerator) Pin
S. Senthil Kumar12-Jan-07 6:42
S. Senthil Kumar12-Jan-07 6:42 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) [modified] Pin
rcollina12-Jan-07 8:49
rcollina12-Jan-07 8:49 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
S. Senthil Kumar12-Jan-07 20:31
S. Senthil Kumar12-Jan-07 20:31 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) [modified] Pin
rcollina13-Jan-07 13:45
rcollina13-Jan-07 13:45 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
S. Senthil Kumar13-Jan-07 21:07
S. Senthil Kumar13-Jan-07 21:07 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) [modified] Pin
rcollina14-Jan-07 2:27
rcollina14-Jan-07 2:27 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
rcollina15-Jan-07 14:02
rcollina15-Jan-07 14:02 
Here's what I've done after your post. Sadly, there's still a bothering issue.

<code>  delegate void PlugInMethodDelegate(object[] Instances);

                 /* ... */

        m_MSILMethod = /* The dynamic method is here  */
               new DynamicMethod(String.Format("Managed{0}", m_InterfaceMethod),
                    null, m_Params.ToArray(), typeof(PlugInManager));


	//Gives this error: Error binding to target method.
        PlugInMethodDelegate m_Delegate = (PlugInMethodDelegate)m_MSILMethod.CreateDelegate
                                                         (typeof(PlugInMethodDelegate));

</code>


I cannot understand why the CreateDelegate method gives back an error - since the argument is just an object array, after all. Or there's something am I missing again?

PlugInManager: [ERROR] CreateMSILMethods(): Error binding to target method.
   at System.Delegate.CreateDelegate(Type type, Object target, RuntimeMethodHandle method)
   at System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType)
   at Dreams.PlugInManager.CreateMSILMethodsLookup() in C:\xxxx.cs:line 1280


<code>    List< Type > m_Params;
</code>


Here's the pseudo-msil dump:

<code>.method void ManagedPreRender(UserInterface, UserInterfaceEditor) 
{
	ldarg 0		// param "UserInterface"
	call void UserInterface::PreRender()

	ldarg 1		// param "UserInterfaceEditor"
	call void UserInterfaceEditor::PreRender()

	ret
}
</code>


Better than before, I hope.

Many thanks again.
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
rcollina17-Jan-07 13:28
rcollina17-Jan-07 13:28 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
S. Senthil Kumar17-Jan-07 17:51
S. Senthil Kumar17-Jan-07 17:51 
GeneralRe: LCG issue (DynamicMethod / ILGenerator) Pin
rcollina20-Jan-07 10:02
rcollina20-Jan-07 10:02 
QuestionFinding a Sorted DataGridView row in a Dataset Pin
efriese112-Jan-07 4:21
efriese112-Jan-07 4:21 
AnswerRe: Finding a Sorted DataGridView row in a Dataset Pin
Mircea Puiu12-Jan-07 4:34
Mircea Puiu12-Jan-07 4:34 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
efriese112-Jan-07 4:53
efriese112-Jan-07 4:53 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
Mircea Puiu12-Jan-07 5:00
Mircea Puiu12-Jan-07 5:00 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
efriese112-Jan-07 5:09
efriese112-Jan-07 5:09 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
Mircea Puiu12-Jan-07 5:12
Mircea Puiu12-Jan-07 5:12 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
efriese112-Jan-07 5:19
efriese112-Jan-07 5:19 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
Mircea Puiu12-Jan-07 5:20
Mircea Puiu12-Jan-07 5:20 
GeneralRe: Finding a Sorted DataGridView row in a Dataset Pin
efriese112-Jan-07 5:28
efriese112-Jan-07 5:28 
AnswerRe: Finding a Sorted DataGridView row in a Dataset Pin
Drew McGhie12-Jan-07 9:55
Drew McGhie12-Jan-07 9:55 
QuestionMake a web browser that work in single window Pin
Par Witch12-Jan-07 4:15
Par Witch12-Jan-07 4:15 
AnswerRe: Make a web browser that work in single window Pin
Mircea Puiu12-Jan-07 4:28
Mircea Puiu12-Jan-07 4:28 
GeneralRe: Make a web browser that work in single window Pin
Par Witch12-Jan-07 5:20
Par Witch12-Jan-07 5:20 
GeneralRe: Make a web browser that work in single window Pin
Mircea Puiu12-Jan-07 5:26
Mircea Puiu12-Jan-07 5:26 

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.