Im following some examples of opening dialog for a builder of hexedit files. Here the code I dont know why the HeapAlloc is used!
Code:
void* locate(size_t size){
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}
Here the OpenFIleDialog:
Code:
WCHAR curdir[MAX_PATH];
WCHAR *filepath = (WCHAR*)locate(MAX_PATH * sizeof(WCHAR));
GetCurrentDirectoryW(sizeof(curdir), curdir);
OPENFILENAMEW ofn;
And in the part of saving:
Code:
DWORD fileSize = GetFileSize(hFile, NULL), read;BYTE* pByte = (BYTE*)locate(fileSize);
ReadFile(hFile, pByte, fileSize, &read, 0);
Thx Again guys!