Forums  

Go Back   Forums > Acucorp Customer Forum > General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2003, 09:44 AM
SRFish SRFish is offline
Registered User
 
Join Date: May 2003
Location: Leicester, UK
Posts: 76
Question Setting Search path for WinApi DLL's

I am doing CALL "gdi32.dll" to load the dll, but the call fails because it can't find it. The dll resides in windows\system folder on Win98 and WinXP but in a different folder on Win2000.

Has anyone managed to ovecome this problem without giving an explict path in the call statement like CALL "c:\windows\system\gdi32.dll"?

I would ideally like to have my program do a generic CALL that will place the dll in the correct folder and not to have a seperate config file according the client.

Help!!!

Last edited by SRFish : 10-30-2003 at 09:46 AM.
Reply With Quote
  #2  
Old 10-30-2003, 01:55 PM
DanM's Avatar
DanM DanM is offline
Registered User
 
Join Date: Dec 2002
Location: Cornwall, NY
Posts: 288
You could use the ACCEPT FROM ENVIRONMENT statement to get environment variables such as windir, systemroot, OS and even ComSpec to help you figure out the default windows and system directories.
Reply With Quote
  #3  
Old 10-30-2003, 10:41 PM
gforseth gforseth is offline
Super Moderator
 
Join Date: Nov 2002
Location: Norway
Posts: 1,259
Provided that the system path includes the path to the Windows and System directories, your experience might be a part of a known phenomena.

This probably happens because your FILE-PREFIX is set, and does not include the Windows system directory.
This has been corrected for an upcoming version, which will enforce a search in the Windows and the System directory regardless of the FILE-PREFIX setting if nothing is found when you are searching for a DLL.

A solution to this would be to have a dynamic FILE-PREFIX that you calibrate upon installation, e.g. you create it as a part of the installation, and when you create it, you also make sure to call the Windows API functions GetSystemDirectory and GetWindowsDirectory. The outcome of these then, should be applied to your other settings of the FILE-PREFIX variable.

Sorry for the inconvenience of this.
Reply With Quote
  #4  
Old 11-15-2003, 11:11 AM
Luca's Avatar
Luca Luca is offline
Moderator
 
Join Date: Nov 2002
Location: Italy
Posts: 31
Hi all,
I think that you can solve your problem by setting "." in the code_prefix variable.

e.g.

accept old_prefix from environment "code_prefix"
set environment "code_prefix" to "."
[...]
call "gdi32.dll"
[...]

set environment "code_prefix" to "."

hope this help.
Reply With Quote
  #5  
Old 11-25-2003, 08:25 AM
SRFish SRFish is offline
Registered User
 
Join Date: May 2003
Location: Leicester, UK
Posts: 76
Thank you Luca. It does work. I am uncertain to why it does. Can you shed some light on it?
Reply With Quote
  #6  
Old 11-25-2003, 09:07 AM
Luca's Avatar
Luca Luca is offline
Moderator
 
Join Date: Nov 2002
Location: Italy
Posts: 31
Hi SRFish,
the reason it works is because setting "."
in the code_prefix activates the smart
search for the DLL.
The runtime then looks for the DLL in the
Windows and windows\system directory whenever is your OS (it takes care about
the various WINNT, WINDOWS, SYSTEM, SYSTEM32, etc).

I read it in documentation, but I can't find
it out no more...

I'll still try, and if I will hit it I'll post it for
your convenience
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 02:36 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.