Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can DLL work with static lib?

Posted on 1999-01-05
2
Medium Priority
?
281 Views
Last Modified: 2010-04-02
hi,
I have the following scenario:
1) a VB application for GUI
2) a C++ DLL to provide callbacks for the VB application
this DLL needs to call functions from a static library.

can this be achieved? I got core dump at the static library functions.

thanks
andrea
0
Comment
Question by:tanmh
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 120 total points
ID: 1181617
Yes, VB can call a DLL (regardless of whether it was written in C++ or not). You specify a DLL by declaring a function referencing the DLL:

Private Declare Function myDLLFunction Lib "mydll.dll" Alias "myDLLFunction" (ByVal lpszArg1 As String, ByVal bArg2 As Long) As Long



A DLL can be statically linked to run-time libraries.  Post your code that core dumps, I suspect your doing something wrong.
0
 

Author Comment

by:tanmh
ID: 1181618
hi jhance,
i declared a new project of Win32 DLL type and in the project, i include the static library, mylib.lib.
inside one of functions in the DLL project, i called the functions in the lib, e.g. mylib->OnStart(....)

so when the application runs, it core dumps at mylib->OnStart.

a colleague suggests that I do the following:
1) create a normal c++ program (myprog) that links with mylib.lib
2) from VB, send interprocess msgs to myprog
3) from myprog, call the functions in mylib.lib to handle these msgs

pls advise.
andrea
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

885 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