VC++ 2003 Does Not Support DEF files -- Correct?

  • Thread starter Thread starter Harry Whitehouse
  • Start date Start date
Harry Whitehouse said:
I just wanted to confirm this for WIN32 projects in VC++ 2003.

It looks like you need to reference functions in 3rd party DLL's (C-based)
by building a LIB file as described here:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q131313&id=KB;EN-US;q131313

Am I wrong in my assumption?

Well, that's not strictly true.

Certainly, when developing unmanaged components that is the easiest way to
go. But, there is nothing to stop you from calling the target functions
through a pointer by means of an explicit load of the 3rd party DLL with
LoadLibrary(), and finding the entry points of the functions with
GetProcAddress(), and calling the functions through the returned pointer,
and finally finishing some time later with FreeLibrary(). This can get
tedious in a hurry.

If you are developing managed components, you can use the services provide
by Platform Invoke. I'd explain, but I don't think that's what you are up
to. If so, just holler.

Regards,
Will
 
Harry said:
I just wanted to confirm this for WIN32 projects in VC++ 2003.

It looks like you need to reference functions in 3rd party DLL's (C-based)
by building a LIB file as described here:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q131313&id=KB;EN-US;q131313

VC++ 2003 does support def files as well as previous versions, , but
def files are usually used when building a DLL.
What is described in this KB is a "hack" to get a LIB file when you
have only a DLL. This hack will work in VC2003 as well as in previous
versiosn.
The usual way to use a DLL is :
- if you've got .h and .lib, use them.
- Elsewhere, use LoadLibrary/GetProcAddress.

Please describe the context of your problem for a more meaningfull
answer.

Arnaud
MVP - VC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top