06-16-2008, 6:30
|
jjwalters
Joined on 06-11-2008
Posts 14
|
Loading txt files - invalid file format
|
 
 
|
|
|
Hello
I bet I've forgotten to do some basic configuration - but I have searched the LeadTools chm files, Googled extensively, and searched this forum and come up with nothing.
I'm using LeadTools 15 Raster Image Pro - evaluation.
How do I load a .txt (plain non-Unicode ASCII text) file - without getting an Invalid File Format error.
I can't even do a LFile.GetInfo() - get the same error.
My ultimate aim is to render the txt file as a bitmap.
Here's my code
<code>
LBase::LoadLibraries(LT_KRN | LT_FIL); // Does nothing if they are already loaded.
L_TCHAR *filename = "some file name.txt";
LFile LeadFile;
LeadFile.SetFileName(filename);
FILEINFO fileInfo;
ZeroMemory(&fileInfo, sizeof(FILEINFO));
fileInfo.uStructSize = sizeof(FILEINFO);
L_INT nSuccess = LeadFile.GetInfo(&fileInfo, sizeof(FILEINFO), FILEINFO_TOTALPAGES);
</code>
nSuccess has value -9.
Similarly:
<code>
LBitmap lb;
nSuccess = lb.Load(filename, 0, ORDER_BGRORGRAY, nPage);
</code>
If I try this I get a slightly different error code -2002 (invalid parameters):
<code>
LFile rawfile;
rawfile.SetFileName(filename);
nSuccess = rawfile.LoadFile(0, ORDER_RGB, LOADFILE_ALLOCATE | LOADFILE_STORE);
</code>
So what have I forgotten to do????
|
|
|
|
|
Report
|
|
|
|