🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Handle of the Host App calling a DLL ??

#5728
From: David
Date: Mon, 25 Jul 2005 14:20
43 lines
2583 bytes
> Ah. So you are writing a plug-in of some form - in other words, a
> pre-existing application will call your DLL though a predefined
> interface?

Precisely, so it would be good to know the identity of the host. Currently I
am using FindWindow which works OK but assumes you know the name of the
calling app etc. A much more transparent way of doing this would be
beneficial.

It's funny because TApplication gives the ExeName of the host app but not
the Handle ??

Regards
David


"Alan Bellingham" <alanb@episys.com> wrote in message
news:04g9e1ds95n92cgrj36tdvi80ng3mtmmtd@4ax.com...
> [I'm moving this over to .nativeapi, since it's got nothing to do with
> language, BTW. Followup therefore set]
>
> "David" <davids@unite.com.au> wrote:
>
> >> But since you're writing the DLL, and the only
> >> way into your DLL is by a function call, why don't you just make the
> >> caller supply the handle you need to that function call?...
> >
> >The only problem is I don't have access to the exe source code to add
this
> >call. It's a standalone app and I have no control over it.
>
> Ah. So you are writing a plug-in of some form - in other words, a
> pre-existing application will call your DLL though a predefined
> interface?
>
> OK, so that's more of a problem, but not insuperable.
>
> I'd probably use EnumThreadWindows(). This requires a thread ID, which I
> suspect I could get using GetCurrentThreadId()
>
> Alan Bellingham
> --
> ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID: <42e4f525@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42e4a0ed$1@newsgroups.borland.com> <4p99e15lmg4hvdr5iu7lhmch0n12mdn5uc@4ax.com> <42e4ab57@newsgroups.borland.com> <04g9e1ds95n92cgrj36tdvi80ng3mtmmtd@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,57774575e612067b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "David" <davids@unite.com.au>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42e4a0ed$1@newsgroups.borland.com> <4p99e15lmg4hvdr5iu7lhmch0n12mdn5uc@4ax.com> <42e4ab57@newsgroups.borland.com> <04g9e1ds95n92cgrj36tdvi80ng3mtmmtd@4ax.com>
Subject: Re: Handle of the Host App calling a DLL ??
Date: Tue, 26 Jul 2005 00:20:48 +1000
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 211.26.206.233
Message-ID: <42e4f525@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1122301221 211.26.206.233 (25 Jul 2005 07:20:21 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail