Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / DLL with DELPHI

Author
Message
Alexus 2021
15
Years of Service
User Offline
Joined: 30th Sep 2008
Location:
Posted: 30th Sep 2008 19:13
Hello! I first time on forum and my first queston: How can i make dll with DELPHI for DBPro ? Sorry for my EnglishMay be somebody have any samples on DELPHI!Thank you!
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Oct 2008 19:13 Edited at: 6th Oct 2008 19:14
No answer usually means that no-one can really help you, so you're probably out of luck.

Personally, I'd suggest that you switch to another language for plug-ins, like C++, or PureBasic, just because there are people here who know them better.

I did do some stuff with Delphi in the early days (2003ish), but that was only to assist someone else at the time - he later moved to C++ too. I doubt if I can remember too much about it, and I certainly don't have the code any more.

Slooper
21
Years of Service
User Offline
Joined: 13th Feb 2003
Location: Sweden
Posted: 8th Oct 2008 00:41
try contact Sergey K on msn he is using this adress sergy100@netvision.net he are using delphi to write dbp dlls

good luck


You never fail, only make mistakes.
JDforce
19
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 8th Oct 2008 07:51
I can help you, what Delphi version you have?

Setting up a delphi Dll is quite simple.
Use new-other-dll wizard and the IDE will create a new dll project.
The Dll structure is simple, it starts with "library" instead of "program".
In Uses you put whatever delphi library you are going to need. In the code below I included forms and dialogs, but they are not used in this particular sample. I kept them there as my skeleton.
Then you have the functions where you must declare all as CDECL for Darkbasic to be able to use them. Am assuming you know how to call them from DBPro.
The final part is EXPORTS, where you actually declare which functions can be dinamically linked from a program, either DBpro or any other.
You can call from a delphi dll another system dlls, the ones that are part of windows SDK or any other. The nice thing about delphi is that they did the work of declaring many functions and adapted the data types from the winSDK, so you can call the delphi libraries and only have to concern about the internal delphi name of the windows functions.
This particular dll was built with D2007 and you won't find the dwmapi library in Delphi 7, because it is related to windows vista.
The functions included can get the horizontal and vertical screen size, can detect if the pc is using windows vista and can disable or enable AERO. It is a fully working code that I use to disable screen composition in Windows Vista.

Hope it helps you start up.

JD



May the 3d force B with U
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 17th Oct 2008 06:28
My Dark Ink dll was written using Delphi 2007. To help you along the way you can use my dbimport unit to help you along the way. The latest version of my dbimport unit needs another delphi header file Direct3D9, you can get that from.

http://www.clootie.ru/delph/download_dx92.html#Headers

You will also need to create a resource file in your delphi project in order to be able to export functions to dark basic pro. The resource file should have .rc extension and be part of your delphi project. You can find out how to create the function definitions by looking at the Dark Basic help.

Technical Documents -> third party commands

If you look at my dbimport unit you may notice I have defined some global function pointers. If you assign functions to these pointers DB Pro will call them at the appropriate times

dbD3DDeviceLost:dbProc = nil; // set this function to get call backs for device D3d device lost
dbD3DDeviceNotReset:dbProc = nil; // set this function to get call backs for D3D device not reset.

dbD3DDeviceReset:dbProc = nil; // set this function to get call backs for D3DDeviceReset
dbConstruct:dbProc = nil; // set this variable to your constructor function
dbDestruct:dbProc= nil; // Set this variable to your destructor function
dbCREATESTRING:dbCreateStr;

There are also some helper functions

procedure ReceiveCoreDataPtr(Qointer);export;cdecl;
procedure CreateDBStr(s:string;var strptr:LPSTR);
procedure dbPrint(s:string);


I hope this helps


Jack Taylor

Jack Taylor

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-18 17:59:42
Your offset time is: 2024-04-18 17:59:42