It is currently Sat Oct 19, 2019 1:13 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Import dll from directory
PostPosted: Mon Apr 08, 2019 11:52 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 13, 2014 9:38 am
Posts: 131
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:
import "Lib/myDll.lib'

endImport


Thank for your answers

_________________
Use Pb 5.60 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Mon Apr 08, 2019 2:38 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3083
Location: Boston, MA
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 8:01 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 13, 2014 9:38 am
Posts: 131
@skywalk,

for example that work but SPD_64.dll must be put into same directory of executable, can i change that ?
Thanks
Code:
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.60 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 8:57 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 13, 2010 3:45 pm
Posts: 907
Skywalk has already written the answer.

_________________
sorry for my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 10:15 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 16, 2003 3:47 pm
Posts: 1310
Location: England
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:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 10:36 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 535
If the lib is not static the dll needs to be in the same directory as the lib afaik.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 11:55 am 
Offline
Addict
Addict

Joined: Fri Apr 25, 2003 11:10 pm
Posts: 1199
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 09, 2019 1:05 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 13, 2014 9:38 am
Posts: 131
Thanks for your answers.

_________________
Use Pb 5.60 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Tue Apr 16, 2019 10:16 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 16, 2003 3:47 pm
Posts: 1310
Location: England
microdevweb wrote:
Thanks for your answers.


Did you manage to get a working solution?


Sent from my iPhone using Tapatalk


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Wed Jul 03, 2019 11:11 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 13, 2014 9:38 am
Posts: 131
No i didn't sorry

_________________
Use Pb 5.60 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.


Top
 Profile  
Reply with quote  
 Post subject: Re: Import dll from directory
PostPosted: Wed Jul 03, 2019 11:55 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 22, 2009 10:41 pm
Posts: 441
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye