I'm writing a plugin for another application. I have successfully been able to use WriteFile(), but I am getting errors with ReadFile().
GetLastError() returns "invalid access to memory location". I'm confused, and have even tried subtracting and adding 1 to fileSize, but I can't see what the problem is. Any help?Code:void loadLayers() { DWORD dwRead = 0; hLayerFile = CreateFile("ltmp.dat", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); char *urls = NULL; DWORD fileSize = GetFileSize(hLayerFile, NULL); if (ReadFile(hLayerFile, urls, fileSize, &dwRead, NULL) == 0) {//ReadFile() does return 0 and here I call GetLastError()



LinkBack URL
About LinkBacks


