dirtdart
asked on
MFC and Shell Assert errors
I am attempting to write a small dialog based MFC program that uses the SHGetValue to check a registry value. However, whenever I include shlwapi.h and link with shlwapi.lib, the program crashes before it can even get started with the following error:
Debug Assertation Failed!
Program: D:\depmake.exe
File: afxwin1.inl
Line: 22
When debugging, I can't even step to the first line of the code before getting this error. If I click the retry button to get to the source, it fails on the following line:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceH andle != NULL);
Does anyone know of a cure for this action? I could really care less about using the SHGetValue function, but I'd hate to be excluded from using any shell functions simply because I'm using MFC (once again an indication of how poorly planned MFC is).
Thanks
Debug Assertation Failed!
Program: D:\depmake.exe
File: afxwin1.inl
Line: 22
When debugging, I can't even step to the first line of the code before getting this error. If I click the retry button to get to the source, it fails on the following line:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceH
Does anyone know of a cure for this action? I could really care less about using the SHGetValue function, but I'd hate to be excluded from using any shell functions simply because I'm using MFC (once again an indication of how poorly planned MFC is).
Thanks
ASKER
That is a good suggestion, and it's what I ended up doing with this program, but it doesn't solve the problem. The program didn't crap out because of that function, it crapped out because I linked it with shlwapi.lib.
What OS are you running on?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sounds like a weiner to me.
RegOpenKeyEx
RegQueryValueEx
etc... That's the Win32 way to access registry values from _any_ Win32 program
The function SHGetValue is only for NT 5 (Windows 2000).