Article View: borland.public.cppbuilder.nativeapi
Article #9770Re: problems with GetCurrentThreadId(), GetWindowThreadProcessId()...
From: Remy Lebeau (TeamB)
Date: Tue, 15 Jun 2004 04:22
Date: Tue, 15 Jun 2004 04:22
84 lines
4246 bytes
4246 bytes
"Oren Halvani" <NoSpam@fdtd.com> wrote in message
news:40ce4a4b@newsgroups.borland.com...
> // dwDate = "MyTextfile.txt" ???
> // cbData = FileSize("MyTextfile.txt") ???
No and no.
dwData is a unique ID number that identifies the data as being your own, and
not someone else's. WM_COPYDATA is a general-purpose message, it can be
used to transfer any type of binary data between processes, so you have to
provide your own ID so that the receiver of the message knows that it is
actually your own data and not something else.
cbData is the byte size of the data that is pointed to by lpData, not
dwData. It is the number of bytes actually being transferred by
WM_COPYDATA.
> so when I want to open the textfile that the main application
> has created, i'm passing the filename as the first parameter to
> "PCRE.exe"
>
> SendMessage(hWnd, WM_COPYDATA, 0, ???LPARAM???);
That is not what I said.
> > 2) save the text to a temporary file and then simply pass
> > the filename to PCRE, such as a command line argument.
> > Then PCRE can load the file at its leisure and you don't
> > have to use window messages at all.
>
> no problem ! but again how do i setup WM_COPYDATA
> for doing this...?
That is not what I said. I said to use the command line arguments, ie:
"c:\\path\\pcre.exe myfilename.txt"
That is part of CreateProcess() itself. That has nothing to do with
WM_COPYDATA at all.
> sorry..i realy don't understand the WM_COPYDATA..
You did not pay attention to what I said earlier. I was suggest two
completely different approaches, only one of which involved WM_COPYDATA.
> OK I explain...it extracts strings with reg expressions
> and sends them back to my main application for doing
> more several operations..
Again, I ask - why can't your main application do that directly? Why do you
need a separate executable for that? Using a separate executable makes the
design much more complicated than it has to be.
> PCRE is written under BCB 6, that supports as the name
> say "Perl Compatible Regular Expressions"...My Main
> application (written in BCB 3) doesn't have it..
There are plenty of PCRE implementations available for BCB3. Just because
Borland does not provide such implementations does not mean that you can't
use third-party implementations. Such as
http://www.tropicsoft.com/Components/RegularExpression/
> i gave it up to use third-party PCRE libaries, no one of them
> has worked well !
I doubt that. There are plenty of popuar libraries that work fine for other
people. If they don't work for you, then you are probably not using them
correctly in the first place.
> also i tryed many, many, many times to install various components
> with Reg Expression Support, but I never could install them.. (the
> compiler) couldn NOT install them..and using/including the PCRE
> header from BCB 6 into BCB 3 is absolutly NOT possible...so i
> choosed this cheesy solution..
I highly recommend that you figure it out, because using a separate
executable is an over-complicated way to approach this issue. At the very
least, if you must use a separate module than you should use a DLL instead
of an executable.
Gambit
Technical Details
Message-ID:
<40ce7a96$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40cd0458$1@newsgroups.borland.com> <40cd3589@newsgroups.borland.com> <40ce4a4b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,288e4db03c5a16db X-Google-Attributes: gid10cc67,public From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40cd0458$1@newsgroups.borland.com> <40cd3589@newsgroups.borland.com> <40ce4a4b@newsgroups.borland.com> Subject: Re: problems with GetCurrentThreadId(), GetWindowThreadProcessId()... Date: Mon, 14 Jun 2004 21:22:46 -0700 Lines: 86 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.169.168.124 Message-ID: <40ce7a96$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1087273622 68.169.168.124 (14 Jun 2004 21:27:02 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail