Re: Console-based exe COM server
- From: "Remy Lebeau" <no.spam@xxxxxxxxxxx>
- Date: Wed, 14 Jan 2009 15:43:37 -0800
"Leo" <Leo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C0A15F4F-6F2B-4DED-8E49-91D62DB15278@xxxxxxxxxxxxxxxx
Is it possible to create a console-based exe COM server, as opposed
to a window-based one? Using ATL, if you use the "module" attribute
with a type of "exe" it generates the entry-point for WinMain, not main.
So? That is perfectly fine. Just because a project has a WinMain() entry
point does not mean it has to create any GUI windows. A console project is
still a normal Win32 process, just with a different type of GUI attached to
it.
Is there anything that I can do to ensure that my exe COM server is
console-based with a main entry point, and accepts input parameters
and prints messages to the console (and still registers via /regserver)?
A project with a WinMain() entry point can still receive command-line
parameters, and thus support the "/regserver" parameter. You would simply
have to call GetCommandLine(), and then either parse the string manually or
pass it to CommandLineToArgvW(). As for output, use MessageBox(), or
AllocConsole(), GetStdHandle(), and WriteConsole().
--
Remy Lebeau (TeamB)
.
- References:
- Console-based exe COM server
- From: Leo
- Console-based exe COM server
- Prev by Date: Re: how to properly modify an interface
- Next by Date: Re: Console-based exe COM server
- Previous by thread: Re: Console-based exe COM server
- Index(es):
Relevant Pages
|