IonicWind Software

Creative Basic => General Questions => Topic started by: TexasPete on April 08, 2010, 04:24:03 AM

Title: Cb Doesn't find Dll
Post by: TexasPete on April 08, 2010, 04:24:03 AM
I have the following Dll that I am using with my program. When I First load my program and then try to run it. It gives me the error message that it could not fine the dll. I have placed the dll in the same folder with the program.  In my other language this was fine. Do I need a complete path in order to stop this from happening. If I save my program using "Save As " and then try to run it. The program finds the Dll without problem.



declare "jpeg.dll",LoadImageFile (Hwnd:int,file$:string),int



Just puzzled.
Texas pete
Title: Re: Cb Doesn't find Dll
Post by: aurelCB on April 08, 2010, 05:18:25 AM
Do you load dll with LoadLibraryA api first?
Try use Getstartpath+(dll.name).
I try in code which you send me but dont work on my computer ???

Infact i dont find any dll with name jpeg.dll i only find image323.dll...
Title: Re: Cb Doesn't find Dll
Post by: TexasPete on April 08, 2010, 06:39:04 AM
Aurel, I will check for the jpeg.dll and I will try getstartpath.
I haven't tried the load api yet . I will do so some time today.

Thanks
Texas Pete
I am tying int the snap to grid code for the movement routine today.
Aurel the jpeg.dll is a hidden file, sorry I forgot that I had applied that
to the properties
Title: Re: Cb Doesn't find Dll
Post by: aurelCB on April 08, 2010, 08:08:09 AM


Hiden.. ???
Why is hiden?
If is hiden i think that canot be found..
Title: Re: Cb Doesn't find Dll
Post by: TexasPete on April 09, 2010, 02:39:37 PM
Aurel,
I change the declare to include GetStartPath and it works. However , the other dll I use now does not work. If I Save the program file using "Save As" and then run the program, the program comes right up.

I find this to be perplexing. It is like the Startpath is changing and I havn't done anything.

Perplexed ,
Texas Pete
Title: Re: Cb Doesn't find Dll
Post by: aurelCB on April 09, 2010, 02:59:43 PM
Pete..
I really dont understand what's heapend with your computer.
maby you have problems with registry.Try clean registry and defragment disk.
I never had similiar problems.
Title: Re: Cb Doesn't find Dll
Post by: Ionic Wind Support Team on April 09, 2010, 11:20:50 PM
When you "run" a CBasic program it is not running in the directory that the source it located in, it is running in the directory that the IDE is running it.

Copy the DLL either to the windows/system32 directory or to the C:\Program Files\Ionic Wind\Creative BASIC directory while you are creating your program.  After you build the executable then you can put the DLL in the folder that your executable exists in.

Title: Re: Cb Doesn't find Dll
Post by: TexasPete on April 11, 2010, 08:32:52 AM
Thanks Paul, That solved a problem.
Why can I just tell it where the dll is using getstartPath. It worked on one dll but not the other.
Thanks Texas Pete
Title: Re: Cb Doesn't find Dll
Post by: LarryMc on April 11, 2010, 08:39:12 AM
Quote from: TexasPete on April 11, 2010, 08:32:52 AM
Why can I just tell it where the dll is using getstartPath.
'Cause you can't ;)

LarryMc