RE: Suppressing command window
On Mon, 2006-11-27 at 03:32 -0800, Sai Korada wrote: > May be I was not clear in explaining my problem. I have used the > -mwindows, which essentially suppresses all the debugging info(may be my > printfs). But my requirement is different > > I've packaged the application along with the required GTK dlls in a zip > file. > > Created a batch file, which, appends the current gtk\bin path to local > path and then launch the application. > > And the console window, which was opened by the batch file will be > visible till closed explicitly. > > My requirement here is either I shall be in a position to set the path > through program, hence avoid the .bat requirement or automatically close > the console was the application is launched. I use this utility to launch batch files and it hides the console window: http://www.msfn.org/board/index.php?act=ST&f=70&t=49184 . It is called RunHiddenConsole.exe Michael > > I tried using getenv() and putenv(), but it is not working as expected. > > What's the best way to distribute GTK+ application without batch file. > > Thanks and Regards > Laxmi > > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tor Lillqvist > Sent: Friday, November 24, 2006 5:57 PM > To: gtk-app-devel-list@gnome.org > Subject: Re: Suppressing command window > > Sai Korada writes: > > I'm developing an application with GTK+ and created a batch file to > set > > the path, launch the application with command line arguments. > > ... presumably on Windows? > > > Even after launching the application the command window still > > appears, which is by default. My requirement is, once the > > application is launched, is there a way to suppress the command > > window. > > The correct term is console window. > > Link the executable with the flag -mwindows (if using the GNU linker) > or /subsystem:windows (if using the Microsoft linker). > > If you use the Microsoft linker this also means, I think, your app > should have a WinMain() instead of main(). > > (This is nothing GTK+-specific, but basic Windows programming stuff.) > > --tml > > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Suppressing command window
Thanks for your suggestions Jim, getenv(), putenv() are returning success as such. But when the application is being loaded immediately it will through gtk error, and closes the application. The same command, prepending (./GTK/bin;) to the current path works fine and the application launches successfully. I've never tried statically linking the application with GTK libraries and have to try it out. It's true that Xilinx ISE tools use QT, our team is developing supporting applications for FPGAs. As each QT license costs a higher price, we had to choose other tools for Windows GUI development. And for everybodys surprise GTK+ came out to be a wonderful tool, though available for free of cost. Thanks and Regards Sai Laxmi ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Suppressing command window
Thank you very much Daniel, it worked. At the moment I've chosen the first option to demonstrate to the customer and later I'll try with other options too. Thanks a lot Regards Sai Laxmi ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Suppressing command window
On 11/27/06, Sai Korada <[EMAIL PROTECTED]> wrote: > I've packaged the application along with the required GTK dlls in a zip > file. > > Created a batch file, which, appends the current gtk\bin path to local > path and then launch the application. > > And the console window, which was opened by the batch file will be > visible till closed explicitly. > > My requirement here is either I shall be in a position to set the path > through program, hence avoid the .bat requirement or automatically close > the console was the application is launched. There are a number of ways to deal with this. The easiest will be to have your batch file call `start /B yourprogram.exe` after setting up the environment. There will be a console window opened when you launch the batch file and then immediately closed. Another relatively easy way is to use an Application Path and then you can simply run your executable. http://www.codeguru.com/Cpp/W-P/dll/article.php/c99 Another (probably more elegant) way of doing this is to have a launcher application that sets up your environment and does any other prep, then implicitly loads your application (using LoadLibraryEx) (this is what gaim and GIMP do). See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setdlldirectory.asp for more info. > I tried using getenv() and putenv(), but it is not working as expected. If you're trying to do this in an executable that depends on GTK+, then it is too late - unless all of the dependencies are satisfied the application cannot be run. -D ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Suppressing command window
> I tried using getenv() and putenv(), but it is not working as expected. That would be the right way. Could you give some more details on why it doesn't work? Or how it fails? Does setenv return -1? What is errno set to? > I've packaged the application along with the required GTK dlls in a zip file. If this is the only reason you're setting the path, a better option would be to statically link the app with GTK. As an aside, I thought Xilinx ISE tools use QT, so why the interest in GTK? -Jim ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Suppressing command window
May be I was not clear in explaining my problem. I have used the -mwindows, which essentially suppresses all the debugging info(may be my printfs). But my requirement is different I've packaged the application along with the required GTK dlls in a zip file. Created a batch file, which, appends the current gtk\bin path to local path and then launch the application. And the console window, which was opened by the batch file will be visible till closed explicitly. My requirement here is either I shall be in a position to set the path through program, hence avoid the .bat requirement or automatically close the console was the application is launched. I tried using getenv() and putenv(), but it is not working as expected. What's the best way to distribute GTK+ application without batch file. Thanks and Regards Laxmi -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tor Lillqvist Sent: Friday, November 24, 2006 5:57 PM To: gtk-app-devel-list@gnome.org Subject: Re: Suppressing command window Sai Korada writes: > I'm developing an application with GTK+ and created a batch file to set > the path, launch the application with command line arguments. ... presumably on Windows? > Even after launching the application the command window still > appears, which is by default. My requirement is, once the > application is launched, is there a way to suppress the command > window. The correct term is console window. Link the executable with the flag -mwindows (if using the GNU linker) or /subsystem:windows (if using the Microsoft linker). If you use the Microsoft linker this also means, I think, your app should have a WinMain() instead of main(). (This is nothing GTK+-specific, but basic Windows programming stuff.) --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Suppressing command window
Sai Korada writes: > I'm developing an application with GTK+ and created a batch file to set > the path, launch the application with command line arguments. ... presumably on Windows? > Even after launching the application the command window still > appears, which is by default. My requirement is, once the > application is launched, is there a way to suppress the command > window. The correct term is console window. Link the executable with the flag -mwindows (if using the GNU linker) or /subsystem:windows (if using the Microsoft linker). If you use the Microsoft linker this also means, I think, your app should have a WinMain() instead of main(). (This is nothing GTK+-specific, but basic Windows programming stuff.) --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list