Article View: borland.public.cppbuilder.nativeapi
Article #4263Re: Continuing problem with SendMessage and WM_CCOPYDATA
From: Bob Gonder
Date: Mon, 27 Feb 2006 14:57
Date: Mon, 27 Feb 2006 14:57
43 lines
2305 bytes
2305 bytes
Nate Lockwood wrote:
> String sTitle = "Google Earth (C) Tool";
> String sMessage = "USDA.FS.FireScience.GooleEarthTool.Awake";
> Application->Title = sTitle + " Temporary";
> WM_MYMSG = RegisterWindowMessage(sMessage.c_str());
Why do you insist on using String for what should be a simple c-string
(char array) ?
char sMessage[] = "USDA.FS.FireScience.GooleEarthTool.Awake";
WM_MYMSG = RegisterWindowMessage(sMessage);
Or, simpler:
WM_MYMSG=RegisterWindowMessage("USDA.FS.FireScience.GooleEarthTool.Awake");
> char * pBuf = "Second instance";
>
> COPYDATASTRUCT MyCDS;
> MyCDS.dwData = WM_MYMSG; // unique identifier
> MyCDS.cbData = strlen(pBuf) + 1; // buffer size 1 -> no data
> MyCDS.lpData = &pBuf; // address of the data
You want a pointer to the data, not a pointer to a pointer to the
data.
MyCDS.lpData = pBuf; // address of the data
>// in my main form .h
> // This function is never called...
>void __fastcall TFormMain::WMCopyData(TWMCopyData &message)
>{
> if(message.CopyDataStruct->dwData == WM_MYMSG)
> {
> Application->Restore();
> Show();
Verify that it is never called, and not just called with "incorrect"
data:
}else{ ShowMessage("WM_MYMSG is not correct");
> }
Technical Details
Message-ID:
<2f36029db0t6k0taqhpch04dcvrm1832e5@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<44021981$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6afbc9bf5041d787 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Continuing problem with SendMessage and WM_CCOPYDATA Date: Mon, 27 Feb 2006 06:57:58 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <2f36029db0t6k0taqhpch04dcvrm1832e5@4ax.com> References: <44021981$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.87.85 X-Trace: newsgroups.borland.com 1141052276 69.69.87.85 (27 Feb 2006 06:57:56 -0700) Lines: 44 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail