Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can DLL work with static lib?

Posted on 1999-01-05
2
Medium Priority
?
280 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
[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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

719 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