Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A program within a program Pin
BlackDice8-Mar-05 2:38
BlackDice8-Mar-05 2:38 
GeneralRe: A program within a program Pin
u6ik8-Mar-05 3:00
u6ik8-Mar-05 3:00 
GeneralRe: A program within a program Pin
Phil J Pearson8-Mar-05 4:47
Phil J Pearson8-Mar-05 4:47 
GeneralRe: A program within a program Pin
David Crow8-Mar-05 3:56
David Crow8-Mar-05 3:56 
GeneralRe: A program within a program Pin
u6ik8-Mar-05 4:12
u6ik8-Mar-05 4:12 
GeneralRe: A program within a program Pin
David Crow8-Mar-05 4:41
David Crow8-Mar-05 4:41 
QuestionData types mismatches or just incompatibility? Pin
Axonn Echysttas7-Mar-05 23:18
Axonn Echysttas7-Mar-05 23:18 
AnswerRe: Data types mismatches or just incompatibility? Pin
Cedric Moonen8-Mar-05 0:02
Cedric Moonen8-Mar-05 0:02 
Hi !

No, a calling convention error is not because the parameters you pass are wrong. A calling convention describe in fact which part will clean the stack after the function has been called: the program which calls the dll or the dll itselfs. VB and C++ uses different calling conventions: for VB it is the standard calling convention (__stdcall) and for C++ it is the the C calling convention.
So, here your HookSystem and UnHookSystem functions have the C calling convention in the dll but VB calls them with it own calling convention. So, you have to change the calling convention of these functions inside your dll: just add a __stdcall :

<br />
int __stdcall HookSystem(int AddressOfCallBackFunction);<br />
int __stdcall UnHookSystem(int HookID);<br />
<br />
int __stdcall HookSystem(int AddressOfCallBackFunction)<br />
{	<br />
....<br />
}<br />
int __stdcall UnHookSystem(int HookID)<br />
{<br />
....<br />
}


You could also use APIENTRY as it is defined as __stdcall
GeneralRe: Data types mismatches or just incompatibility? Pin
Axonn Echysttas8-Mar-05 3:16
Axonn Echysttas8-Mar-05 3:16 
Generalscreen capture driver Pin
TomLismont7-Mar-05 23:06
TomLismont7-Mar-05 23:06 
General3D border frame Pin
Joris van der Pol7-Mar-05 23:01
Joris van der Pol7-Mar-05 23:01 
GeneralRe: 3D border frame Pin
namaskaaram8-Mar-05 0:07
namaskaaram8-Mar-05 0:07 
GeneralRe: 3D border frame Pin
namaskaaram8-Mar-05 0:13
namaskaaram8-Mar-05 0:13 
GeneralRe: 3D border frame Pin
Joris van der Pol13-Mar-05 1:58
Joris van der Pol13-Mar-05 1:58 
Generalchange mouse cursor at run time Pin
Anand for every one7-Mar-05 22:41
Anand for every one7-Mar-05 22:41 
GeneralRe: change mouse cursor at run time Pin
namaskaaram7-Mar-05 22:56
namaskaaram7-Mar-05 22:56 
QuestionHow to handle Close(X) button on Property Sheet Pin
Duy Nghia7-Mar-05 22:24
Duy Nghia7-Mar-05 22:24 
AnswerRe: How to handle Close(X) button on Property Sheet Pin
ThatsAlok7-Mar-05 23:03
ThatsAlok7-Mar-05 23:03 
GeneralFile needed! Pin
Larsson7-Mar-05 22:15
Larsson7-Mar-05 22:15 
GeneralRe: File needed! Pin
Ravi Bhavnani8-Mar-05 2:53
professionalRavi Bhavnani8-Mar-05 2:53 
GeneralRe: File needed! Pin
Larsson8-Mar-05 9:32
Larsson8-Mar-05 9:32 
GeneralRe: File needed! Pin
Ravi Bhavnani8-Mar-05 9:36
professionalRavi Bhavnani8-Mar-05 9:36 
Questionwhat if classes need each other? Pin
ThinkingPrometheus7-Mar-05 22:01
ThinkingPrometheus7-Mar-05 22:01 
AnswerRe: what if classes need each other? Pin
Steen Krogsgaard7-Mar-05 22:42
Steen Krogsgaard7-Mar-05 22:42 
AnswerRe: what if classes need each other? Pin
namaskaaram7-Mar-05 23:59
namaskaaram7-Mar-05 23:59 

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.