Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MCI CD Audio Output Pin
Christopher Duncan6-Sep-06 7:52
Christopher Duncan6-Sep-06 7:52 
Questionstoring data to a file Pin
vijay_aroli6-Sep-06 1:53
vijay_aroli6-Sep-06 1:53 
AnswerRe: storing data to a file Pin
led mike6-Sep-06 6:07
led mike6-Sep-06 6:07 
AnswerRe: storing data to a file Pin
Jun Du6-Sep-06 10:32
Jun Du6-Sep-06 10:32 
QuestionHow Can i Call a Function Providing its name as a string Pin
MIAN KAMRAN6-Sep-06 1:29
MIAN KAMRAN6-Sep-06 1:29 
QuestionRe: How Can i Call a Function Providing its name as a string Pin
Rajesh R Subramanian6-Sep-06 1:36
professionalRajesh R Subramanian6-Sep-06 1:36 
AnswerRe: How Can i Call a Function Providing its name as a string Pin
Cedric Moonen6-Sep-06 1:38
Cedric Moonen6-Sep-06 1:38 
AnswerRe: How Can i Call a Function Providing its name as a string Pin
Frank K6-Sep-06 2:44
Frank K6-Sep-06 2:44 
Hi,

Function as a string?? Why? ... but ...

You can get the address of a function with
<br />
FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName);<br />


You need the module handle and the name of the function.

Example for the function GetMenu from user32.dll
<br />
typedef HMENU (WINAPI *GETMENU) (HWND);<br />
GETMENU FuncGetMenu;<br />
HMODULE hUser32Dll;<br />
<br />
_hUser32Dll = ::LoadLibrary("user32.dll");<br />
if(NULL != hUser32Dll)<br />
{<br />
FuncGetMenu = (GETMENU)::GetProcAddress(hUser32Dll, "GetMenu");<br />
}<br />
<br />
if(NULL != FuncGetMenu)<br />
{<br />
FuncGetMenu(WindowHandle); //HMENU GetMenu(HWND hWnd);<br />
}<br />


This is an example for dynamic load a dll.
--> You need more than only the function name! You also need the function declaration.

HTH
Frank
AnswerRe: How Can i Call a Function Providing its name as a string Pin
Chris Losinger6-Sep-06 2:54
professionalChris Losinger6-Sep-06 2:54 
AnswerRe: How Can i Call a Function Providing its name as a string Pin
Viorel.6-Sep-06 3:12
Viorel.6-Sep-06 3:12 
AnswerRe: How Can i Call a Function Providing its name as a string Pin
yjzh6-Sep-06 4:20
yjzh6-Sep-06 4:20 
AnswerRe: How Can i Call a Function Providing its name as a string Pin
Rilhas8-Sep-06 9:29
Rilhas8-Sep-06 9:29 
QuestionWinsock TCP Client disconnect Pin
Eytukan6-Sep-06 1:21
Eytukan6-Sep-06 1:21 
AnswerRe: Winsock TCP Client disconnect Pin
Frank K6-Sep-06 2:29
Frank K6-Sep-06 2:29 
GeneralRe: Winsock TCP Client disconnect Pin
Eytukan6-Sep-06 3:17
Eytukan6-Sep-06 3:17 
AnswerRe: Winsock TCP Client disconnect Pin
cmk6-Sep-06 20:35
cmk6-Sep-06 20:35 
GeneralRe: Winsock TCP Client disconnect Pin
Eytukan7-Sep-06 21:09
Eytukan7-Sep-06 21:09 
QuestionData Type Conversion Problem Pin
Programm3r6-Sep-06 0:47
Programm3r6-Sep-06 0:47 
AnswerRe: Data Type Conversion Problem Pin
Waldermort6-Sep-06 0:58
Waldermort6-Sep-06 0:58 
Questionhow to dermine weather the Given string is numeric or not , vc++ Pin
cybersadhu6-Sep-06 0:34
cybersadhu6-Sep-06 0:34 
AnswerRe: how to dermine weather the Given string is numeric or not , vc++ Pin
toxcct6-Sep-06 0:36
toxcct6-Sep-06 0:36 
AnswerRe: how to dermine weather the Given string is numeric or not , vc++ Pin
Waldermort6-Sep-06 0:39
Waldermort6-Sep-06 0:39 
AnswerRe: how to dermine weather the Given string is numeric or not , vc++ Pin
Hamid_RT6-Sep-06 0:52
Hamid_RT6-Sep-06 0:52 
AnswerRe: how to dermine weather the Given string is numeric or not , vc++ Pin
David Crow6-Sep-06 4:04
David Crow6-Sep-06 4:04 
GeneralRe: how to dermine weather the Given string is numeric or not , vc++ Pin
toxcct6-Sep-06 4:53
toxcct6-Sep-06 4:53 

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.