🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Messages between DLL and Application

#14076
From: Martin C
Date: Mon, 25 Aug 2003 22:37
26 lines
2022 bytes
Thanks Remy for your help, I used the WM_COPYDATA message and so far the dll
sends the data captured to my application, although I have one problem
managing the message that I receive

I use the following code to process the message that I receive

void __fastcall TForm1::OnCopyData(TWMCopyData& Message)
{
   if(Message.CopyDataStruct->dwData > 0)
   {    AnsiString
TheRecievedString=reinterpret_cast<char*>(Message.CopyDataStruct->lpData);
         Memo1->Lines->Add(TheRecievedString.c_str());
   }
}
//--------------------------------------------------------------------------
-

and  I really receive the data from the dll, but corrupted at the end of
each string received...!!
ex: if I should be receiving (notepad.exe) I receive instead
(notepad.exe�?w?FOw)...!!!   so what I doing wrong here to cause this
rubbish to show at the end of the message received???

and BTW I am keeping im mind the shared memory issue..

thanks in advance
Technical Details
Message-ID: <3f4a98a3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f4a7447@newsgroups.borland.com> <3f4a770d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10cc67,64add9c25ea7ead
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-25 16:21:46 PST
From: "Martin C" <martinc@aol.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f4a7447@newsgroups.borland.com> <3f4a770d$1@newsgroups.borland.com>
Subject: Re: Messages between DLL and Application
Date: Mon, 25 Aug 2003 14:37:05 -0800
Lines: 28
Organization: V Safe
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 212.103.167.173
Message-ID: <3f4a98a3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061853347 212.103.167.173 (25 Aug 2003 16:15:47 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail