Page 1 of 1

Posted: Mon Nov 04, 2002 7:30 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

i just wondered is there a way to fool PB to look for MIDAS11.DLL in the folder where the *.pb file is, i tried this:

Code: Select all

Procedure addDirectoryToPath(directory.s)
    currentPath.s = Space(255)
    GetEnvironmentVariable_("Path", @currentPath, 255)
    currentDirectory.s = Space(255)
    GetCurrentDirectory_(255, @currentDirectory)
    newPath.s=currentPath+";"+currentDirectory+"\"+directory
    SetEnvironmentVariable_("Path", @newPath)
EndProcedure
addDirectoryToPath("libs")
then put MIDAS11.DLL in the 'libs' folder with my program, but this doesn't seem to work as winxp can't find it. I know i should sling it into 'C:\windows\system32' but i would like a work around for people not having this dll, so they can literaly unzip my program and run it straight away without confusing their heads with moving files. any ideas?

--Kale

New to PureBasic and falling in Love! :)

Posted: Mon Nov 04, 2002 8:59 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

hi

As i know windows will search the dll in the System folder, your application folder (where u will run the exe from)... and this should no prob....

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Mon Nov 04, 2002 9:10 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Originally posted by MrVainSCL

hi
As i know windows will search the dll in the System folder, your application folder (where u will run the exe from)... and this should no prob....
If you use the compile/run option in the PureBasic editor the EXE is created in the PureBasic\Compiler folder(and run from there), so if you put your midas-DLL there everything should work fine during testing and debugging stage.

Posted: Mon Nov 04, 2002 9:20 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

hi pupil

yes i know... but the best thing is copy it into sys folder... or include it in the directory where you run the exe from :wink:

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Mon Nov 04, 2002 11:09 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Originally posted by MrVainSCL

hi pupil
yes i know... but the best thing is copy it into sys folder... or include it in the directory where you run the exe from :wink:
The tip was intended for Kale, in case he didn't know that when compiling and running -the exe is run from the folder i mentioned. I just quoted you because you said that the dll can be located in the same folder that your program is in, but this isn't necessary the same place that your source is located -that was my point :)

Posted: Tue Nov 05, 2002 12:36 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

ahh i see thanks :)

--Kale

New to PureBasic and falling in Love! :)

Posted: Tue Nov 05, 2002 3:08 pm
by BackupUser
Restored from previous forum. Originally posted by blueb.

Kale,

Programs first look in your application's folder, then if it still hasn't found the dll, tries the Windows\System folder. Therefore no need to copy files to the system folder (just creates a mess for the user).

[Added Later]
Note: Do not include DLL's that you might not have the legal right to distribute. You are better to tell them where to get the required DLL.

Regards,
--blueb

Posted: Tue Nov 05, 2002 5:16 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.

good point! blueb.

--Kale

New to PureBasic and falling in Love! :)