Re: Passing Bitmap as parameter to DLL



Andy wrote:

I have a Delphi DLL and I would like to pass a TBitmap as a
parameter. How do I go about doing this and especially how to create
and free it without problems? Any help is greatly appreciated.

To pass objects from a host application to a DLL you have to build both
projects with run-time packages, using the core rtl and vcl packages as
well as any others that contain classes you want to pass across the
module boundary. The objects you pass should always be created and
destroyed in the same module, if possible. But since packages also get
you a common memory manager it would be no problem to have the DLL
create and return a TBitmap and have the host exe destroy it, you just
have to make sure the responsibilities are clearly documented.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
.



Relevant Pages

  • Re: Load Form from DLL to MDI Child
    ... Andy wrote: ... a child form and making the child form the parent form of the DLL. ... am able to use LoadLibrary in the child form to load the DLL but I'm ... and a Delphi DLL you need to use packages, not DLLs (or build the DLLs ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Load Form from DLL to MDI Child
    ... I have actually done this in packages per your suggestion. ... the package to the host application, and be able to set the Align to alClient. ... a child form and making the child form the parent form of the DLL. ... am able to use LoadLibrary in the child form to load the DLL but I'm ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Problem with plugin in DLL
    ... I remade my dll into packages, but I cant load more than one package. ... "canno assign a tfont to a tfont". ...
    (borland.public.delphi.non-technical)
  • Re: software protection and licensing question
    ... Thanks for the info. Armadillo is one of the packages I have come ... allow debugging for the application code written by users of our SDK, ... I'm also well aware that code protection can never be perfect - people ... >>supplied dll, and it is the dll which needs to be protected. ...
    (comp.lang.cpp)
  • Re: Delphi to take advantage of multiple threads within the compiler>
    ... address into any given function pointer - ergo if different processes need to map the dll to different addresses, they by definition cannot share the same physical memory image. ... care about entering a useful preferred base address into its Windows DLL's. ... Not only packages, but *all* dll's, including my home-made COM servers, are affected ... MSI.DLL (microsoft installer) gets mapped into my processes, ...
    (borland.public.delphi.non-technical)