Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use a VB dll in Delphi?

Status
Not open for further replies.

TheBugSlayer

Programmer
Sep 22, 2002
887
US
Hi all.
I have some function in VB that I would like to "universalize". The best way I found to do that is to wrap them in DLLs. NOw that my DLLs (ActiveX) are created, howo do I use them in Delphi?

Any help is appreciated.
 
Read the chapters on ActiveX in the Delphi manual.
And then again.

HTH,
TonHu
 
If you have the function in VB code, why not rewrite it in Delphi? Performance for one will be better! Never too old to learn...
Nico
 
I don't have time to rewrite all those functions (not only one) now, neither do I have time to find the matching fx.and procs. in Delphi.

Please help. When I have time i might try that.
 
Use the Component|Import ActiveX Control to add your OCX's to the component palette, then just drop them on the form and use... Never too old to learn...
Nico
 
I am not too sure how to create the OCX in VB. I will investigate that. What I have is a DLL file and I am not able to see that in the Component|Import ActiveX Control list in Delphi.

Thanks.
 
To simply use functions and procedures from DLL's, have a look at the dynamic-link libraries topic in the Delphi help system. Basically, you have to import the functions and procedures by declaring them:

procedure extHallo; external 'VBDll.dll';
function extBye: boolean; external 'VBDll.dll';


Then you can call the functions and procedures as if they where in the unit itself. Just be aware that variables in the DLL can not be addressed, everything has to go through functions.
Never too old to learn...
Nico
 
Thanks Nico.
This sounds more like what I want. Though it would be easier if i just had a component I could drop on my form and make a reference to its properties and methods...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top