Click here to Skip to main content
15,923,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDLL fails on 9x platform, runs on NT platform Pin
JeffRoz9-Apr-07 14:14
JeffRoz9-Apr-07 14:14 
AnswerRe: DLL fails on 9x platform, runs on NT platform Pin
Rick York9-Apr-07 15:54
mveRick York9-Apr-07 15:54 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JeffRoz9-Apr-07 16:49
JeffRoz9-Apr-07 16:49 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
Steve S10-Apr-07 0:16
Steve S10-Apr-07 0:16 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JeffRoz10-Apr-07 3:09
JeffRoz10-Apr-07 3:09 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JudyL_MD10-Apr-07 7:36
JudyL_MD10-Apr-07 7:36 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JeffRoz10-Apr-07 8:43
JeffRoz10-Apr-07 8:43 
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JudyL_MD10-Apr-07 8:55
JudyL_MD10-Apr-07 8:55 
JeffRoz wrote:
Interesting that on 9x the code works if the "return 1" is uncommented, and fails when it is commented?


My guess is that the compiler is optimizing the code and removing the call to the function since it is unreachable code with that return statement on the previous line.

JeffRoz wrote:
h32 = LoadLibrary(TEXT("advapi32.dll"));
if (h32)
{
pLsaOpenPolicy = (PLSAOPENPOLICY) GetProcAddress(hAdvApi32,"LsaOpenPolicy");

pLsaOpenPolicy(NULL,&ObjectAttributes,POLICY_VIEW_LOCAL_INFORMATION,&hPolicy);
}



Make sure you check the return value from GetProcAddress and you should put () around pLsaOpenPolicy when you make the actual function call. Also, remember to call FreeLibrary when you are done with all the function pointers from the library.

Judy
GeneralRe: DLL fails on 9x platform, runs on NT platform Pin
JeffRoz10-Apr-07 17:26
JeffRoz10-Apr-07 17:26 
QuestionRe: DLL fails on 9x platform, runs on NT platform Pin
JeffRoz16-Apr-07 5:26
JeffRoz16-Apr-07 5:26 
AnswerRe: DLL fails on 9x platform, runs on NT platform Pin
JudyL_MD16-Apr-07 6:05
JudyL_MD16-Apr-07 6:05 
QuestionHow to send update text message with only standard windows library Pin
theFrenchHornet9-Apr-07 12:55
theFrenchHornet9-Apr-07 12:55 
AnswerRe: How to send update text message with only standard windows library Pin
Mark Salsbery9-Apr-07 16:38
Mark Salsbery9-Apr-07 16:38 
GeneralRe: How to send update text message with only standard windows library Pin
theFrenchHornet10-Apr-07 4:27
theFrenchHornet10-Apr-07 4:27 
GeneralRe: How to send update text message with only standard windows library Pin
theFrenchHornet10-Apr-07 4:45
theFrenchHornet10-Apr-07 4:45 
AnswerRe: How to send update text message with only standard windows library Pin
prasad_som9-Apr-07 18:36
prasad_som9-Apr-07 18:36 
GeneralRe: How to send update text message with only standard windows library Pin
theFrenchHornet10-Apr-07 4:46
theFrenchHornet10-Apr-07 4:46 
QuestionNeed help on game creation Pin
thesad9-Apr-07 10:15
thesad9-Apr-07 10:15 
QuestionRe: Need help on game creation Pin
David Crow9-Apr-07 10:52
David Crow9-Apr-07 10:52 
AnswerRe: Need help on game creation Pin
Rick York9-Apr-07 15:58
mveRick York9-Apr-07 15:58 
GeneralRe: Need help on game creation Pin
Rajesh R Subramanian9-Apr-07 20:00
professionalRajesh R Subramanian9-Apr-07 20:00 
AnswerRe: Need help on game creation Pin
Wes Aday10-Apr-07 4:26
professionalWes Aday10-Apr-07 4:26 
Questionhidden process Pin
mahdiehIR9-Apr-07 10:12
mahdiehIR9-Apr-07 10:12 
AnswerRe: hidden process Pin
Dmitry Khudorozhkov9-Apr-07 10:28
Dmitry Khudorozhkov9-Apr-07 10:28 
AnswerRe: hidden process Pin
Stephen Hewitt9-Apr-07 15:14
Stephen Hewitt9-Apr-07 15:14 

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.