//err = IO::fileSystem.GetSpecialLocation(IO::FileSystem::ApplicationFolder, &apxPath); // not APX location
LPSTR apxPath = new TCHAR[_MAX_PATH];
GetModuleFileName((HINSTANCE)&__ImageBase, apxPath, _MAX_PATH);
char* pos = str_lastchr(apxPath, '\\');
pos[1] = 0; // get only the location
IO::Location binPath;
binPath.Set(apxPath);
IO::Name fname = IO::Name(/*input: filename without extension*/);
fname.Append(".bin"); // file extension
err = binPath.AppendToLocal(fname);
//binPath.PrintDebug();
// open file
IO::File srcFile(binPath);
err = srcFile.Open(IO::File::ReadMode);
<== no error here
// get size
USize szStr = 0;
err = srcFile.GetDataLength(&szStr);
<== no error here, returns correct file size
++szStr;
// read file
char* srcStr = new char[szStr]();
//err = srcFile.ReadBin(srcStr, szStr);
<== returns 0x81000100 (FileNotFound), srcStr is empty
err = srcFile.CopyBin(srcStr, szStr);
<== returns 0x81000100 (FileNotFound), srcStr contains what I needed
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS