Article View: borland.public.cppbuilder.internet.web
Article #1797Re: get dll path
From: Fabi�n
Date: Thu, 08 Jul 2004 18:25
Date: Thu, 08 Jul 2004 18:25
54 lines
2340 bytes
2340 bytes
That works.... but I don't know how to pass that information to the
Unit2.cpp
USEFORM("Unit2.cpp", PageProducerPage1); /* TWebAppPageModule: File Type */
char dllpath[1000];
//--------------------------------------------------------------------------
-
#define Application Webbroker::Application
#pragma link "isapiapp.obj"
#pragma link "isapithreadpool.obj"
#pragma link "webbroker.obj"
#pragma link "webinit.obj"
//--------------------------------------------------------------------------
-
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
try
{
GetModuleFileName(hinst,dllpath,1000);
if (reason == DLL_PROCESS_ATTACH) {
CoInitFlags = COINIT_MULTITHREADED;
Application->Initialize();
Application->Run();
}
}
catch (Exception &exception)
{
}
return 1;
}
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> escribi� en el
mensaje news:40ed8f41$1@newsgroups.borland.com...
>
> "Fabi�n" <fabianfierro@hotmail.com> wrote in message
> news:40ed8609$1@newsgroups.borland.com...
>
> > I can't figure the way to get the path of the dll.
>
> Call GetModuleFileName() using the HINSTANCE passed to the DLL's
> DllEntryPoint() function.
>
> > All I get is the path of dllhost.exe. (Application->ExeName)
>
> You are not specifying the proper HINSTANCE when calling
> GetModuleFileName().
>
>
> Gambit
>
>
Technical Details
Message-ID:
<40ed9170$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40ed8609$1@newsgroups.borland.com> <40ed8f41$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,319a966748b9038a X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII Reply-To: "Fabi�n" <fabianfierro@hotmail.com> From: "Fabi�n" <fabianfierro@hotmail.com> Newsgroups: borland.public.cppbuilder.internet.web References: <40ed8609$1@newsgroups.borland.com> <40ed8f41$1@newsgroups.borland.com> Subject: Re: get dll path Date: Thu, 8 Jul 2004 15:25:36 -0300 Lines: 56 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: 200.68.64.9 Message-ID: <40ed9170$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089311088 200.68.64.9 (8 Jul 2004 11:24:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail