Is dll developed in Delphi 6 works on Delphi 2?

I have a one dll, whose work is to creates a form with some normal vcl controls, print selected tables and email some reports. It was developed in Delphi 6. Can any other application which was developed in Delphi 2 use that dll.? If not, please let me know in which areas i need change. The dll work is only to print and email. 

With regards,
Srikanth Varma
0
Srikanth
7/6/2011 5:45:48 AM
📁 embarcadero.delphi.ole
📃 598 articles.
⭐ 1 followers.

💬 5 Replies
👁️‍🗨️ 1850 Views

Srikanth varma wrote:

> I have a one dll, whose work is to creates a form with some normal
> vcl controls, print selected tables and email some reports. It was
> developed in Delphi 6. Can any other application which was developed
> in Delphi 2 use that dll.? 

Delphi 2, really? That version is, what, 15 years out of date...

It all depends on the DLL interface, which types of parameters are
passed to the DLL, whether it needs to use a shared memory manager with
the host exe, or even share packages with the host. If the DLL was
build using Windows API compatible parameter types only it should work.

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://codenewsfast.com
http://groups.google.com
0
Peter
7/6/2011 6:03:35 PM
> It all depends on the DLL interface, which types of parameters are
> passed to the DLL, whether it needs to use a shared memory manager with
> the host exe, or even share packages with the host. If the DLL was
> build using Windows API compatible parameter types only it should work.

The dll work is to create a form with some third party components like exportToPdf and some Reporting components. Only D6 supports these components but D2 not. Will that dll work in D2?
0
Srikanth
7/7/2011 11:10:54 AM
Srikanth varma wrote:

> > It all depends on the DLL interface, which types of parameters are
> > passed to the DLL, whether it needs to use a shared memory manager
> > with the host exe, or even share packages with the host. If the DLL
> > was build using Windows API compatible parameter types only it
> > should work.
> 
> The dll work is to create a form with some third party components
> like exportToPdf and some Reporting components. Only D6 supports
> these components but D2 not. Will that dll work in D2?

If these components are only used internally in the DLL, then, yes, it
should work. But this all depends on how the host application interacts
with the DLL, and you have told us nothing about that yet.

What functions does the DLL export for the host application to call?
Post their declaration and we may be able to give you a more specific
verdict.

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://codenewsfast.com
http://groups.google.com
0
Peter
7/7/2011 5:08:06 PM
> If these components are only used internally in the DLL, then, yes, it
> should work. But this all depends on how the host application interacts
> with the DLL, and you have told us nothing about that yet.
> What functions does the DLL export for the host application to call?
> Post their declaration and we may be able to give you a more specific
> verdict.

    DLLInstance := LoadLibrary(Pchar(sDll));
    if DLLInstance = 0 then
    begin
         .....
    end;
    @CreateReportD6 := GetProcAddress(DLLInstance, 'CreateReportD6');
    if ((@CreateReportD6 <> nil)) then
    begin
      if not CreateReportD6(Arrgs, richEdit1) then
         ..........
Arrgs is an Variant array and the second parameter is RichEdit.
0
Srikanth
7/8/2011 5:06:27 AM
Srikanth varma wrote:

> > If these components are only used internally in the DLL, then, yes,
> > it should work. But this all depends on how the host application
> > interacts with the DLL, and you have told us nothing about that yet.
> > What functions does the DLL export for the host application to call?
> > Post their declaration and we may be able to give you a more
> > specific verdict.
> 
>     DLLInstance := LoadLibrary(Pchar(sDll));
>     if DLLInstance = 0 then
>     begin
>          .....
>     end;
>     @CreateReportD6 := GetProcAddress(DLLInstance, 'CreateReportD6');
>     if ((@CreateReportD6 <> nil)) then
>     begin
>       if not CreateReportD6(Arrgs, richEdit1) then
>          ..........
> Arrgs is an Variant array and the second parameter is RichEdit.

The Variant will not be a problem, but the richedit parameter will
likely cause problems since the DLL will assume that it is a D6
TRichedit, which it is not. Whether it actually will cause a problem
depends on what the DLL does with this parameter, and how big the
changes in TRichedit and its ancestors were between D2 and D6. I don't
have D2 around anymore, so cannot check this, but there are probably
substantial changes since the VCL in D6 was modified to make it easier
to reuse as much as possible with Kylix.

I assume you cannot change the D2 application, perhaps not even rebuild
it after a minor change. Otherwise I would suggest that you change the
parameter to a window handle (HWND) and pass the richedit1.Handle. The
DLL then also needs to be modified, it has to use API methods (send
messages) with this handle to get data out of the richedit or modify
its content.

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://codenewsfast.com
http://groups.google.com
0
Peter
7/8/2011 7:51:16 AM
Reply: