Solved

Can DLL work with static lib?

Posted on 1999-01-05
2
272 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 30 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now