|
From: Ioannis V. <no...@ho...> - 2003-03-02 18:28:15
|
I sent an email some hours ago and i haven't seen it yet. Probably it wil=
l
arrive some weeks later, these things happen.=0D
=0D
It was:=0D
=0D
It's time for me to ask a question. I have been learning .NET lately an=
d
as=0D
a default main() for a managed application tmain() is provided. =0D
=0D
However this tmain() thing runs a console, so my GUI app was in front and=
a=0D
console was in the back. My guess is that tmain() is provided in an MS=0D
attempt to make the code as much unportable as possible (vendor lock in).=
=0D
=0D
=0D
To overcome this problem i saw a WinMain() from a Win32 app and i placed =
it=0D
to my code. I modified it until the compiler shuts up. Now i use it in th=
e=0D
style: =0D
=0D
=0D
int __stdcall WinMain() =0D
{ =0D
Application::Run(new CppForm); =0D
=0D
=0D
return 0; =0D
} =0D
=0D
=0D
and i get no warnings. =0D
=0D
=0D
I have the following curiosity questions: =0D
=0D
Is this definition of WinMain() Win32 valid? What __stdcall is supposed t=
o=0D
do? What are tmain(), _tmain(), in what they differ between each other an=
d=0D
how they differ from main()? tmain(), _tmain() are Win32 API functions or=
=0D
not? (=3Dthey are new to .NET). =0D
=0D
=0D
Thank you in advance. =0D
=0D
=0D
Ioannis Vranos =0D
=0D
* Programming pages: http://www.noicys.freeurl.com =0D
* Alternative URL: http://run.to/noicys=20
|
|
From: Ioannis V. <no...@ho...> - 2003-03-02 16:49:55
|
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.=0D
=0D
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).=
=0D
=0D
=0D
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 th=
e
style:=0D
=0D
=0D
int __stdcall WinMain()=0D
{=0D
Application::Run(new CppForm);=0D
=0D
=0D
return 0;=0D
}=0D
=0D
=0D
and i get no warnings.=0D
=0D
=0D
I have the following curiosity questions:=0D
=0D
Is this definition of WinMain() Win32 valid? What __stdcall is supposed t=
o
do? What are tmain(), _tmain(), in what they differ between each other an=
d
how they differ from main()? tmain(), _tmain() are Win32 API functions or
not? (=3Dthey are new to .NET).=0D
=0D
=0D
Thank you in advance.=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20
|
|
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 > |
|
From: Ioannis V. <no...@ho...> - 2003-03-02 21:32:13
|
-------Original Message-------=0D =0D From: Per Westermark=0D Date: =CA=F5=F1=E9=E1=EA=DE, 2 =CC=DC=F1=F4=E9=EF=F2 2003 11:14:56 =EC=EC= =0D To: Ioannis Vranos=0D Cc: Dev-C++ Mailing List=0D Subject: Re: [Dev-C++] WinMain()=0D =0D I haven't done a lot of work with Developer Studio .NET, so I can't say=0D about your problem with a console + GUI but anyway...=0D =0D The original main() only takes 8-bit characters as parameters, making it=0D unsuitable for unicode programs.=0D =0D To better support unicode, you now get a=0D int _tmain(int argc, _TCHAR* argv[]);=0D =0D where _tmain will conditionally compile to=0D int main(int argc,char* argv[]);=0D or=0D int wmain(int argc,wchar_t* argv[]);=0D depending on if you compile your program with _UNICODE defined.=0D =0D =0D =3D=3D> Ok got it. However there are both tmain() and _tmain(). Anyway i = do not care. They could do with a system extension of main taking int, wchar_t *= or whatever.=0D =0D =0D I can't say what difference it is between tmain() and _tmain(). I only=0D have a DevStudio 6.0 in front of me right now, and it only have the _tmai= n=0D declaration.=0D =0D Normally, it is a question of linker flags if the program expects to find= =0D a main() or a WinMain(), where main() is expected for console=0D apptiocations and WinMain() for GUI applications.=0D =0D =0D =3D=3D> In VC++ .NET all get compiled. You can compile a GUI with main().= The natural problem is that a console runs behind and the default for a manag= ed application is tmain(). Naturally managed can be also a console one so i = do not find it strange. The strange thing is that for GUI the only option available is Win32 project. Anyway i "stole" its WinMain and placed it in the managed project. The int __stdcall WinMain() is a valid signature for Win32? (just from curiosity).=0D =0D I have had a couple of DevStudio 6 projects goof up quite a lot when=0D letting DevStudio upgrade them to DevStudio.NET. A number of compiler and= =0D linker settings have become quite interesting :-)=0D =0D =0D =3D=3D> Concerning .NET it is really very convenient.=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: <cg...@wo...> - 2003-03-03 11:38:19
|
Sorry, no experience with NET, but I can answer to one or mmore questions: >I have the following curiosity questions: > > > >Is this definition of WinMain() Win32 valid? > > What __stdcall is supposed to >do? > It says that the procedure called is responsible of removing the parameters from the stack, cdecl, which is the standard in C, says it is the caller which does that. __stdcall is the form of the WINAPI C functions, in fact it is synonimoius of far __pascal, and synonimous of WINAPI. So it is valid. >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). > I don't know that, I only know they're not in my WINAPI reference. |
|
From: <cg...@wo...> - 2003-03-04 19:01:06
|
Someone knows about some site with good enough tutorials for programming in gas assembly? (AT&T syntax). I only found: Linux assembly: gas uses AT&T syntax instead the usual Intel from NASM, so let's learn NASM. And no word about gas. The only two sites I found with some info about it are not enough |