Board index » delphi » calling a DLL of pascal code from Visual Basic

calling a DLL of pascal code from Visual Basic

hi,
i'm trying to generate a DLL library from my code in pascal (BP7) to call it
from VisualBasic.
I keep getting the error message "file not found" referring to the DLL
generated by BP7 (although i can see the file in the proper directory).

I suspect there is some incompatibilities between BP7 and VB5 (?)

any clues?

thanks
Jaime (j...@Lehigh.Edu)

 

Re:calling a DLL of pascal code from Visual Basic


hi,
i'm trying to generate a DLL library from my code in pascal (BP7) to call it
from VisualBasic.
I keep getting the error message "file not found" referring to the DLL
generated by BP7 (although i can see the file in the proper directory).

I suspect there is some incompatibilities between BP7 and VB5 (?)

any clues?

thanks
Jaime (j...@Lehigh.Edu)

Re:calling a DLL of pascal code from Visual Basic


news [mailto:j...@Lehigh.edu] decided to regale us with
Quote
>hi,
>i'm trying to generate a DLL library from my code in pascal (BP7) to call it
>from VisualBasic.
>I keep getting the error message "file not found" referring to the DLL
>generated by BP7 (although i can see the file in the proper directory).

>I suspect there is some incompatibilities between BP7 and VB5 (?)

Are you compiling the DLL for Pmode or Windows Target ? You need to
compile for Windows Target for other programs to access the .DLL

--
Pedt

If smoking is so bad for you, how come it cures kippers?!

Re:calling a DLL of pascal code from Visual Basic


Jaime;
  I have investigated what it takes to use a 16-bit DLL in 32-bit code which
is
evidently possible but not very easy.  It involves a term known as a
"thunk".
Check out the Microsoft Knowledge base on this term.

Does Borland provide a 32 bit Pascal compiler?  It would probably not be too
hard to recompile the code to 32 bit if there is a 32 bit
compiler...preferably
Borland.  And if you have the source  code.  Just review the variable sizes
between the 16 and 32 bit.  They usually vary in byte size.

Otherwise it is also possible to use Visual Basic 4.0 16-bit to call the 16
bit
DLL.  This will also take some work as the VB 5.0 forms wont work in VB 4.0.
However all of the source code should have no problem.  You would just have
to
recreate the forms in VB 4.0, then copy the source code into it.  Also if
you go
this route you will have to uninstall VB 5.0 before installing VB 4.0
...they do
not work together (from what I have read).

Quote
Jaime M Bustos wrote:
> Brad,

> i'm having trouble using a DLL generated by Borland Pascal 7 (which works
Ok
> when called from other BP7 programs) from VB5. After reading a previous
> answer from you and checking BP7 i guess the problem is that the DLL is 16
> bits.

> is there a way in VB to take the 16 bit library? (it seems to me that it's
> not easy/feasible to upgrade the BP7 code to 32 bit)

> thanks

> Jaime Bustos j...@Lehigh.Edu

Other Threads