WIDL 'import' question

Rob Shearman robertshearman at gmail.com
Mon Jan 12 07:17:18 CST 2009


2009/1/11 Nikolay Sivov <bunglehead at gmail.com>:
> Hi, I've a small question on using 'import' in .idl. Sorry if it's too
> dummy, it's my first try to use widl.
> Trying to get commoncontrols.idl port compile on Wine I've got the
> following problems -
> this file contains struct definitions already defined in commctrl.h.
>
> Adding
>
>    import "commctrl.h"
>
> and removing after that all conflict definitions from commoncontrols.idl
> caused for me
>
> ../tools/widl/widl -I. -I. -I../include -I../include    -h -H
> commoncontrols.h commoncontrols.idl
> ./prsht.h:39: error: syntax error, unexpected '{'
> make[1]: *** [commoncontrols.h] Error 1
> make[1]: Leaving directory `/home/mrlarch/wine/include'
> make: *** [include] Error 2
>
> showing that prsht.h isn't processed properly here
>
> 39    static const WCHAR WC_PROPSHEETW[] = { 'S','y','s',
> 40      'P','r','o','p','e','r','t','y','S','h','e','e','t',0 };
>
> How could I get over that?

The IDL syntax that widl implements includes a subset of the C syntax,
however it is not practical to support the full C syntax (in
particular inline functions) and in this case widl doesn't like the
array initialiser. MIDL probably also suffers from similar limitations
and you'll see "#ifndef MIDL_PASS" in PSDK header files to work around
these sorts of issues. If you really have to treat commctrl.h as an
IDL file, you'll need to #ifdef out problem statements.

-- 
Rob Shearman



More information about the wine-devel mailing list