Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to override keydown? Pin
bskirkman9-Feb-06 14:51
bskirkman9-Feb-06 14:51 
QuestionDialogs in DLL's Pin
meinhard_risch9-Feb-06 10:54
meinhard_risch9-Feb-06 10:54 
AnswerRe: Dialogs in DLL's Pin
_anil_9-Feb-06 13:39
_anil_9-Feb-06 13:39 
GeneralRe: Dialogs in DLL's Pin
meinhard_risch10-Feb-06 3:41
meinhard_risch10-Feb-06 3:41 
QuestionHosting WebBrowser Control on CE.Net Device Pin
daniel_godshall9-Feb-06 10:39
daniel_godshall9-Feb-06 10:39 
QuestionMCBS Problem with Character Set Pin
sv2george9-Feb-06 10:05
sv2george9-Feb-06 10:05 
AnswerRe: MCBS Problem with Character Set Pin
Ryan Binns9-Feb-06 17:38
Ryan Binns9-Feb-06 17:38 
QuestionDLL Question Pin
Shay Harel9-Feb-06 10:04
Shay Harel9-Feb-06 10:04 
Hi,

I wrote a DLL which works fine if I just include the header file and the lib file in the code that uses this DLL.

However, when I try to call functions from the DLL the program crash and complain about calling conventions that do not match.

Here is the bare minimum:
******* DLL Code ****
Header:
<br />
typedef void (__stdcall *PF_SPCMCOMM_CALLBACK)(char *,pack_data *);<br />
SPCMCOMM_API int InitilizeConnection(char *appname,PF_SPCMCOMM_CALLBACK pfn);<br />


CPP file:
<br />
SPCMCOMM_API int InitilizeConnection(char *appname,PF_SPCMCOMM_CALLBACK p_cbfn)<br />
{<br />
.....<br />
}<br />


*** Client Code ***
Header file:
static void __cdecl SpcmCallBack (char *payload,pack_data *pd);

CPP file:
<br />
HISNT spcm_hInst =LoadLibrary (__TEXT("SpcmComm.dll"));//load the dll<br />
<br />
if (spcm_hInst)<br />
{<br />
  PF_SPCMCOMMINIT initspcm;//pointer to the function<br />
  initspcm = (PF_SPCMCOMMINIT) GetProcAddress spcm_hInst, "InitilizeConnection");<br />
  if (initspcm)<br />
  {<br />
    //*****this is where the code crash *****		<br />
    int result=initspcm ("TestAlertUUT",(PF_SPCMCOMM_CALLBACK)SpcmCallBack);<br />
  }<br />

AnswerRe: DLL Question Pin
Rick York9-Feb-06 10:24
mveRick York9-Feb-06 10:24 
GeneralRe: DLL Question Pin
Shay Harel9-Feb-06 13:33
Shay Harel9-Feb-06 13:33 
AnswerRe: DLL Question Pin
sunit59-Feb-06 17:11
sunit59-Feb-06 17:11 
AnswerRe: DLL Question Pin
Ryan Binns9-Feb-06 17:39
Ryan Binns9-Feb-06 17:39 
QuestionPrinting Pin
#realJSOP9-Feb-06 9:11
professional#realJSOP9-Feb-06 9:11 
AnswerRe: Printing Pin
David Crow9-Feb-06 9:14
David Crow9-Feb-06 9:14 
GeneralRe: Printing Pin
#realJSOP9-Feb-06 9:31
professional#realJSOP9-Feb-06 9:31 
AnswerRe: Printing Pin
Shog99-Feb-06 11:45
sitebuilderShog99-Feb-06 11:45 
AnswerRe: Printing Pin
Michael Dunn9-Feb-06 10:14
sitebuilderMichael Dunn9-Feb-06 10:14 
GeneralRe: Printing Pin
#realJSOP10-Feb-06 5:26
professional#realJSOP10-Feb-06 5:26 
GeneralRe: Printing Pin
#realJSOP10-Feb-06 10:13
professional#realJSOP10-Feb-06 10:13 
AnswerRe: Printing Pin
Stan Shannon9-Feb-06 13:54
Stan Shannon9-Feb-06 13:54 
QuestionHow to disable all controls in the dialog box Pin
Eugene Pustovoyt9-Feb-06 8:39
Eugene Pustovoyt9-Feb-06 8:39 
AnswerRe: How to disable all controls in the dialog box Pin
Andy Moore9-Feb-06 9:14
Andy Moore9-Feb-06 9:14 
QuestionRe: How to disable all controls in the dialog box Pin
David Crow9-Feb-06 9:15
David Crow9-Feb-06 9:15 
AnswerRe: How to disable all controls in the dialog box Pin
#realJSOP9-Feb-06 10:09
professional#realJSOP9-Feb-06 10:09 
AnswerRe: How to disable all controls in the dialog box Pin
jhwurmbach10-Feb-06 3:27
jhwurmbach10-Feb-06 3:27 

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.