Hello, This might be a little off-topic, but the project as a whole has to do with the subject and I know that there are lots of wise people in this community:) I'm using a program to create a picture is DOS. I'm not sure, but I think that the picture is in .prn -format and I can do different versions of it to different printers. The program doesn't tell me much information and I have only binary, so I can't look what it is doing. However, I can't view the file. I've tried for example GSView, that should be able(?) to show .prn -files. So, my questions are: How can I check if the file is in .prn -format? Can I view it and convert it in DOS to something easier, such as .jpg or gif? Thanks, -Janine
Janine
Posts
-
Viewing .prn -files -
Problem with compilersHello, I need to include instructions of compiling different kinds of files to others. I have all those compilers on my computer, but how can I tell my makefile or visual studio where they are. I know I could put the path in front of the compiler name, but the problem is that some of those use preprocessors and those I don't call myself. -Janetta
-
CFile::Open failsOk, now I understood. And it helped. I'll go through the link later anyway, it seemed interesting. Thanks. -Janetta
-
CFile::Open failsTomasz Sowinski wrote: On the other hand, you may just drop 'shareExclusive' flag. I'm using that already, or am I doing it in a wrong way? It's used like this:
if ( !pFile->Open(cstrFileName, CFile::modeRead | CFile::shareExclusive, pExc) )
I'll check the address you gave. Thanks, -Janetta -
CFile::Open failsHello, This might be a stupid question:-O. I'm trying to save and load settings in my program using CFileDialog. The problem is that opening the file I've saved fails most of the times, but not always. I'm assuming that it is because of a sharing violation, because CFileException gets a value 0xb, which means CFileException::sharingViolation. Please correct me if I'm wrong. lOsError got a value 0x20, but I can't find what that means. So my question is, why does'nt the opening succeed? If it's because of sharing violation, what might be causing it? Not closing the file last time it was used might be, but I think it's something else, because opening fails randomly, like if I try to open it two times a row, the first trying fails and the next one succeeds. Here's how I'm trying to do it:
void SettingsDlg::OnLoadButton()
{
UpdateData();
CString cstrFileName;
CFileDialog FileDlg(TRUE, /* Make a open dialog box. */
"cnf", /* Default file name extension. */
NULL, /* No default filename. */
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR,
"Configuration files (*.cnf)|*.cnf|All files (*.*)|*.*||");if ( FileDlg.DoModal() == IDOK ) { cstrFileName = FileDlg.GetPathName(); /\* Create a new file and open it. \*/ CFile\* pFile = new CFile(); ASSERT (pFile != NULL); CFileException \*pExc = new CFileException(TRUE); if ( !pFile->Open(cstrFileName, CFile::modeRead | CFile::shareExclusive, pExc) ) { MessageBox("Error: Unable to open the file."); delete pFile; pFile = 0; return; } bool bReading = true; /\* We'll read. \*/ CArchive\* pArchive = NULL; try { pFile->SeekToBegin(); UINT uMode = (bReading ? CArchive::load : CArchive::store); pArchive = new CArchive (pFile, CArchive::load); ASSERT (pArchive != NULL); } catch (...) { MessageBox("Error: Unable to read from the file"); pFile->Close(); delete pFile; pFile = 0; return; } Serialize(\*pArchive); UpdateData(FALSE); delete pArchive; pArchive = 0; pFile->Close(); delete pFile; pFile = 0; }
}
Please, help me -Janetta
-
Father's DayRight now I would need that 'aww, sweet' emoticon! Happy father's day to you and all other fathers here! -Janetta
-
The Myers-Briggs Personality Test!According to this test I'm ENFJ. Percentage of E was quite high and others were bit lower. I think this is something like I've had before. You have to remember that this is only one test and quite short for a personality test. Another thing that affects the result is that it is done by you yourself and sometimes it's very hard to rate yourself. And there's nothing bad being an introvert:). -Janetta
-
lmao @ Anna KournikovaJörgen Sigvardsson wrote: Bring out the lions and we'll tattoo them with three crowns.. You can try... :) Welcome to Finland next spring!
-
lmao @ Anna KournikovaJörgen Sigvardsson wrote: Ice hockey is a game which you can trust. Exactly! Especially Finland against Sweden:) -Janetta
-
Human RightsMichael P Butler wrote: You should have the right to do what you like as long as exercising your rights doesn't intefer with the rights of others. I agree to some point. However there are exceptions. This summer one teacher didn't like his/hers (don't remember which one) neighbours sun bathing topless in their own yard. The teacher took some photographs for proof but got sued him-/herself for interfering the neighbours domestic peace. -Janetta
-
CodeProject's most helpfulDavid Lohmann, Christian Graus, Tomasz Sowinski, Joaquín M López Muñoz ,to name a few, have helped me a lot many times. Thank you guys (and all those other helpful people I might have forgotten:)) very much! -Janetta
-
how to deal with this issue in other countries...I guess we are pretty lucky here in Finland. First of all we don't have any tuition fees, thanks to the high taxes. We have to pay "students' union fee" which is about 70e/year and it includes student health care and so on. Then we get student aid from the government which barely is enough to eat and pay your rent. Almost all the students work during summer, some work all year round and many get some money from their parents. You can also get pretty cheap students loan. The system is made like this so that everyone has a change of studying. I think it works well. -Janetta
-
How to override a function defined and declared in a library?I got it already.
-
How to override a function defined and declared in a library?Hi, I need to override a function that is declared and defined in a library I'm using. The function is just a plain function, not a member of a class. Also the library should use the new definition after overriding. How can I do this? -Janetta
-
Class Begins...I'm really waiting for to go back to uni next week even though my summer job was really great! There are still so many interesting courses to attend to. I've studied a couple of years and still have about couple of years left. Here in Finland there's no Bachelors degree if you study in University of Technology, but you have to study all the way to Masters degree. -Janetta
-
The Nerd Pride MovementWhat is the real definition of a nerd? I don't consider it as an insult. -Janetta
-
Disadvantages of being a programmerAlex E. wrote: 1. Health risks. Not only programmers spend a lot of time with computers. I guess that you'll have to use computer in almost all "modern" (and also in many traditional) professions. Alex E. wrote: 2. Volatile job market. Like others have said it's as volatile as any other profession. Alex E. wrote: 3. Negative opinion about programmers. Yeah, there's a stereotype of every profession. Doctors drink and smoke, male hairdressers are gay and so on. I haven't had any troubles finding a boyfriend (I'm engaged) and I guess that it wouldn't that hard to find a girlfriend either:). I really don't consider myself nerdy, asexual or socially inept. -Janetta
-
Ending thread and ReadFile is still trying to readDaniel Lohmann wrote: A better solution would be to use non-blocking file io (overlapped IO) and wait for the ReadFile() operation in a loop that calls MsgWaitForSingleObject() so outstanding messages are also processed. Unfortunately I can't do that, because I can't touch the code that is doing the reading. I'll use TerminateThread and keep my fingers crossed:) -Janetta
-
Ending thread and ReadFile is still trying to readWell, I desided to use TerminateThread, even though it is no-no. In this case it can't really make any damage. -Janetta
-
Ending thread and ReadFile is still trying to readActually the first option was what I thought I was doing...:-O I'm trying to make it possible to abort that lengthy operation. A message is posted to the worker thread and I thought that it would call a method of the worker thread that calls AfxEndThread. Posting the message succeedes, but the EndThread method is never called. Is this because the thread is busy performing that lengthy operation and when it is done, the thread is ended? What would be a better way to do this? -Janetta