473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

DDE Client and PFNCALLBACK

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!

Nov 17 '05 #1
1 2417
WildHare wrote:

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!


ddeCallback has to either be a static member function or not part of your
class.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
3
by: =?Utf-8?B?Q2luZHk=?= | last post by:
Hi all, I am trying to connect to a electromyograph machine for my thesis project, and I have a VB DDE client whose DDE functionality I want to convert to VC++. However I can't make my VC++...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
1
by: FadeOut | last post by:
Hi everyone, I'm trying to make an application who sends querys to a tcp server who will then send an answer containing "rows" of commas separated values as an answer. I'm pretty new to tcp...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.