- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Btw, I don't think such project organization is good. We use a similar one, except that both .dll's and .exe's go to in directory. Now, if you can persuade your project managers... :-).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
From another post Steve Lionel gives the following information :
"Windows looks for DLLs using the following order:
Current directory
Directory containing the executable
PATH
Windows
WindowsSystem"
Is it possible to add Project/dll to the PATH ?
Like Jugoslav we also put dlls in the bin directory along with the exe files.
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would it be my decision, I would put the dll in the executable directory as well. But I have to use this structure :-( Company standard.
Adding the directory into PATH came to my mind too, but it wont work. When I use GetEnvQQ Iget the whole PATH, I append my dll path and useSetEnvQQ to set the new path. GetEnvQQ gets the updated path, but when I type PATH from the command line, its not in there.
Code:
l = GetEnvQQ('path',String) write (NewString,'(4a)') 'PATH=',trim(String),';',trim(DllDir) l = SetEnvQQ(NewString) l = GetEnvQQ('path',string)
Neither does my program run because it wont find the dll. Could that be because the normal userdont have administrative rights in Windows?
Isnt it possible to compile put the dll into the exe while compiling or to do this with an extra tool?
Thanks in advance,
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In any case, it won't work -- with static binding (linking with dll.lib), the dll is loaded on the application startup and there's nothing you can do from the code to make it be found.
Whoever made up that "Company standard" should be fired how they meant it to work at all?
See here. It seems that it's doable (didn't try) if you set the .dll directory as the "Startup directory" ("Start in") VS directory or application's shortcut, but that's a workaround -- as far as I know, it's not generally doable if user starts the application by double-clicking it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GetEnvQQ does not return a trailing char(0).
LoadLibrary and LoadLibraryEx return both .false. and wont work too. Btw. I cant use loc(string) in the LoadLib syntax because "The type of the actual argument differs from the type of the dummy argument. [LOC]"...
The "PATH=..." is necessary for SetEnvQQ to be executed correctly. Thats the example from CVF help:
USE DFLIB
LOGICAL(4) success
success = SETENVQQ("PATH=c:mydir mp")
Fire the people behind those "company standards"? That would be great :-) People in higher positions dont see a problem to move one file in another directory.This crap costs me more time than anything else in my project (Not really, but it su*&s!) And all becauseit looks sooo good when there is only one file in the bin directory...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IOW, SetEnvQQ does work, but subsequent LoadLibrary("dllname.dll"C) doesn't take the new path into account.
What does work is:
i = SetCurrentDirectory("D:...in"//char(0))Now, are you sure you want to do dynamic binding and GetProcAddress, pointer declaring, etc. for potentially zillion dll routines, introducing inportability as well? Isn't it worth a campaign for policy change?
i = LoadLibrary("mydll.dll"//char(0))
or
i = LoadLibrary("D:...inmydll.dll"//char(0))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SetCurrentDirectory wont work too. After that (or after ChangeDirQQ to dll) GetCurrentDirectory returns false. Something differentmust be wrong.
But I dont need that any more, we have to put the dll directory in our PATH permanently now. Great solution ;-)
Thanks again Jugoslav for your help, you are always a good source for advice.
Have a nice weekende!
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I said, it works for me.
"D:FooBar"//char(0)
or
"D:FooBar"C
OK, never mind. I'm glad that the problem is, um, solved. Have a nice weekend too.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page