Board index » delphi » Delphi 1.0 type and BC++5 dll

Delphi 1.0 type and BC++5 dll

I'm trying to implement a type in Delphi 1.0 by means of an existing
C++ class compiled into a DLL using Borland C++ 5. The Borland
technical article on this subject
(http://netserv.borland.com/delphi/papers/brick.html) gives an example
which works fine in Delphi 2.0 with a 32 bit DLL, however in 16-bit I
get a gpf every time I try to call a class method of a newly created
instance of the type.

The only difference between the 16 and 32 bit code is that the stdcall
directive in the declarations of the Delphi class methods had to be
removed for the 16-bit version and therefore the C++ was compiled
using "pascal" as the default calling convention. It makes no
difference whether this is instead specified explicitily for each
procedure using _pascal. Is there someone who could give me an idea of
what's going wrong here, perhaps with an example? TIA

Peter

 

Re:Delphi 1.0 type and BC++5 dll


Quote
PMetca...@drystone.demon.co.uk (Peter Metcalfe) wrote:
>I'm trying to implement a type in Delphi 1.0 by means of an existing
>C++ class compiled into a DLL using Borland C++ 5. The Borland
>technical article on this subject
>(http://netserv.borland.com/delphi/papers/brick.html) gives an example
>which works fine in Delphi 2.0 with a 32 bit DLL, however in 16-bit I
>get a gpf every time I try to call a class method of a newly created
>instance of the type.

>The only difference between the 16 and 32 bit code is that the stdcall
>directive in the declarations of the Delphi class methods had to be
>removed for the 16-bit version and therefore the C++ was compiled
>using "pascal" as the default calling convention. It makes no
>difference whether this is instead specified explicitily for each
>procedure using _pascal. Is there someone who could give me an idea of
>what's going wrong here, perhaps with an example? TIA

I assume you are compiling the DLL to a 16bit target.

As far as I have researched the problem the Delphi 1 classes are not
"compatible" with BC 5 16bit class model (and vice versa). Of course I
can err in this respect and would be happy to be corrected!

All I can suggest is to provide some "plain" access (i.e. non-OO) to
the DLLs functionality.
--
Stefan.Hoffmeis...@Uni-Passau.de
http://www.rz.uni-passau.de/~w4hoff01/
University of Passau, Bavaria, Germany

Re:Delphi 1.0 type and BC++5 dll


On Tue, 25 Feb 1997 21:54:27 GMT, Stefan.Hoffmeis...@Uni-Passau.De

Quote
(Stefan Hoffmeister) wrote:
>As far as I have researched the problem the Delphi 1 classes are not
>"compatible" with BC 5 16bit class model (and vice versa). Of course I
>can err in this respect and would be happy to be corrected!

The procedure works in test cases using MS VisC++ 1.5, but not with
Turbo C++ or BC++5. Curious. As luck would have it for the task in
hand I need to be able to handle templates and exceptions, neither of
which are supported by Microsoft's product.

Peter

Re:Delphi 1.0 type and BC++5 dll


Quote
PMetca...@drystone.demon.co.uk (Peter Metcalfe) wrote:
>On Tue, 25 Feb 1997 21:54:27 GMT, Stefan.Hoffmeis...@Uni-Passau.De
>(Stefan Hoffmeister) wrote:

>>As far as I have researched the problem the Delphi 1 classes are not
>>"compatible" with BC 5 16bit class model (and vice versa). Of course I
>>can err in this respect and would be happy to be corrected!

>The procedure works in test cases using MS VisC++ 1.5, but not with
>Turbo C++ or BC++5. Curious. As luck would have it for the task in
>hand I need to be able to handle templates and exceptions, neither of
>which are supported by Microsoft's product.

Could you post a small (!) example of what you are trying to do? We
are (or rather I am) just guessing without any source code.
--
Stefan.Hoffmeis...@Uni-Passau.de
http://www.rz.uni-passau.de/~w4hoff01/
University of Passau, Bavaria, Germany

Other Threads