🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8444

Re: SendMessage problem

#8444
From: Remy Lebeau (TeamB)
Date: Sat, 23 Oct 2004 19:54
27 lines
1600 bytes
"Ray" <someone@someisp.net> wrote in message
news:4173f0a3@newsgroups.borland.com...

> cds=new COPYDATASTRUCT;

You do not need to create the COPYDATASTRUCT dynamically.  Use it on the
stack instead:

    COPYDATASTRUCT cds = {0};
    //...
    SendMessage(myHandle, WM_COPYDATA, 0, (LPARAM)&cds);

> pDS=(COPYDATASTRUCT*)(&buff);

You are casting the wrong thing.  It should be this instead:

    pDS = (COPYDATASTRUCT*)buff;

> memcpy(&tempbuffer, (unsigned short*)(pDS->lpData),100*sizeof(short));

You can simplify that to this:

    memcpy(tempbuffer, pDS->lpData, pDS->cbData);


Gambit
Technical Details
Message-ID: <417ab6b5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!news-out1.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!in.nntp.be!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4173ab7d@newsgroups.borland.com> <4173b404$1@newsgroups.borland.com> <4173f0a3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f5a1aef685366ed1
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4173ab7d@newsgroups.borland.com> <4173b404$1@newsgroups.borland.com> <4173f0a3@newsgroups.borland.com>
Subject: Re: SendMessage problem
Date: Sat, 23 Oct 2004 12:54:08 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <417ab6b5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1098561205 68.69.17.41 (23 Oct 2004 12:53:25 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!news-out1.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!in.nntp.be!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail