Create a DLL

Just starting out? Need help? Post your questions and find answers here.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 596
Joined: Tue Jan 04, 2011 6:21 pm

Create a DLL

Post by SPH »

Hi all,

I need your help.
I want to create a DLL designed by PB5.11
(I want to use 4 instructions from PB5.11 in PB6.00+)
Here is the code I enter in PB5.11:

Code: Select all

ProcedureDLL.q DSolidSprite(Sprite,x,y,Couleur):DisplaySolidSprite(Sprite,x,y,Couleur):EndProcedure
ProcedureDLL.q DShadowSprite(Sprite,x,y):DisplayShadowSprite(Sprite,x,y):EndProcedure
ProcedureDLL.q DTranslucentSprite(Sprite,x,y,Intensity):DisplayTranslucentSprite(Sprite,x,y,Intensity):EndProcedure
ProcedureDLL.q DRGBFilter(x,y,w,h,r,g,b):DisplayRGBFilter(x,y,w,h,r,g,b):EndProcedure
Here is the setting before creating the DLL:
Image

Am I good so far?

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
SPH
Enthusiast
Enthusiast
Posts: 596
Joined: Tue Jan 04, 2011 6:21 pm

Re: Create a DLL

Post by SPH »

I make my DLL from PB64 5.11. It is created.
But when using it, it crashes

[17:23:05] Waiting for the program to start...
[17:23:05] Executable type: Windows - x64 (64bit, Unicode)
[17:23:05] Executable started.
[17:23:05] [ERROR] Scrab_francais_translucent.pb (Line: 317)
[17:23:05] [ERROR] Invalid memory access. (reading error at address 8 )

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Create a DLL

Post by Mijikai »

The functions in the dll dont know about the screen that is why it crashes.
User avatar
mk-soft
Always Here
Always Here
Posts: 6321
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Create a DLL

Post by mk-soft »

Clear,

the internal library does not match the new library. In addition, different memory areas and lists are used. A DLL has its own memory management.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
SPH
Enthusiast
Enthusiast
Posts: 596
Joined: Tue Jan 04, 2011 6:21 pm

Re: Create a DLL

Post by SPH »

Thank you (very much) for your comments.
How to use a DLL then?

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
mk-soft
Always Here
Always Here
Posts: 6321
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Create a DLL

Post by mk-soft »

Then you would have to execute all functions from the DLL.

But this is not allowed. That would be wrapping the PB functions and violates the licence condition of Purebasic
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply