Compiling a windows.exe against cygwin1.dll ?

Reini Urban rurban@x-ray.at
Mon Oct 25 16:10:00 GMT 2004


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.

Good idea btw. No need for another service, while we already have a 
scheduler.

> 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.

> 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