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!

Calling DLL from C++Builder 6 whitout .lib

Status
Not open for further replies.

Serenades

Programmer
Oct 3, 2001
21
SE
Hi,

Ive been searching the whole web by this without finding any good information about Borland C++Builder is it me or...

My problem is that ive created dll´s in VB which i would like to call from Borland C++Builder, all snippets or helps ive found take for granted you got the .lib file which i dont have.

Can anybody please give me some small example on how to call a dll (ex. user32.dll) and how to use a function contained in it from Borland C++Builder.
Im quite new to Bcb, about to migrate from VB to C++ and are picking up my old C++.

Best regards
Robert
 
Well, lib file are there so compiler can "help" you providing the right function pointers to functions in dll. But, if you don't have .lib file then, unfortenatelly, you must use explicit linking. You must know which functions from dll you want, the exact names and parameters, then you make a proper function-pointers in your code, and (finally) use Win32API functions LoadLibrary (to load actual dll file) and GetProcAddress (to get actual pointer to function in that dll).
I hope this helps, you can see the description of these API calls in Win32SDK help file.
 
Hi,

Ive continued searching and find some usefull(?) information on some russian and japanese sites (im from sweden) ;), after som serious puzzling i managed to get it to work... was about to throw my computer from second floor...

I now can use my Dll´s both dynamic, static, from VB and in ASP.

Thanx for give me some directions... didnt think of Win32SDK...


Best regards
Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top