Board index » delphi » help: having trouble using a delphi 2 written dll from visual basic 4 or 5

help: having trouble using a delphi 2 written dll from visual basic 4 or 5

I wrote a communications dll in Delphi 2 which would ultimately be accessed
by vb4, now 5. The dll works perfectly when called from a Delphi
application. However, when used with vb, the following problems occur.

1. In the VB IDE, while debugging, after stepping over a dll call, and
subsequently exiting the VB IDE, the program (vb) hangs and requires a
reboot.

2. If I do not debug, but let the program run, it does call the dll
properly and data is properly passed both ways between the dll and vb app.
On exit, from the vb ide, however, the machine will hang.

Is there something:
        in the initialization of the dll that is missing?
        in the app exit which must be done to unload the dll?
        in the dll exit code that is missing?
        .......

Any thoughts are appriciated.

tia
Ken

please respond to henri...@hazeltine.com

 

Re:help: having trouble using a delphi 2 written dll from visual basic 4 or 5


Quote
In article <01bce3ad$98abe220$816451a5@henrichk> "Ken Henrich" <henri...@hazeltine.com> writes:
>I wrote a communications dll in Delphi 2 which would ultimately be accessed
>by vb4, now 5. The dll works perfectly when called from a Delphi
>application. However, when used with vb, the following problems occur.
>1. In the VB IDE, while debugging, after stepping over a dll call, and
>subsequently exiting the VB IDE, the program (vb) hangs and requires a
>reboot.
>2. If I do not debug, but let the program run, it does call the dll
>properly and data is properly passed both ways between the dll and vb app.
>On exit, from the vb ide, however, the machine will hang.
>Is there something:
>        in the initialization of the dll that is missing?
>        in the app exit which must be done to unload the dll?
>        in the dll exit code that is missing?
>        .......

There are several different calling-conventions that can be used.  Delphi has
a "fast register" calling-convention that is the default.  It's not going to
be compatible with what VB uses.  You probably need to specify "stdcall" to do
it.

Other Threads