Skip to main content

[Migrated content. Thread originally posted on 30 October 2003]

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!!!

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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.

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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.

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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.

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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.

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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.

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
Thank you Luca. It does work. I am uncertain to why it does. Can you shed some light on it?

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
Thank you Luca. It does work. I am uncertain to why it does. Can you shed some light on it?

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
Thank you Luca. It does work. I am uncertain to why it does. Can you shed some light on it?

[Migrated content. Thread originally posted on 30 October 2003]

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!!!
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