Is there an easier way to import DLLs (which are not created by me and I do not have anything other than the DLL and header files) then to use something like pexports/impdef*, manually edit the resulting def file to make it look like a .pbl file and then use the DLLImporter tool?
pexports 0.43 can be found at:
http://www.imem.unavarra.es/3d_mec/download/win2k/
impdef is Borland's tool, available with their free compiler:
http://www.borland.com
Importing DLLs
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Importing DLLs
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Yes, PB can use any kind of DLL using OpenLibrary.GedB wrote: I thought PB could just use Dlls with OpenLibrary.
Under which circumstances would this hack be needed?
Is OpenLibrary restricted to just Powerbasic Dlls?
However, I was looking for a way to import them so they look like normal PureLibraries. That way you can just call the function names, just as you would with the API functions, and not have to mess around with open library and so on.
And it's not a hack :)
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
-
VPureBasic
- User

- Posts: 59
- Joined: Fri Apr 25, 2003 6:09 pm
- Location: Quebec - Canada
Hi Tinman,
You can use any DLL's with PureBASIC without "OpenLibrary" or any other call functions...
Try this:
a) Copy the *.lib in the PureLibraries\Windows\Libraries
b) Write a .pbl file for this DLL
c) Use the file made with "DLL Import" and copy it to PureLibraries\Windows\
After that PB will be able to call any function from this new dll. ( Do not forget the underscore at the end... )
Roger
You can use any DLL's with PureBASIC without "OpenLibrary" or any other call functions...
Try this:
a) Copy the *.lib in the PureLibraries\Windows\Libraries
b) Write a .pbl file for this DLL
c) Use the file made with "DLL Import" and copy it to PureLibraries\Windows\
After that PB will be able to call any function from this new dll. ( Do not forget the underscore at the end... )
Roger
Everything is possible with PureBASIC... All you're missing is imagination!
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
I know, that is what I am asking about and have done. I was wondering if there was an easier way.VPureBasic wrote:Try this:
The part about write a pbl file is what I have most hassle with. Why do we need to write this by hand when pexports or impdef can get all the information from the DLL file? (It's a pain in the ass to have to type hundreds of function names rather than just extract them automatically).
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Sure, they can fix it if they want, I know I will appreciate it.But that doesn't help me now. How do I even know if it is being worked on?Rings wrote:give the developers a chance to fix that.tinman wrote:(It's a pain in the ass to have to type hundreds of function names rather than just extract them automatically).
I don't think I'm not giving them a chance, I'm just pointing out it's a pain in the ass (the way it works now) and was asking if there was an easier way.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
