Fivewin and .dll (again) 
Author Message
 Fivewin and .dll (again)


pointed out that you have to use

        hBor := LoadLibrary("bwcc.dll")

before loading a resource created with BRW.

I then discovered that bwcc.dll doesn't get unloaded by

        FreeLibrary( hBor ),

because it seems that LoadLib() 'loads' it twice, and FreeLib() only
decrements the load count by one. This leaves bwcc.dll in memory, which I'd
rather not do <g>.

Try this code to check it for yourself:

#include "FiveWin.ch"

Procedure Main()

   Local hBor
   hBor := LoadLibrary( "bwcc.dll" )
   MsgInfo( "BWCC.DLL loaded" )
   FreeLibrary( hBor )
   MsgInfo( "BWCC.DLL unloaded" )

RETURN

After execution, both a Dashboard resource odometer and a shareware Windows
task manager show bwcc.dll still in memory.

I also see that hst.prg (a Fivewin sample) does the same thing!

Any suggestions?

Thanks,

bob



Fri, 24 Jul 1998 03:00:00 GMT  
 Fivewin and .dll (again)

Quote:


>pointed out that you have to use

>    hBor := LoadLibrary("bwcc.dll")

>before loading a resource created with BRW.

>I then discovered that bwcc.dll doesn't get unloaded by

>    FreeLibrary( hBor ),

>because it seems that LoadLib() 'loads' it twice, and FreeLib() only
>decrements the load count by one. This leaves bwcc.dll in memory, which I'd
>rather not do <g>.

It works fine here...

BWCC may be in use by another program (it may have been open before your program
loaded it), and it won't unload as long as anything is using it.

Another possibility is that you may not be passing freelibrary a valid handle.

Terry



Sun, 26 Jul 1998 03:00:00 GMT  
 Fivewin and .dll (again)

A couple of things to look at...  First the fact you have the Resource
Workshop loaded simultaneously with a FiveWin app that uses bwcc.dll
may have an effect.

Second...  Look in your win.ini (or is it system.ini) for any
reference to bwcc.dll.

Some program(s) insert a section in the ini file something like
BitMapLibrary=BWCC.DLL

Which pre-loads the dll when you start windows.  This could also have
an effect.

Quote:

>pointed out that you have to use
>    hBor := LoadLibrary("bwcc.dll")
>before loading a resource created with BRW.
>I then discovered that bwcc.dll doesn't get unloaded by
>    FreeLibrary( hBor ),
>because it seems that LoadLib() 'loads' it twice, and FreeLib() only
>decrements the load count by one. This leaves bwcc.dll in memory, which I'd
>rather not do <g>.
>Try this code to check it for yourself:
>#include "FiveWin.ch"
>Procedure Main()
>   Local hBor
>   hBor := LoadLibrary( "bwcc.dll" )
>   MsgInfo( "BWCC.DLL loaded" )
>   FreeLibrary( hBor )
>   MsgInfo( "BWCC.DLL unloaded" )
>RETURN
>After execution, both a Dashboard resource odometer and a shareware Windows
>task manager show bwcc.dll still in memory.
>I also see that hst.prg (a Fivewin sample) does the same thing!
>Any suggestions?
>Thanks,
>bob

:=JHS
FiveWin - Clipper for Windows
**************************************************************************
          John H. Stolte, Sr. - Omicron Software Publishing Corp.
     **** Publisher of FiveWin - FiveDB and FiveDLL for Clipper! ****
14 High Street  P.O. Box 87, Cartersville {*filter*}ia 23027 USA
[Voice] (804) 375-9703 - [Fax] (804) 375-9733 - [BBS] (804) 375-9639

WWW: http://www.*-*-*.com/ ;FTP: ftp.wji.com (change dir to /Omicron)
**************************************************************************


Sun, 26 Jul 1998 03:00:00 GMT  
 Fivewin and .dll (again)


Quote:


>>pointed out that you have to use

>>      hBor := LoadLibrary("bwcc.dll")

>>before loading a resource created with BRW.

>>I then discovered that bwcc.dll doesn't get unloaded by

>>      FreeLibrary( hBor ),

>>because it seems that LoadLib() 'loads' it twice, and FreeLib() only
>>decrements the load count by one. This leaves bwcc.dll in memory, which I'd
>>rather not do <g>.

>It works fine here...

>BWCC may be in use by another program (it may have been open before your program
>loaded it), and it won't unload as long as anything is using it.

>Another possibility is that you may not be passing freelibrary a valid handle.

>Terry

...so I tried unloading the library twice.  And it appears that, having
unloaded it twice, next time I run the program, my Borland Bricks dont
appear, until I restart Windows.

Damn spooky.  I now just unload it once (which seems right anyway), so
that the user can run the program more than once in one Windows session.
--
Pete Clark



Wed, 29 Jul 1998 03:00:00 GMT  
 Fivewin and .dll (again)

Pete: Concerning the DLL...

Try doing this...

INIT PROCEDURE Hello()
    hBWCC := LoadLibrary("BWCC.DLL")
RETURN

EXIT PROCEDURE ByeBye()
    If !Empty(hBWCC)
        FreeLibrary(hBWCC)
        hBWCC:=NIL
    Endif
RETURN

This will ALMOST GUARANTEE that (unless a Ctrl-Alt-Del, Power Outage,
Power Switch, or other fatality happens) an EXIT procedure WILL get
CALLED.  Even WITH AN ERROR it gets called (kinda neat).

-Jim Gale
Touchstone
FastTrack for FiveWin Training Seminars
(909) 679-3364



Fri, 31 Jul 1998 03:00:00 GMT  
 Fivewin and .dll (again)

Quote:

> ...so I tried unloading the library twice.  And it appears that, having
> unloaded it twice, next time I run the program, my Borland Bricks dont
> appear, until I restart Windows.

What is "Borland Bricks"? Are you sure that BWCC.DLL isn't in memory
anyway? Have you checked? Find a friend with a copy of VB and nick the
Windows Process Status utility (WPS.EXE). Look for the DLL when you
first start up Windows.

Quote:
> Damn spooky.  I now just unload it once (which seems right anyway), so
> that the user can run the program more than once in one Windows session.

It sounds to me like you are running somthing that uses BWCC.DLL anyway.

--
Dave Pearson              | Let us not assasinate this lad further, Senator.

--------------------------+   Have you no sense of decency, Sir?
Compuserve: 101510,2235   |    At long last, have you no sense of decency?



Fri, 31 Jul 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. CTL3D.DLL, CTL3D32.DLL, CTL3DV2.DLL and Clipper/Fivewin/R&R

2. FiveWin: can't switch from DLL to DLL

3. Scheme vs ML again and again and again and again

4. Scheme vs ML again and again and again and again

5. Is the FiveWin newsgroup down again ?

6. FiveWin+AXS problem, nwipxspx.dll wanted

7. Fivewin/Clipper/C and DLLs

8. Using .DLL with FiveWin

9. FiveWin and .Dll

10. EXE/DLL CW4 again - HOW?

11. ERROR Again: Error 173 with DLLs

 

 
Powered by phpBB® Forum Software