May 03, 2005
> You choose to ignore my post :-)
> Of course that's ok.

No, I guess I just missed it.

> It did probably upset you.

Not so. What an odd thing to say. Why would you think that?

> Because the question in it was two fold:
>
> 1) i really wanted to know how you did it.
>    But as you ignored my post, i decided to do
>    some research by myself.

Just specifying main as the entry point, and -nodefaultlib

> 2) I think the merit for the small size exe
>    must be credited the the fact that the linker
>    do 50% of the job and the other 50% comes
>    from the fact that the called functions are
>    available in kernel32.dll. And i was asking you
>    to illustrate that to me.
>
> So in order to come clean with you, i do offer
> my apology, now, without conditions.

Now you're freaking me out! :-)

Nothing to apologise for. No problem whatsoever at this end.

> If i dont come clean with you, i am, at least
> clean with BOB.
>
> >>>> That compiles and builds to 2048 bytes with VC++ 7.1.
>
> I have done some test with VC++ 6.0, and the best i got
> was 800 bytes with the following program:
>
> #include <windows.h>
> #ifdef __DMC__
> int _acrtused_con;
> #endif
>
> int main( )
> {
>   static char buf[21];
>   wsprintf(buf,"pid: %d",(int)GetCurrentProcessId());
>   WriteFile( GetStdHandle(STD_OUTPUT_HANDLE),
>     buf, lstrlen(buf), NULL, NULL );
>   return 0;
> }
>
> but now, we must use two dll: user32 and kernel32.

800 bytes sounds about right.

> The good news, the same result, can almost be be achieved with DMC.
>
> The following command:
>   dmc -NL -o+all  10.c /L/entry:_main
> do produce a 3200 bytes exe.

Interesting. I've never tried this with DMC. Nice one. :)



1 2
Next ›   Last »