The lib Have some classes, but the rest is very simple :?
it can be done?
The lib Have some classes, but the rest is very simple :?
it can be done?
From brazil (:
Pascal pownz!
i need some help here :?
I think classes in C++ are not compatible with Pascal classes,
what i will need to do?
From brazil (:
Pascal pownz!
use plain objects or records.
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
You can always make a DLL and make it C++ compatible
You cannot use dynamic array's and most string types (Use PChar instead). You cannot use pascal classes either. If you want your library to be a little more Object oriented you can also use Interfaces (derived from IUnknown). That way you can make C++ compatilbe API's with pascal
P.S: all exported DLL routines need STDCALL calling conventions
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Appers to be same as C++ libs -> delphi,Originally Posted by Delfi
i was writing irrlang headers to pascal using ""Flattening" the object" model, but i stoped, there are many better libs around already converted to pascal,
i have some doubts,
how can i generate a .lib of a delphi dll ?
i will use type def to define a own type of void type, and pass it on a argument to the exported plain functions of the class?
Thill will work?
Code:typedef void Psomeclass; // i will need more coding to import the functions here, but this is just an example Psomeclass Psomeclass_create(void) void Psomeclass_dosomething(void handle)Code:type Psomeclass = ^TsomeClass; TsomeClass = class public procedure dosomething; constructor create; end; constructor Tsomeclass.create; begin // CONSTRUCTOR end; procedure Tsomeclass.dosomething; begin // DO SOMETHING end;~chronozphere:Code:function Psomeclass_create: Psomeclass; stdcall; begin result := @TSomeclass.create; end; procedure Psomeclass_dosomething(handle : Psomeclass); stdcall; begin handle.dosomething; end; exports Psomeclass_dosomething, Psomeclass_create;
Yeah im very interested in OO, but i don't know what is interfaces ;p
can you give me more details?
sorry my english :?
From brazil (:
Pascal pownz!
I'm afraid that if you want to create an object oriented library in Delphi to use from C++ you will need to create something similar to COM objects. :shock: Like DirectX and so on.
So start to learn interfaces. They are necessary to create COM objects. :roll:
I read some things about interface, its like an skeleton for classes, them i create a real class from it that implements all its functionalities;
all right in pascal but how i will import that on C++ ?
From brazil (:
Pascal pownz!
First you have to learn C. :roll: :razz:
You must translate the interface, type and constant definitions to a C and assemble them in a C header. This will be the import header for your library, and it should contain all datatypes, constants, interfaces etc etc, that are needed to work with your library.
Then the user can e.g Call The "MyEngine_Init" routine that is defined in that header to initialize the library and start working with it
First step is to learn how to create DLL's with exported functions, after that, learn how to use interfaces for Application <-> DLL communication. And finally, learn some C++ so you can make a C header for your lib.
Good luck
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
so use dynamic loading insted of static, good, i will don't need .lib'sOriginally Posted by chronozphere
I know a descent level of C++ programming, nothing that some google don't solve
I already have writed all structs, types and consts to the .h
but the main code still blank =/
after some research
i noticed that best way, is to work with full abstract classes, i will make some tests
PS: im getting confused, you are giving me some good tips but i still have unanswered questions
From brazil (:
Pascal pownz!
Okay... I guess you need to tell me agian, what you want to knowPS: im getting confused, you are giving me some good tips but i still have unanswered questions
I don't really know what i lib is (i think it has to do with Linux), but i don't think you can do that.how can i generate a .lib of a delphi dll ?
Just using the DLL will be sufficient (unless you want your application to work on Linux or Mac).
Sorry, i don't completely understand the question :? Maybe you can rephrase it?i will use type def to define a own type of void type, and pass it on a argument to the exported plain functions of the class?
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Bookmarks