tags:

views:

29

answers:

2

Hi

What are the different ways to load a win32 or MFC DLL into an MFC application?

I know there are 2 ways to link a DLL. 1.) Include the lib file created with the DLL 2.) Using .def file and LoadLibrary function. Is there any other ways to link the DLL?

Regards, AH

A: 

This can be done dynamically or statically depending on your requirement.

This link gives you enough information.

http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855

ckv
Yes.I know there are 2 ways to link a DLL.1.) Include the lib file created with the DLL2.) Using .def file and LoadLibrary function.Is there any other ways to link the DLL?
AH
What is wrong with the 2 ways that are present and what is your specific requirement.
ckv
Hey, Got it.There are three ways of loading. Along with the two ways of loading DLL as i mentioned earlier, The third ways is using "AfxLoadLibrary" and "FreeLibrary". Please refer the link for further details.http://www.codeproject.com/KB/DLL/loadingdll.aspx
AH
Can you accept the answer which one you feel is correct.
ckv
A: 

No, there are no other ways. It's either static or dynamic. Also, you don't need a .def file for LoadLibrary.

Roel