Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calling a dll from Installshield vc++ 6.0 Edition

Posted on 2002-05-30
5
Medium Priority
?
381 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:chirawa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7044122
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
0
 
LVL 22

Accepted Solution

by:
ambience earned 800 total points
ID: 7046245
>> 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.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question