C - Troubleshoot Home : www.sharetechnote.com
If you get this error in DotNet 2008 (may be working in other versoin as well), Disabling 'Create/Use Precompiled Header' might solve the problem. See Enabling/Disableing Precompiled Header for the details.
This error would take many different form depending on situation and would print out as ''function' : cannot convert parameter number from 'type1' to 'type2''
Example 1 >
Code causing the error:
HMODULE hDll = LoadLibrary("user32.dll");
Error Message :
error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char ' to 'LPCWSTR'
HMODULE hDll = LoadLibrary(L"user32.dll");
< Case 1 > cause this error because the pointer myStrPtr is not initialized (in this case it means that no memory is allocated to store the array of chars (string). < Case 2 > removes the error.
< Case 1 >
< Case 2 >