December 11, 2024, 08:35:56 PM

News:

IWBasic runs in Windows 11!


Simple program brings up CMD screen and I don't know why

Started by billhsln, February 01, 2013, 09:39:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

This is a simple program to read multiple files and create an SQL update file based on the values in the file.  My question is, normally on CONSOLE programs it brings up a quick screen that I can read or write to, but this one actually brings up a CMD.EXE window along with the screen I can write to.  Just wondering why or what I am doing to get the CMD.EXE window to open.  I don't need or want it.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

Sounds like, if I'm reading you correctly, that when you run the program you attached that two black windows appear.
I don't get that.

If I compile with the CONSOLE EXE option then I have one black window and it has  CMD.EXE in the caption and the program print statements print to it.

If I compile with the WINDOWS EXE option then I have one black window and it has Update_DRAccount.exe in the caption and the program print statements print to it.

I never have two back windows.

Post a screen shot of your two screens you're getting at the same time.

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

February 01, 2013, 11:47:50 PM #2 Last Edit: February 01, 2013, 11:49:24 PM by billhsln
Here is what I see when I run the program.

I am running Windows 7 - 64bit.

Bill
When all else fails, get a bigger hammer.

LarryMc

I don't have the data files so I can't get that far.
Did you compile it as a CONSOLE EXE or a WINDOWS EXE?

1.swap and recompile and see if it makes any difference
2. comment out the print filename statement and see if that makes any difference
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

billhsln

Very strange.  Original compile I do is in CONSOLE mode and it gives me the 2 screens.  When I switch it to WINDOWS, it opens the one CONSOLE screen and works as I would expect it to when doing CONSOLE mode.  Then I switch back to CONSOLE and it gives me the 2 screens.

I modified the program to point to another subdirectory with TXT files in it.  You can use any subdirectory with text files.  It still gives me the 2 screens.

Attaching the most current version of the program.

Bill
When all else fails, get a bigger hammer.