Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2004

Tip: Looking for answers? Try searching our database.

DDE Client and PFNCALLBACK

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WildHare - 23 Jul 2004 21:29 GMT
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!
Julie - 23 Jul 2004 21:55 GMT
> I am getting an error in a Windows Form which is supposed to be a DDEClient.
>
[quoted text clipped - 30 lines]
>
> Thanks!

ddeCallback has to either be a static member function or not part of your
class.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.