Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
GeneralFunny Exception Pin
sreejith ss nair27-Apr-04 0:45
sreejith ss nair27-Apr-04 0:45 
GeneralRe: Funny Exception Pin
Mike Dimmick27-Apr-04 0:55
Mike Dimmick27-Apr-04 0:55 
GeneralRe: Funny Exception Pin
Colin Angus Mackay27-Apr-04 1:42
Colin Angus Mackay27-Apr-04 1:42 
GeneralRe: Funny Exception Pin
Heath Stewart27-Apr-04 3:50
protectorHeath Stewart27-Apr-04 3:50 
GeneralCalling an exported Function - Issue with different calling convention in C# Pin
Vini Deep27-Apr-04 0:21
Vini Deep27-Apr-04 0:21 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Mike Dimmick27-Apr-04 0:57
Mike Dimmick27-Apr-04 0:57 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Heath Stewart27-Apr-04 3:53
protectorHeath Stewart27-Apr-04 3:53 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Heath Stewart27-Apr-04 4:03
protectorHeath Stewart27-Apr-04 4:03 
You can actually P/Invoke class methods so long as you have a class factory to create an instance of that class. The problem here - like the exception text reads - is that your callback function uses a different calling convention. To be honest, I'm not really sure how you're going to get around this. I've never had to deal with callbacks in classes before (just calling methods on exported native classes).

The StdCall shouldn't work since you need to push the class instance's address in the ECX register (which the first parameter in a ThisCall method is used for). Thus, you wouldn't really be calling a method but a function, treating it as if it were static.

I did find this[^], however, which I hope proves helpful.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Vini Deep27-Apr-04 23:53
Vini Deep27-Apr-04 23:53 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Heath Stewart28-Apr-04 11:22
protectorHeath Stewart28-Apr-04 11:22 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Vini Deep29-Apr-04 2:23
Vini Deep29-Apr-04 2:23 
Generalexception in system.drawing.dll Pin
Member 69108927-Apr-04 0:14
Member 69108927-Apr-04 0:14 
GeneralRe: exception in system.drawing.dll Pin
Heath Stewart27-Apr-04 4:06
protectorHeath Stewart27-Apr-04 4:06 
QuestionHow to lunch htm through C# code Pin
Alex Getman26-Apr-04 21:40
Alex Getman26-Apr-04 21:40 
AnswerRe: How to lunch htm through C# code Pin
Kannan Kalyanaraman26-Apr-04 22:50
Kannan Kalyanaraman26-Apr-04 22:50 
AnswerRe: How to lunch htm through C# code Pin
Mike Dimmick26-Apr-04 23:34
Mike Dimmick26-Apr-04 23:34 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 0:47
Alex Getman27-Apr-04 0:47 
GeneralRe: How to lunch htm through C# code Pin
Heath Stewart27-Apr-04 4:11
protectorHeath Stewart27-Apr-04 4:11 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 4:23
Alex Getman27-Apr-04 4:23 
GeneralRe: How to lunch htm through C# code Pin
Heath Stewart27-Apr-04 5:30
protectorHeath Stewart27-Apr-04 5:30 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 6:25
Alex Getman27-Apr-04 6:25 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 6:38
Alex Getman27-Apr-04 6:38 
GeneralRe: Formula Pin
Jeff Varszegi26-Apr-04 19:43
professionalJeff Varszegi26-Apr-04 19:43 
GeneralRe: Formula Pin
DucLinh26-Apr-04 20:59
DucLinh26-Apr-04 20:59 
GeneralRe: Formula Pin
Jeff Varszegi27-Apr-04 3:09
professionalJeff Varszegi27-Apr-04 3:09 

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.