Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: After Reboot PC, follow the un-completed job? Pin
Eytukan1-Sep-05 22:52
Eytukan1-Sep-05 22:52 
QuestionExample of server and client programming Pin
Member 21610041-Sep-05 17:17
Member 21610041-Sep-05 17:17 
AnswerRe: Example of server and client programming Pin
Eytukan1-Sep-05 23:30
Eytukan1-Sep-05 23:30 
AnswerRe: Example of server and client programming Pin
ThatsAlok2-Sep-05 0:01
ThatsAlok2-Sep-05 0:01 
QuestionHw to Shut down certain pc automatically whn the priority show emergency Pin
bryan5231-Sep-05 16:47
bryan5231-Sep-05 16:47 
QuestionRe: Hw to Shut down certain pc automatically whn the priority show emergency Pin
Jose Lamas Rios1-Sep-05 16:54
Jose Lamas Rios1-Sep-05 16:54 
QuestionRe: Hw to Shut down certain pc automatically whn the priority show emergency Pin
bryan5231-Sep-05 17:24
bryan5231-Sep-05 17:24 
QuestionDll Not Working Correctly Pin
dmtwpi211-Sep-05 16:17
dmtwpi211-Sep-05 16:17 
I'm trying to call the SystemParametersInfo() function in User32.dll from my C/C++ code on Win2k but it's not working. I've used the same code to successfully call a function from a different dll (kernel32.dll) so I'm confused. The LoadLibrary command works, but the GetProcAddress command is not, thus I get the output:

started it up...
loaded library...trying to find address of function...
proc addr: 0
couldn't get proc addr

I'm compiling with Visual Studio.net 2003. Any suggestions would be greatly appreciated. Thanks.


<br />
<br />
/* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp */<br />
<br />
#include <stdio.h><br />
#include <windows.h><br />
<br />
#define _WIN32_WINNT 0x0500<br />
<br />
typedef BOOL (*MYPROC) (UINT, UINT, PVOID, UINT);<br />
HINSTANCE hinstLib; <br />
MYPROC ProcAdd; <br />
<br />
BOOL result;   // return value of a call<br />
UINT uiAction; // the 4 params for function<br />
UINT uiParam;  // the 4 params for function<br />
PVOID pvParam; // the 4 params for function<br />
UINT fWinIni;  // the 4 params for function<br />
<br />
int main()<br />
{<br />
  printf("started it up...\n");<br />
  hinstLib = LoadLibrary("User32.dll");<br />
<br />
  if (hinstLib != NULL) <br />
  { <br />
    printf("loaded library...trying to find address of function...\n");<br />
    ProcAdd = (MYPROC) GetProcAddress(hinstLib, "SystemParametersInfo"); <br />
    printf("proc addr: %d\n", ProcAdd);<br />
    if (!ProcAdd) <br />
    {<br />
      printf("couldn't get proc addr\n");<br />
      FreeLibrary(hinstLib);<br />
      return 1;<br />
    }<br />
    printf("got proc addr...calling function\n");<br />
    result = (ProcAdd) (uiAction, uiParam, pvParam, fWinIni);  <br />
  } <br />
  else <br />
  {<br />
    printf("Failed to load lib\n");<br />
  }<br />
	<br />
  FreeLibrary(hinstLib);<br />
  printf("freed lib\n");<br />
  return 0;<br />
}<br />

AnswerRe: Dll Not Working Correctly Pin
Jose Lamas Rios1-Sep-05 16:37
Jose Lamas Rios1-Sep-05 16:37 
GeneralRe: Dll Not Working Correctly Pin
Anonymous2-Sep-05 1:50
Anonymous2-Sep-05 1:50 
GeneralRe: Dll Not Working Correctly Pin
Jose Lamas Rios2-Sep-05 3:37
Jose Lamas Rios2-Sep-05 3:37 
Questionhow to define a const multileline string Pin
xiaohe5211-Sep-05 15:39
xiaohe5211-Sep-05 15:39 
AnswerRe: how to define a const multileline string Pin
followait1-Sep-05 15:42
followait1-Sep-05 15:42 
GeneralRe: how to define a const multileline string Pin
xiaohe5211-Sep-05 15:45
xiaohe5211-Sep-05 15:45 
GeneralRe: how to define a const multileline string Pin
Christian Graus1-Sep-05 15:55
protectorChristian Graus1-Sep-05 15:55 
GeneralRe: how to define a const multileline string Pin
Trollslayer1-Sep-05 21:58
mentorTrollslayer1-Sep-05 21:58 
AnswerRe: how to define a const multileline string Pin
xiaohe5211-Sep-05 16:23
xiaohe5211-Sep-05 16:23 
AnswerRe: how to define a const multileline string Pin
Jose Lamas Rios1-Sep-05 16:27
Jose Lamas Rios1-Sep-05 16:27 
GeneralRe: how to define a const multileline string Pin
xiaohe5211-Sep-05 16:34
xiaohe5211-Sep-05 16:34 
Questionhelp,can't create windows in constructor and OnCreate Pin
followait1-Sep-05 15:27
followait1-Sep-05 15:27 
AnswerRe: help,can't create windows in constructor and OnCreate Pin
Jose Lamas Rios1-Sep-05 17:07
Jose Lamas Rios1-Sep-05 17:07 
Generallike this Pin
followait1-Sep-05 18:13
followait1-Sep-05 18:13 
GeneralRe: like this Pin
Jose Lamas Rios2-Sep-05 3:06
Jose Lamas Rios2-Sep-05 3:06 
QuestionSolve Error Pin
Member 21610041-Sep-05 14:53
Member 21610041-Sep-05 14:53 
AnswerRe: Solve Error Pin
Christian Graus1-Sep-05 15:10
protectorChristian Graus1-Sep-05 15:10 

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.