|
From: Per W. <pw...@ia...> - 2003-03-02 21:16:10
|
I haven't done a lot of work with Developer Studio .NET, so I can't say about your problem with a console + GUI but anyway... The original main() only takes 8-bit characters as parameters, making it unsuitable for unicode programs. To better support unicode, you now get a int _tmain(int argc, _TCHAR* argv[]); where _tmain will conditionally compile to int main(int argc,char* argv[]); or int wmain(int argc,wchar_t* argv[]); depending on if you compile your program with _UNICODE defined. I can't say what difference it is between tmain() and _tmain(). I only have a DevStudio 6.0 in front of me right now, and it only have the _tmain declaration. Normally, it is a question of linker flags if the program expects to find a main() or a WinMain(), where main() is expected for console apptiocations and WinMain() for GUI applications. I have had a couple of DevStudio 6 projects goof up quite a lot when letting DevStudio upgrade them to DevStudio.NET. A number of compiler and linker settings have become quite interesting :-) /Per W On Sun, 2 Mar 2003, Ioannis Vranos wrote: > It's time for me to ask a question. I have been learning .NET lately and as > a default main() for a managed application tmain() is provided. > > However this tmain() thing runs a console, so my GUI app was in front and a > console was in the back. My guess is that tmain() is provided in an MS > attempt to make the code as much unportable as possible (vendor lock in). > > > To overcome this problem i saw a WinMain() from a Win32 app and i placed it > to my code. I modified it until the compiler shuts up. Now i use it in the > style: > > > int __stdcall WinMain() > { > Application::Run(new CppForm); > > > return 0; > } > > > and i get no warnings. > > > I have the following curiosity questions: > > Is this definition of WinMain() Win32 valid? What __stdcall is supposed to > do? What are tmain(), _tmain(), in what they differ between each other and > how they differ from main()? tmain(), _tmain() are Win32 API functions or > not? (=they are new to .NET). > > > Thank you in advance. > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL: http://run.to/noicys > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |