🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SendMessage() repetition error

#5788
From: Daniel Stevenson
Date: Fri, 01 Jul 2005 01:30
62 lines
2751 bytes
I think I have found my problem...I think.

I think I have been chasing a deadend.

It appears that this problem is only occuring when debugging within Builder
(CB6), but when I run the application directly it all works.
:(

"Daniel Stevenson" <daniel@ocreage.com.au> wrote in message
news:42c49259@newsgroups.borland.com...
> I've got an application (ie. Papa.exe) that executes a second application
> (Bubba.exe).
>
> Pappa has to wait until Bubba.exe has finished executing before continuing
> so I have used SendMessage() to tell Papa.exe when it is finished.
>
> This all works fine, my problem is that Papa.exe has to execute Bubba.exe
> two times.  After the first exeution Papa.exe receives the message from
> Bubba.exe to say it has finished, so Papa.exe then executes bubba.exe a
> second time with it's new parameters.  Bubba then performs its duties
again
> but when it sends it's finish message using SendMessage(), Papa.exe
doesn't
> see the message.
>
> I've included the code I've used.
>
> Papamain.h
> private:
>   void __fastcall UMSpecialMessage(TMessage &Message);
> public:
>   BEGIN_MESSAGE_MAP
>     MESSAGE_HANDLER(UM_SPECIALMESSAGE,TMessage,UMSpecialMessage);
>   END_MESSAGE_MAP(TForm);
>
> Papamain.cpp
> void __fastcall TMyfrm::UMSpecialMessage(TMessage &Message)
> {
>   TaskComplete = true;            //this is not being called the second
time
> }
>
>
> Bubbamain.h
> #define  UM_SPECIALMESSAGE (WM_USER + 1001)
>
>
> Bubbamain.cpp
> void __fastcall TfrmDBUpdater::FormClose(TObject *Sender,
>       TCloseAction &Action)
> {
>   //Send message to notify it of completion
>   HWND AppHndl = FindWindow("TMyfrm", NULL);
>   if (AppHndl)
>   {
>     SendMessage(AppHndl, UM_SPECIALMESSAGE, 0, 0);
>   }
> }
>
> Can anyone see why I wouldn't be seeing the second SendMessage()?
>
>
Technical Details
Message-ID: <42c49c98$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42c49259@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,696995b85f90e7d7
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Daniel Stevenson" <daniel@ocreage.com.au>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42c49259@newsgroups.borland.com>
Subject: Re: SendMessage() repetition error
Date: Fri, 1 Jul 2005 11:30:18 +1000
Lines: 64
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: 202.174.233.53
Message-ID: <42c49c98$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120181400 202.174.233.53 (30 Jun 2005 18:30:00 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail