This is no the question it can be copy in the instance structure of netscape plugins
the question is to run PM function with a DlgBox i need to load the plugins dll with
DosLoadModule
but the DosLoadModule need a path so the question is if i'm loader from netscape 
installed
let's say in driver F the loadmodule become f:\netscape\program\plugins\npunzip.dll if 
loaded
from os2web at drive d:
it became d:\os2web\bin\plugins my question is simply how can i see from where my 
plugin is
loaded ?
so i can perform a correct DosLoadModule without hardcoding the path in the code or in 
the
os2.ini file

Michael Kaply wrote:

> The best way to do this is to add a dll init term function to your DLL and store your
> module handle in a global.
>
> Here is the code:
>
> HMODULE hmod;
>
> unsigned long _System _DLL_InitTerm(unsigned long handle, unsigned long flag)
> {
>     /* init (/
>     if (!flag)
>     {
>      hmod  = (HMODULE)handle;
>     }
> }
>
> Serge Sterck wrote:
>
> > I'm currently busy to write a unzip plugin for NS 4.61 and Mozilla
> > But i have a problem when i want to load a dlgbox i'm obliged to
> > load my plugin with DosLoadModule and pass to
> > WinDlgBox the module handle as you see in the sample serge.txt
> > i must hard coded the path where my plugin is
> > is there a method to known from where the plugin is loaded ?
> > or do you have a better code
> >
> >                                         many thanks
> >
> >   ------------------------------------------------------------------------
> > void _Optlink Launch_NPLOAD(PVOID param)
> > {
> >     APIRET         rc;
> >     HMODULE        hModule;
> >     HAB            hab;
> >     PluginInstance *This;
> >
> >     This = (PluginInstance *)param;
> >     hab = WinInitialize(0);
> >     This->hmq = WinCreateMsgQueue(hab,0);
> >     rc   = DosLoadModule (NULL, 0, "f:\\mozilla\\bin\\plugins\\npunzip.dll", 
>&hModule);
> >
> >     WinDlgBox  (HWND_DESKTOP,
> >                 HWND_DESKTOP,
> >                 (PFNWP)NPLoadProc,
> >                 (HMODULE)hModule,
> >                 ID_NPLOAD,
> >                 NULL);
> >     rc = DosFreeModule( hModule );
> >     WinDestroyMsgQueue(This->hmq);
> >     WinTerminate(hab);
> >     _endthread();
> > }
begin:vcard 
n:Sterck;Serge
tel;fax:(02) 514.59.26
tel;home:(02) 506.97.15
tel;work:(02) 506.97.15
x-mozilla-html:TRUE
org:F.M.S.B.;Service Informatique
version:2.1
email;internet:[EMAIL PROTECTED]
title:Adjoint chef de service informatique
adr;quoted-printable:;;Rue du Midi 111=0D=0A1000 Bruxelles;;;;
fn:Serge Sterck
end:vcard

Reply via email to