Recent

Author Topic: Class in libraries  (Read 7767 times)

w135n03

  • Newbie
  • Posts: 6
Class in libraries
« on: February 09, 2011, 08:19:21 am »
Hi all..

How to using class in dll?

Thanks.. Sorry for my English

Imants

  • Full Member
  • ***
  • Posts: 198
Re: Class in libraries
« Reply #1 on: February 09, 2011, 11:41:07 am »
In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.

captian jaster

  • Guest
Re: Class in libraries
« Reply #2 on: February 09, 2011, 02:14:05 pm »
In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.
If you want to use a DLL you have to do it in traditional pascal, and export procedures.

Imants

  • Full Member
  • ***
  • Posts: 198
Re: Class in libraries
« Reply #3 on: February 09, 2011, 03:27:28 pm »
In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.
If you want to use a DLL you have to do it in traditional pascal, and export procedures.

But it is possible to export classes to. It is just more harder.

w135n03

  • Newbie
  • Posts: 6
Re: Class in libraries
« Reply #4 on: February 10, 2011, 12:02:56 am »
In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.
Can you explain to me the example?  :-[

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12948
  • FPC developer.
Re: Class in libraries
« Reply #5 on: February 10, 2011, 11:45:48 am »
In DLL you can use class as in every normal application problems will appear when you will try to export it from DLL or import in DLL.
Can you explain to me the example?  :-[

This is quite complicated matter and it only works for the simplest of classes. The problem is that DLL and mainapplication currently have their own copies of all state (class registrations, RTTI etc) , and operators like IS don't work on classes from "the other side".

The wiki page on Packages (http://wiki.freepascal.org/packages ) lists some of this.

In general, I advise to stay away from DLLs as much as possible unless you know what you are doing.

 

TinyPortal © 2005-2018