Restored from previous forum. Originally posted by Paul.
Ok, we can create DLL's but what is the best way for accessing them?
What is the best/easiest way for accessing any DLL?
Also wondering if it is possible to access a 16bit DLL from PB?
Accessing DLL's
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> What is the best/easiest way for accessing any DLL?
Mr Skunk has a DLL library for accessing DLLs with PureBasic:
http://www.skunknet.fr.st/
PB - Registered PureBasic Coder
> What is the best/easiest way for accessing any DLL?
Mr Skunk has a DLL library for accessing DLLs with PureBasic:
http://www.skunknet.fr.st/
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
You can use Mr.Skunk library for now.
I made after the 2.9 release a test with Fred's dll example and it worked fine.
BUT if I read it right in another topic, Fred is gonna to change the library structure with version 3.0 of PureBasic.
That means that ALL LIBRARIES of MR.SKUNK will be OBSOLETE!!!
I havn't seen Mr.Skunk for awhile so I suppose, if he is still alive (I hope so...) that he lost fun working with PureBasic and left the community.
All others contributing the libraries without source have to (please, please...) recompile their libs when version 3.0 of PureB will be arrived.
That's why I like to make my own libraries with PureB!!!
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 30 January 2002 16:35:30
You can use Mr.Skunk library for now.
I made after the 2.9 release a test with Fred's dll example and it worked fine.
BUT if I read it right in another topic, Fred is gonna to change the library structure with version 3.0 of PureBasic.
That means that ALL LIBRARIES of MR.SKUNK will be OBSOLETE!!!
I havn't seen Mr.Skunk for awhile so I suppose, if he is still alive (I hope so...) that he lost fun working with PureBasic and left the community.
All others contributing the libraries without source have to (please, please...) recompile their libs when version 3.0 of PureB will be arrived.
That's why I like to make my own libraries with PureB!!!
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 30 January 2002 16:35:30
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Making DLL's with PureB is nice but, I don't like the way how to call the functions with Mr.Skunk's lib anyway.
First call the dll with: OpenDLL(0,"nviewlib.dll")
Then declare the dll function with: DLLFunction(0,0,"NViewLibLoad")
After that you have access to the function with: CallDLL0(1) <- not really impressive to find somewhere in the code this command. Do you remember wich function this is?
That's weird isn't it?
It would be a lot nicer this way:
You don't need to specially open the dll. The first time you declare a dll function the dll is automatically loaded. (but I would live with an OpenDLL command...)
Declare the function with: DLLFunction("My_NViewLibLoad","nviewlib.dll","NViewLibLoad",0)
(the last number is the amount of parameters)
After that you have access to the function with: My_NViewLibLoad()
(My_NViewLibLoad has no parameter...)
If the DLL function has parameters then declaring and calling the function would be:
DLLFunction("My_NViewLibLoad","nviewlib.dll","NViewLibLoad",8)
My_NViewLibLoad("Whatever",0,0,320,240,"you","want",#NULL)
But I don't know if Fred has time to make a DLL call command like that...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Making DLL's with PureB is nice but, I don't like the way how to call the functions with Mr.Skunk's lib anyway.
First call the dll with: OpenDLL(0,"nviewlib.dll")
Then declare the dll function with: DLLFunction(0,0,"NViewLibLoad")
After that you have access to the function with: CallDLL0(1) <- not really impressive to find somewhere in the code this command. Do you remember wich function this is?
That's weird isn't it?
It would be a lot nicer this way:
You don't need to specially open the dll. The first time you declare a dll function the dll is automatically loaded. (but I would live with an OpenDLL command...)
Declare the function with: DLLFunction("My_NViewLibLoad","nviewlib.dll","NViewLibLoad",0)
(the last number is the amount of parameters)
After that you have access to the function with: My_NViewLibLoad()
(My_NViewLibLoad has no parameter...)
If the DLL function has parameters then declaring and calling the function would be:
DLLFunction("My_NViewLibLoad","nviewlib.dll","NViewLibLoad",8)
My_NViewLibLoad("Whatever",0,0,320,240,"you","want",#NULL)
But I don't know if Fred has time to make a DLL call command like that...
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
Fred - AlphaSND
I've never said than v3.0 will be bring new library structure. I've said than the procedure call will be DLL compliant. And it doesn't mean than v2.0 libs will be obsolete. They will probably never be obsolete, don't worry.BUT if I read it right in another topic, Fred is gonna to change the library structure with version 3.0 of PureBasic.
That means that ALL LIBRARIES of MR.SKUNK will be OBSOLETE!!!
I havn't seen Mr.Skunk for awhile so I suppose, if he is still alive (I hope so...) that he lost fun working with PureBasic and left the community.
Fred - AlphaSND
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Passing the Arguments in Registers
is nice and fast, so its not needed
to change that.
Additionally support for _stdcall
is needed and can be declared in
the .DESC file:
cya,
...Danilo
(registered PureBasic user)
Passing the Arguments in Registers
is nice and fast, so its not needed
to change that.
Additionally support for _stdcall
is needed and can be declared in
the .DESC file:
Code: Select all
myCommand:stdcall, Long, Long
Long...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
I often struggle while passing Paramters to the stack/Registers .
Getting better with a little help from my friends....thx Siggi
allright, post a sample for a DLL-Function with 5 or 6 parameters .Passing the Arguments in Registers
is nice and fast, so its not needed
to change that.
Additionally support for _stdcall
is needed and can be declared in
the .DESC file:
cya,Code: Select all
myCommand:stdcall, Long, Long Long
...Danilo
(registered PureBasic user)
I often struggle while passing Paramters to the stack/Registers .
Getting better with a little help from my friends....thx Siggi