Hi All
The Following Code
attempts to list subfolders in foldername
It is running a 32 bit prog designated as compile in 32 bit on a 64 bit machine
The entire proram works fine on wince for a pda and I am now converting / rewriting to suit my 64bit laptop
My first problem is that on searcing for folders I get none they are clearly there
and are listed as files but not singled out as folders
Note all folders files are text files and are generated on a 32 bit pda
The 4 questions that arise for me are
1 Can I in some way confirm that my prog is in fact being compiled as a 32 bit app
did I click on the right option at the outset
2 Would I be better to compile to 64 bit instead
3 if I have to use Wow64DisableWow64FsRedirection( _Out_ PVOID *OldValue);etc
does anyone know what I should be putting in for the _Out_ PVOID *OldValue
4 Is there an alternative way to traverse the folders in c that will overcome the 64 bit problem
/**********************************************************************************
static void DisplayFoldersNamesToCombo(wchar_t *foldername)
called to collect folder names and diasplay to combo at top of list view
Errors : None
----------------------------------------------------------------------------*/
static void DisplayFoldersNamesToCombo(HWND h,int ctrlid,wchar_t *foldername)
{
SendMessage(GetDlgItem(h,ctrlid), CB_RESETCONTENT,0,0);
wchar_t pathname[255];
wcscpy(pathname,foldername);
//add the search filter
wcscat(pathname,L"*.*");
//Wow64DisableWow64FsRedirection( _Out_ PVOID *OldValue);
WIN32_FIND_DATA lpFindFileData;
HANDLE findhandle = FindFirstFile(pathname,&lpFindFileData);
if (findhandle==INVALID_HANDLE_VALUE)
{
MessageBox(NULL, L"Directory Not Found", L"Error", MB_OK);
return;
}
//after findfirst successfully retrieved search handle
if (lpFindFileData.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY)
{
SendDlgItemMessage(h, ctrlid, CB_ADDSTRING,(WPARAM) 0, (LPARAM)lpFindFileData.cFileName);
}
// now use FinndNext
while (FindNextFile(findhandle,&lpFindFileData)==TRUE)
{
if (lpFindFileData.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY)
{
SendDlgItemMessage(h, ctrlid, CB_ADDSTRING, 0, (LPARAM)lpFindFileData.cFileName);
//MessageBox(NULL,lpFindFileData.cFileName ,L"FindNextFile", MB_OK | MB_ICONINFORMATION);
}
}
FindClose(findhandle);
//Wow64RevertWow64FsRedirection( _In_ PVOID OldValue);
}