• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

Calling a dll from Installshield vc++ 6.0 Edition

I am facing one problem in calling a dll from my installshield setup file VC++ Edition.
I found there is one funtion available in installshild, the funcion is CallDllFx(). You have to provide the dll name and the function that you want to use.

I have created one dll in vb 6.0.

My problem is that it is given in installshild that the function defination in the dll shuold be like :

LONG APIENTRY FunctionName(HWND hwnd,LPLONG lpLong,LPSTR lpszValue)

but i faild to create to create this type of function in vb. in vb i am not getting HWND or LPLONG data type.

so how i can call that dll from my setup file in installshild. is there any other way possible. and if not then how i can create this type of function in vb.
1 Solution
Well, I'm not a VB expert but I think the proper declaration for this C/C++ function is:

Declare Function FunctionName (ByVal as Long, ByRef As Long, ByRef as String) As Long
>> if not then how i can create this type of function in vb

That a secondary thing, first how are going to create this typpe of DLL in VB, VB doesnt allow regular Win32 Dlls, all the dlls in VB are COM dlls.

I dont think there is a way to create a regular dll in VB that exports some functions.

If you really need that then perhaps create a simple dll in VC.

Using that dll from installshield then would be much easier that way.

BTW , you dont have to use CallDllFx, this is a much restricted way to achieve that , a simple way is to create a simple dll and put it into the SUPPORTDIR , then you can reference that DLL by its name.

Then prototype the functions that you are going to use from the dll like

prototype cdecl INT YourDll.StartService(BYVAL STRING);
prototype cdecl BOOL YourDll.StopService(INT);

And dont forget to load the dll when required like

UseDLL(SUPPORTDIR ^ "YourDll.dll");

and that is all.


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now