OpenLibrary & windows\System32 directory
Posted: Wed Dec 05, 2007 10:06 pm
I had a strange bug concerning Librarys and it was taking a long time until I found the problem.
Do the following steps:
1. Compile the DLL procedure to a DLL called Message.dll
2. copy this file to the Windows\System32 directory
3. Replays the word "Old" with "New"
4. compile a second dll also called message.dll
Now write this program in the folder of the DLL (not the system32 directory of course!)
compile the program and see: It will display "old". But it should not. Openlibrary should at first open the library from the program folder, not from the system32 folder.
Now create a .exe from the program code and run it. "new". Something seemse to be wrong here (either in PB or in Windows was to handle Dll calling).
Code: Select all
; Dll Function
ProcedureDLL XXL()
MessageRequester("Old","",0)
EndProcedure1. Compile the DLL procedure to a DLL called Message.dll
2. copy this file to the Windows\System32 directory
3. Replays the word "Old" with "New"
4. compile a second dll also called message.dll
Now write this program in the folder of the DLL (not the system32 directory of course!)
Code: Select all
; Program
Lib = OpenLibrary(#PB_Any,"Message.dll")
CallFunction(Lib,"XXL")
CloseLibrary(Lib)Now create a .exe from the program code and run it. "new". Something seemse to be wrong here (either in PB or in Windows was to handle Dll calling).