Click here to Skip to main content
15,888,610 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 7:19
Tarun Jha10-Dec-17 7:19 
AnswerRe: To take input for n number of arrays and print it. Pin
Member 1332249811-Dec-17 8:55
Member 1332249811-Dec-17 8:55 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha11-Dec-17 10:56
Tarun Jha11-Dec-17 10:56 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha16-Dec-17 5:41
Tarun Jha16-Dec-17 5:41 
QuestionHow do I keyboard input in OpenGL Pin
Mr. Anup Roy1-Dec-17 3:57
professionalMr. Anup Roy1-Dec-17 3:57 
QuestionHow to get cpu speed and ram manufaturer C Languae? Pin
Uzair Ahmad12-Nov-17 4:56
Uzair Ahmad12-Nov-17 4:56 
AnswerRe: How to get cpu speed and ram manufaturer C Languae? Pin
Afzaal Ahmad Zeeshan1-Dec-17 4:32
professionalAfzaal Ahmad Zeeshan1-Dec-17 4:32 
QuestionHow to Disable open drop down Pin
yaswanthdasari24-Oct-17 21:36
yaswanthdasari24-Oct-17 21:36 
SuggestionRe: How to Disable open drop down Pin
Richard MacCutchan24-Oct-17 22:44
mveRichard MacCutchan24-Oct-17 22:44 
GeneralRe: How to Disable open drop down Pin
yaswanthdasari25-Oct-17 0:38
yaswanthdasari25-Oct-17 0:38 
AnswerRe: How to Disable open drop down Pin
Daniel Pfeffer25-Oct-17 1:11
professionalDaniel Pfeffer25-Oct-17 1:11 
GeneralRe: How to Disable open drop down Pin
yaswanthdasari25-Oct-17 23:50
yaswanthdasari25-Oct-17 23:50 
QuestionHow To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 21:50
Member 1347149317-Oct-17 21:50 
QuestionRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 21:58
mveRichard MacCutchan17-Oct-17 21:58 
AnswerRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 22:09
Member 1347149317-Oct-17 22:09 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 22:12
mveRichard MacCutchan17-Oct-17 22:12 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 22:29
Member 1347149317-Oct-17 22:29 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan17-Oct-17 22:45
mveRichard MacCutchan17-Oct-17 22:45 
AnswerRe: How To Add a Dll TO MFC Application in visual Studio Pin
Jochen Arndt17-Oct-17 22:44
professionalJochen Arndt17-Oct-17 22:44 
To use functions from a DLL you have two choices: Early and late binding.

Early binding:
Link your application with the DLL by using the #import directive in one file (usually a source file using functions from the DLL) specifying the file name (usually without extension or with .lib), or add the .lib file to your project settings (Linker - Input).
Include the header file and call the functions defined in that file.

Late binding:
This is only necessary if the DLL might not be present when your application is executed or you do not have a .lib file. Then use LoadLibrary and GetProcAddress like in your above example. But check both return values to be not NULL. Have a look at the header file (if present), to know how to define the function prototypes. Example:
C++
typedef int (__stdcall *ConnectByAddressfuncPtr)(short Addr); 

ConnectByAddressfuncPtr LibMainConnectByAddress = NULL;
HMODULE hLib = LoadLibrary(_T("mcl_gen.dll"));
if (hLib)
    LibMainConnectByAddress = (ConnectByAddressfuncPtr)GetProcAddress(hLib,"ConnectByAddress");
if (LibMainConnectByAddress)
    LibMainConnectByAddress(0x01);
Note that I have initialised the function pointer with NULL and checked it before calling the function. Note also the __stdcall in the prototype declaration. It defines the calling convention used by the DLL. You have to check which is used (by inspecting the header file or asking the provider). __stdcall is common but it might be also __cdecl.
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149317-Oct-17 23:13
Member 1347149317-Oct-17 23:13 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Jochen Arndt17-Oct-17 23:29
professionalJochen Arndt17-Oct-17 23:29 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan18-Oct-17 0:16
mveRichard MacCutchan18-Oct-17 0:16 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Member 1347149318-Oct-17 0:58
Member 1347149318-Oct-17 0:58 
QuestionRe: How To Add a Dll TO MFC Application in visual Studio Pin
Richard MacCutchan18-Oct-17 1:18
mveRichard MacCutchan18-Oct-17 1:18 
GeneralRe: How To Add a Dll TO MFC Application in visual Studio Pin
Jochen Arndt18-Oct-17 1:40
professionalJochen Arndt18-Oct-17 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.