September 11th, 2009, 10:20 PM
Delayload & lnk2019
I am trying to use some APIs found in dwmapi.dll (like DwmExtendFrameIntoClientArea), but I have some problems. If I include dwmapi.lib in the dll include list, the the app works fine on Vista, but doesn't want to run on XP since dwmapi.dll is obviously missing.
I tried the /DELAYLOAD option, but if I put dwmapi.lib in the delay loaded dlls, now the app doesn't compile:
I have linked my app to Delayimp.lib as said on MSDN and have included "#include <dwmapi.h>" in the header.
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification
1>ComLib.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1>LINK : warning LNK4199: /DELAYLOAD:dwmapi.lib ignored; no imports found from dwmapi.lib
1>ComLib.obj : error LNK2019: unresolved external symbol __imp__DwmExtendFrameIntoClientArea@8 referenced in function "public: void __thiscall Forms::Dialog::ExtendFrame(struct tagRECT)" (?ExtendFrame@Dialog@Forms@@QAEXUtagRECT@@@Z)
Here are my linker compile arguments:
/INCREMENTAL /NOLOGO "Version.lib" "Psapi.lib" "Wininet.lib" "Ole32.lib" "Shlwapi.lib" "Delayimp.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DELAYLOAD:"dwmapi.lib" /MANIFEST /ManifestFile:"Debug\Windows App.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"App.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
I want a single executable to be able to run on both XP and Vista while calling DWM functions when ran in Vista.
Thanks in advance
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!