Solved

Can DLL work with static lib?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 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.

734 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