[PATCH 2/4] comdlg32: Add stub implementation of the Common Item dialogs.

David Hedberg david.hedberg at gmail.com
Tue Mar 22 15:24:05 CDT 2011


On Mon, Mar 21, 2011 at 14:55, Nikolay Sivov <bunglehead at gmail.com> wrote:

>> +typedef struct FileDialogImpl {
>> +    IFileDialog2 IFileDialog2_iface;
>> +    IFileOpenDialog IFileOpenDialog_iface;
>> +    IFileSaveDialog IFileSaveDialog_iface;
>> +    LONG ref;
>> +} FileDialogImpl;
>
> Maybe it's better to use a union and enum type field here, if it can't be
> open and save at the same time.

At the moment I'm checking the vtbl pointers to determine which type
of dialog it is in QueryInterface, although this looked better using
the old COM coding style (no explicit check necessary).

Is using a union and an explicit type field preferred?

>> +
>> +    fdimpl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
>> sizeof(FileDialogImpl));
>> +    if(!fdimpl)
>> +        return E_OUTOFMEMORY;
>
> Zero initialization is useless here.

As mentioned above it's not completely useless currently, but I can
initialize them explicitly.

Thanks for the review.



More information about the wine-devel mailing list