Re: unsupported function problem - WinCE
First, this belongs more in comp.os.ms-windows.programmer.win32
Next, the function is declared:
BOOL WINAPI SHGetAutoRunPath(LPTSTR pAutoRunPath);
Which is a normal C declration. So, to make life easy, first we make a =
function pointer typedef. How to do that is more c/c++ than win32. And =
we declare an instance of that new type and initialize it.
typedef BOOL(WINAPI* PFNSHGETAUTORUNPATH)(LPTSTR);
PFNSHGETAUTORUNPATH pSHGetAutoRunPath = NULL;
Now, the win32 part. We load the function pointer from the relevent =
platform dll.
HMODULE hAygShell = LoadLibrary(TEXT("aygshell.dll"));
pSHGetAutoRunPath = (PFNSHGETAUTORUNPATH) =
GetProcAddress(hAygShell,"SHGetAutoRunPathW");
Now, you can test pSHGetAutoRunPath to see if it was loaded or not =
before calling it with code similar to this:-
TCHAR szBuf[MAX_PATH]={0};
if(pSHGetAutoRunPath) {
pSHGetAutoRunPath(szBuf);
} else {
// fake it on platforms that dont have it.
}
One last note: "SHGetAutoRunPathW" has the W on the end because most =
win32 functions exist in W or A suffix versions which are used when you =
build for Unicode or Ansi support. Because the platform in question =
might be unicode only, the W might not be necessary. If the =
GetProcAddress call fails on the platform it should succeed on, try the =
other variations.