Compiling a windows.exe against cygwin1.dll ?
Reini Urban
rurban@x-ray.at
Mon Oct 25 17:45:00 GMT 2004
Igor Pechtchanski schrieb:
> On Mon, 25 Oct 2004, Reini Urban wrote:
>
>
>>Wim Van Oudenhove schrieb:
>>
>>>I would have done that a long time ago if I knew how to use COM under
>>>GCC. The key purpose of this program is that it talks to the windows
>>>sceduler, so it uses:
>>>
>>>#include <mstask.h>
>>>CoInitialize()
>>>CoCreateInstance(CLSID_CTaskScheduler,...)
>>>CoTaskMemFree()
>>>
>>>And a whole bunch of functions related to them.
>>>
>>>Not exactly the most common functions in GCC afaik.
>>
>>COM works fine with gcc/w32api. The vtable layout was fixed some years
>>ago. Just for directx you'd need some stubs which are available
>>elsewhere.
>>
>>$ grep CoInitialize /usr/include/w32api/*
>>$ grep CTaskScheduler /usr/include/w32api/*
>>$ grep CTaskScheduler /usr/include/mingw/*
>>
>>This CLSID CLSID_CTaskScheduler is not in w32api and not in mingw.
>>So you have to find the raw CLSID string. I didn't find it in
>>oleview.exe or the registry, so you to find the CLSID elsewhere. in the
>>official headers it should be somewhere.
>
>
> You might also consider adding these to the w32api headers (guarded by
> suitable version number defines, of course). Send a patch to
> cygwin-patches, IIRC.
they don't want this garbage.
w32api doesn't have CLSID strings at all. mingw neither.
grep CLSID_ /usr/include/w32api/*.h or mingw
it is much easier to lookup these once and define it on your app,
similar to #include mstask.h.
at least that is the opinion on w32api AFAIK.
>>Good idea btw. No need for another service, while we already have a
>>scheduler.
>
> Yeah, but cron, AFAIK, has many more options than the Windows Task
> Scheduler. Of course, you may not need them all...
sure, but if he develops a cron which parses all the cron options
(env, when, what), and then passes that into the windows scheduler
instead of our own cron service, it will be effectively the same.
just the starter has to be a shell (bash or ash).
and some kind of impersonation for this shell. well, this could be tricky.
>>>It also uses some of the AFX CList, CMap, and CArray templates. I'm sure
>>>someone has written equivalents for them in ansi C somewhere, but all this
>>>sounds like too much work for the same purpose.
>>
>>Better avoid AFX templates and use easier STL templates instead.
>
> Not knowing much about the AFX templates, I wasn't sure if I should have
> recommended that.
A pain. and only useful for COM.
>>>The function it performs is available by default on a unix
>>>workstation, so I doubt that I'll ever need it for another operating
>>>system than windoze.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
More information about the Cygwin-talk
mailing list