1. Windows GUI prog: unexpected console window

I was a programmer in the 70's! Thanks!) I got an MleText, and tried to encrypt/decrypt some text files.

Finally all tests gave expected results! But with just ONE input file, during encryption, a black console window popped up in front of the Mle at about the 260th char, with a top line containing about 40 characters, as if I'd used a puts(1, {some random numbers}). But I couldn't find one.

Finally I used trace(1) to go through this part. I thought I'd left in some silly diagnostic. But the trace went through "sweetly". No clue about the console window, which still formed, as before, behind the trace.

Sorry if the answer's very obvious to experienced folk! Thanks for any tips!

- oldprog

new topic     » topic index » view message » categorize

2. Re: Windows GUI prog: unexpected console window

oldprog said...

I was a programmer in the 70's! Thanks!) I got an MleText, and tried to encrypt/decrypt some text files.

Finally all tests gave expected results! But with just ONE input file, during encryption, a black console window popped up in front of the Mle at about the 260th char, with a top line containing about 40 characters, as if I'd used a puts(1, {some random numbers}). But I couldn't find one.

Finally I used trace(1) to go through this part. I thought I'd left in some silly diagnostic. But the trace went through "sweetly". No clue about the console window, which still formed, as before, behind the trace.

Sorry if the answer's very obvious to experienced folk! Thanks for any tips!

- oldprog

Hi

Everyone here will try to help, but there's not enough detail here.

You were using an MleText widget - from which toolkit? Which eu version, which operating system? Does the program crash, or complete without crashing? Does the error always appear at the same point in the file that it's reading, in all files. Can you create, and post, the smallest possible program, and test files, that produce the same error, and post it here? How a bout a screen shot of the console window?

The more details you post, the more likely you are to get a meaningful response.

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Windows GUI prog: unexpected console window

I was using Judiths's win32lib IDE in windows 7 starter. The program gets "perfect" results now (until I've concocted another test, I expect Some other longer test files don't show it; it's not just about length.

The program EXW is about 16k and like many encryption progs it's a bit "crazy" and complex! I've not been able to create any simple example of this hitch. It's not an "error" really; the output continues to be OK, but it would annoy the user, and it reminds me that I don't know very much!

I'm obviously very inexperienced. I tried Windows 7 help for 'screen shot': NBG. Thw console window is blank except for the top line which shows about 40 crazy-looking chars.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Windows GUI prog: unexpected console window

Hi

To embed a screenshot

{{https://i.imgur.com/F2if02K.jpg}} 

Press PrtScr on your keyboard when the window you want to screenshot is upper most (note, you will get the full screen), open an image editor, paste as new image, save to your hard drive, upload it to an image sharing site (I use Imgur), get the link to the image (right click on the image and copy link location (not the link it gives you)), then paste it between curly braces as above, and Bob's your uncle!

Cheers

Chris

https://i.imgur.com/F2if02K.jpg

new topic     » goto parent     » topic index » view message » categorize

5. Re: Windows GUI prog: unexpected console window

Windows will open a console when anything - even just a space or a C/R - gets printed. I would search the source code for any ?, puts(), printf() or display() commands.

That would be my first step. Also, of course, check to see if any ex.err file was created.

EDIT: of course, the ? or puts() might be in the Win32lib source. Don't forget to search there also.

Last - and worst case - something (perhaps in the encryption algorithm) is corrupting memory in Windows.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Windows GUI prog: unexpected console window

SOLVED! I was advised to "close(STDOUT)" to get an ex.err with the line number. This worked. Daft error!

I'd intended a "puts(1, xxx & xxx)" to announce an exception, but, silly me, I'd been on another language. I'd absent-mindedly put a '+' instead of an '&'. (A string of "random" characters!) I think I've got it OK now!

Sorry, folks! Tnanks.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu