W
WildHare
I am getting an error in a Windows Form which is supposed to be a DDEClient.
Error:
error C2440: 'type cast' : cannot convert from 'overloaded-function' to
'PFNCALLBACK'
Following are the pertinent areas of codes:
First we declare the prototype outside the Form Class:
HDDEDATA CALLBACK ddeCallback (UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1,
HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2);
Then Inside the Form Class we do the following:
To start the DDE Client in Form_Load event handler is the following code:
iReturn = DdeInitialize(&idInst, (PFNCALLBACK) ddeCallback,
APPCLASS_STANDARD | APPCMD_CLIENTONLY, 0 );
Then an override method within the Form Class
HDDEDATA CALLBACK
ddeCallback (UINT uType, UINT uFmt, HCONV hconv,HSZ hsz1, HSZ hsz2, HDDEDATA
hdata,DWORD dwData1, DWORD dwData2)
{
return (HDDEDATA) NULL;
}
From everything I can tell, this should work. What have I
missed/forgotten/had a brain cramp about?
Thanks!
Error:
error C2440: 'type cast' : cannot convert from 'overloaded-function' to
'PFNCALLBACK'
Following are the pertinent areas of codes:
First we declare the prototype outside the Form Class:
HDDEDATA CALLBACK ddeCallback (UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1,
HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2);
Then Inside the Form Class we do the following:
To start the DDE Client in Form_Load event handler is the following code:
iReturn = DdeInitialize(&idInst, (PFNCALLBACK) ddeCallback,
APPCLASS_STANDARD | APPCMD_CLIENTONLY, 0 );
Then an override method within the Form Class
HDDEDATA CALLBACK
ddeCallback (UINT uType, UINT uFmt, HCONV hconv,HSZ hsz1, HSZ hsz2, HDDEDATA
hdata,DWORD dwData1, DWORD dwData2)
{
return (HDDEDATA) NULL;
}
From everything I can tell, this should work. What have I
missed/forgotten/had a brain cramp about?
Thanks!