<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16722"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana>The difference between console mode and gui mode on visual
studio is that console mode starts the "main" function and that the GUI mode
starts the "WinMain" function, see</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana>Main: <A
href="http://msdn.microsoft.com/en-us/library/acy3edy3(VS.71).aspx">http://msdn.microsoft.com/en-us/library/acy3edy3(VS.71).aspx</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana>WinMain: <A
href="http://msdn.microsoft.com/en-us/library/ms633559(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/ms633559(v=vs.85).aspx</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana>As the name implies, main is more platform independent and
is known on Windows, Unix, Linux etc. WinMain is only known by Windows. Qt is
platform independent and also runs on Linux so WinMain is for Qt
bad.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana>But you could try to write your Qt conde into a WinMain
function i have not tested it but it should work, here the
signature</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><PRE>int CALLBACK WinMain(
__in HINSTANCE hInstance,
__in HINSTANCE hPrevInstance,
__in LPSTR lpCmdLine,
__in int nCmdShow
);
</PRE></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=036544413-27042011><FONT color=#0000ff
size=2 face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT size=2 face=Tahoma><B>Von:</B> G G
[mailto:greenlander1986@gmail.com] <BR><B>Gesendet:</B> Mittwoch, 27. April 2011
13:13<BR><B>An:</B> Lodron, Gerald<BR><B>Cc:</B>
(vtkusers@vtk.org)<BR><B>Betreff:</B> Re: [vtkusers] QT + VKT + ITK +
VS2008<BR></FONT><BR></DIV>
<DIV></DIV>Thank you very much, I will try it :) <BR>Do you know some article
about it? I wrote some thesis and it would be nice, if I have some reference for
it... <BR><BR>
<DIV class=gmail_quote>2011/4/27 Lodron, Gerald <SPAN dir=ltr><<A
href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Verdana>Qt runs
only in console mode, if you want to hide console you can write a bat file
which starts the exe like this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Verdana>start
MyPropgram.exe</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2
face=Verdana></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Verdana>Then the
program does not wait for the return value of the MyProgram.exe
console</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face=Verdana>best
regards</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de align=left>
<HR>
<FONT size=2 face=Tahoma><B>Von:</B> <A href="mailto:vtkusers-bounces@vtk.org"
target=_blank>vtkusers-bounces@vtk.org</A> [mailto:<A
href="mailto:vtkusers-bounces@vtk.org"
target=_blank>vtkusers-bounces@vtk.org</A>] <B>Im Auftrag von </B>G
G<BR><B>Gesendet:</B> Mittwoch, 27. April 2011 12:57<BR><B>An:</B> <A
href="mailto:vtkusers@vtk.org"
target=_blank>vtkusers@vtk.org</A><BR><B>Betreff:</B> [vtkusers] QT + VKT +
ITK + VS2008<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV></DIV>Hi I have some project with QT+VTK+ITK and I compile it in Visual
Studio 2008. I create solution with CMake. It works fine. But I compile it and
run. When I run it, I have GUI window and console window. So I have question.
How to disable console window? <BR><BR>I think, that it is because of CMake,
but I dont know very well. <BR>I tried to used this <BR><A
href="http://www.qtforum.org/article/18473/tutorial-for-using-qt-with-vtk.html"
target=_blank>http://www.qtforum.org/article/18473/tutorial-for-using-qt-with-vtk.html</A><BR>But
when I tried to compile it, it gave me many errors... <BR>Do you know some
complete progress, how to compile it? <BR>Or how to disable console
window?<BR><BR>I dont have console window because of it get me qWarning
<BR><BR>QObject::killTimers: timers cannot be stopped from another
thread<BR><BR>when I exit application from console window. <BR>When I exit
application from GUI console window freeze :(<BR><BR>Thank you all for
help<BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>