Solved

Building DLL from .LIB & .H

Posted on 2004-10-11
6
767 Views
Last Modified: 2008-01-09
SUMMARY
------------
I need the detailed steps of building a DLL project from .LIB & .H files using VC++ 6.0


DETAILES
-----------
I have Windows XP SP2 and I have installed Platform SDK in order to get the ibrary files to use in my Bluetooth application that will be developed in VC#.NET. The files are "irprops.lib" and "BluetoothAPIs.h" as mentioned at the end of this page:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bluetooth/bluetooth/bluetoothauthenticatedevice.asp

The two files (irprops.lib & bluetoothAPI.h) downlodable at http://www.mybestserver.com/download/bluetooth_lib.zip.

I don't know how to use them in VC#.NET. It can deal with .DLL files only.

1) Please check the attached .LIB file. Does it contain the implelmenations of the functions listed in this link?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bluetooth/bluetooth/bluetooth_functions.asp

2) Does the file "irprops.lib" refere to other DLLs that I can use directly without the need to "irprops.lib" itself?

3) If I can develop a DLL project from th given files (irprops.lib & bluetoothAPI.h) then send me the detailed steps of doing so using VC++ 6.0 as I am not VC++ programmer.
0
Comment
Question by:f_asmaa
[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
  • 3
  • 2
6 Comments
 
LVL 13

Expert Comment

by:SteH
ID: 12277754
In order to use functions from a DLL you need to include the .lib file at the linking stage. Either add it to the project or add it to the project settings on the linking tab.

And in each code file you want to use functions from that DLL you need to include the header:
#include "BluetoothAPI.h"

That should be it.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 12277828
Actually, the DLL you are referring to already exists, it's part of the runtime environment. Do a

dumpbin /exports *.dll > exports.txt

in the system32 directory and locate which DLL exports these APIs.
0
 

Author Comment

by:f_asmaa
ID: 12278155
Dear jkr

1) What does dumpbin exactly do? Whn I run it I got the following error message
"This application has failed to start because mspdb60.dll was not found. Re-installing the application may fix this problem"

2) You told me that the already exists! Which dll and where can I find it?
0
Technology Partners: 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!

 
LVL 86

Expert Comment

by:jkr
ID: 12278221
>>What does dumpbin exactly do?

It lists the functions exported from DLLs and will help ypu find which DLL actually exports these Bluetooth functions. a .lib file only establishes the 'link' between the functions you want to use and the DLL file they reside in, so creating an additional DLL will only introduce overhead.

>>You told me that the already exists! Which dll and where can I find it?

That I don't know from the top of my head and that's where. 'mspdb60.dll' usually resides in 'Common\MsDev98\bin' under your VC6 installation. I assume that your PATH environment not set up correctly.

0
 

Author Comment

by:f_asmaa
ID: 12285574
Dear jkr,

When I run the dumpbin command on "Irprops.LIB", I get the following result. How can I use these results to get the DLL to use in VS.NET?

-------------------------------------- dumpbin /exports Irprops.lib --------------------------------------

Microsoft (R) COFF Binary File Dumper Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


Dump of file irprops.lib

File Type: LIBRARY

     Exports

       ordinal    name

                  _BluetoothAuthenticateDevice@20
                  _BluetoothAuthenticateMultipleDevices@16
                  _BluetoothAuthenticationAgent@16
                  _BluetoothDisconnectDevice@8
                  _BluetoothDisplayDeviceProperties@8
                  _BluetoothEnableDiscovery@8
                  _BluetoothEnableIncomingConnections@8
                  _BluetoothEnumerateInstalledServices@16
                  _BluetoothFindBrowseGroupClose@4
                  _BluetoothFindClassIdClose@4
                  _BluetoothFindDeviceClose@4
                  _BluetoothFindFirstBrowseGroup@8
                  _BluetoothFindFirstClassId@8
                  _BluetoothFindFirstDevice@8
                  _BluetoothFindFirstProfileDescriptor@8
                  _BluetoothFindFirstProtocolDescriptorStack@8
                  _BluetoothFindFirstProtocolEntry@8
                  _BluetoothFindFirstRadio@8
                  _BluetoothFindFirstService@8
                  _BluetoothFindNextBrowseGroup@8
                  _BluetoothFindNextClassId@8
                  _BluetoothFindNextDevice@8
                  _BluetoothFindNextProfileDescriptor@8
                  _BluetoothFindNextProtocolDescriptorStack@8
                  _BluetoothFindNextProtocolEntry@8
                  _BluetoothFindNextRadio@8
                  _BluetoothFindNextService@8
                  _BluetoothFindProfileDescriptorClose@4
                  _BluetoothFindProtocolDescriptorStackClose@4
                  _BluetoothFindProtocolEntryClose@4
                  _BluetoothFindRadioClose@4
                  _BluetoothFindServiceClose@4
                  _BluetoothGetDeviceInfo@8
                  _BluetoothGetRadioInfo@8
                  _BluetoothIsConnectable@4
                  _BluetoothIsDiscoverable@4
                  _BluetoothMapClassOfDeviceToImageIndex@4
                  _BluetoothMapClassOfDeviceToString@4
                  _BluetoothRegisterForAuthentication@16
                  _BluetoothRemoveDevice@4
                  _BluetoothSdpEnumAttributes@16
                  _BluetoothSdpGetAttributeValue@16
                  _BluetoothSdpGetContainerElementData@16
                  _BluetoothSdpGetElementData@12
                  _BluetoothSdpGetString@24
                  _BluetoothSelectDevices@4
                  _BluetoothSelectDevicesFree@4
                  _BluetoothSendAuthenticationResponse@12
                  _BluetoothSetServiceState@16
                  _BluetoothUnregisterAuthentication@4
                  _BluetoothUpdateDeviceRecord@4
                  _CPlApplet@16

  Summary

          C6 .debug$S
          14 .idata$2
          14 .idata$3
           4 .idata$4
           4 .idata$5
           C .idata$6
0
 
LVL 86

Expert Comment

by:jkr
ID: 12288859
>>When I run the dumpbin command on "Irprops.LIB"

That will not help. As I wrote, use

dumpbin /exports *.dll > exports.txt

in the system32 directory and locate which DLL exports these APIs in the resulting text file 'exports.txt'.
0

Featured Post

Industry Leaders: 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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…

707 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