Import dll from directory

Just starting out? Need help? Post your questions and find answers here.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Import dll from directory

Post by microdevweb »

Hello everyone,

I try to use a library putted into a directory, but it doesn't work if my lib has not into the same directory of executable

For example

Code: Select all

import "Lib/myDll.lib'

endImport
Thank for your answers
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Import dll from directory

Post by skywalk »

Going out on a limb...You can enter the full path in the Import statement. :?
Your snippet does not even end with double quotes " !!
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Import dll from directory

Post by microdevweb »

@skywalk,

for example that work but SPD_64.dll must be put into same directory of executable, can i change that ?
Thanks

Code: Select all

Import "LIB\SPD_64.lib"
    newLb(language.s)
    newSql(dbName.s)
    newForm(*title,width,height = 0)
    newF_V_Box()
    newF_H_Box()
    newF_G_Box(numberColumn)
    newF_Text(*label)
    newF_String(*label = 0)
    newF_Empty()
    newF_Date(*label = 0,currentDate = 0)
    newF_Container()
    newF_Combo(*label)
    newCallback(*callBack,event_type = #PB_All)
    newWinCallBack(*callBack,win_event)
    newF_Calendar(currentDate = 0,*label = 0)
    newF_Button(*label)
    newTabClText(*title,columnDbName.s,width.f)
    newTabClNumber(*title,columnDbName.s,width.f)
    newTabClLinked(*title,columnDbName.s,linkedTable.s,linkedColumn.s,showedColumn.s,width.f)
    newTabCalculated(*title,width.f,*callback)
    newTab(dbName.s,tableName.s)
    mainLoop()
  EndImport
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Import dll from directory

Post by Josh »

Skywalk has already written the answer.
sorry for my bad english
User avatar
GedB
Addict
Addict
Posts: 1312
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Re: Import dll from directory

Post by GedB »

microdevweb wrote:@skywalk,

for example that work but SPD_64.dll must be put into same directory of executable, can i change that ?
Thanks

Code: Select all

Import "LIB\SPD_64.lib"
The path here is referring to the location of the lib file at compile time.

Microdevweb is asking about the location of the dll at runtime.

This I don’t know. DLLs are designed for registration with windows, not bundling with the app.

The logic of locating DLLs within windows is explained here: https://docs.microsoft.com/en-us/window ... arch-order

DLLs are loaded into memory once then shared. It might be worth trying to load the library with OpenLibrary. That allows you to specify a path.

Failing that you’ll probably have to modify the manifest. Hopefully somebody can help you with that.

The discussion on this topic may be helpful: viewtopic.php?f=13&t=54277





Sent from my iPhone using Tapatalk
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Import dll from directory

Post by Mijikai »

If the lib is not static the dll needs to be in the same directory as the lib afaik.
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: Import dll from directory

Post by jack »

I know that placing the 32-bit dll in the \Windows\SysWOW64 folder and placing the 64-bit dll in the \Windows\System32 folder works, but this practice is frowned upon.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Import dll from directory

Post by microdevweb »

Thanks for your answers.
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
GedB
Addict
Addict
Posts: 1312
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Re: Import dll from directory

Post by GedB »

microdevweb wrote:Thanks for your answers.
Did you manage to get a working solution?


Sent from my iPhone using Tapatalk
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Re: Import dll from directory

Post by microdevweb »

No i didn't sorry
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Import dll from directory

Post by Olliv »

See inside the LIB file and search DLL filename field in the LIB file.
There could be some place to insert full path directory.

If no space, no availabilities, but if there are some spaces characters or some null characters, path tests can be done.
Post Reply