Pelles C forum

Pelles C => Add-ins => Topic started by: TimoVJL on September 12, 2012, 04:14:46 pm

Title: Modified TypeLib Add-In
Post by: TimoVJL on September 12, 2012, 04:14:46 pm
Modified TypeLib Add-In.
I think that those IUnknown methods was at wrong place.
Code: [Select]
BufCat(pOut, _T("\t// IUnknown methods\n"));
BufCat(pOut, _T("\tSTDMETHOD(QueryInterface)(THIS,REFIID,void**);\n"));
BufCat(pOut, _T("\tSTDMETHOD_(ULONG,AddRef)(THIS);\n"));
BufCat(pOut, _T("\tSTDMETHOD_(ULONG,Release)(THIS);\n"));
if (fDispatch)
{
BufCat(pOut, _T("\t// IDispatch methods\n"));
BufCat(pOut, _T("\tSTDMETHOD(GetTypeInfoCount)(THIS,UINT*);\n"));
BufCat(pOut, _T("\tSTDMETHOD(GetTypeInfo)(THIS,UINT,LCID,ITypeInfo**);\n"));
BufCat(pOut, _T("\tSTDMETHOD(GetIDsOfNames)(THIS,REFIID,LPOLESTR*,UINT,LCID,DISPID*);\n"));
BufCat(pOut, _T("\tSTDMETHOD(Invoke)(THIS,DISPID,REFIID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);\n"));
}
BufCat(pOut, _T("\t// %ls methods\n"), pwszTypeName);
EDIT 20121129 Fixed THIS
Title: Re: Modified TypeLib Add-In
Post by: JohnF on September 12, 2012, 06:08:15 pm
You may be right, I'll check it out.

EDIT: It looks as if you are right, I've updated my web site with your update.

Thanks.

John
Title: Re: Modified TypeLib Add-In
Post by: JohnF on September 13, 2012, 01:58:54 pm
Oh right, thanks. I've uploaded the second one to my web site.

John
Title: Re: Modified TypeLib Add-In
Post by: TimoVJL on June 01, 2016, 09:03:38 pm
DumpTypeInfo()
 TKIND_ENUM TKIND_RECORD TKIND_UNION TKIND_ALIAS
If these types are written to Forward area, they are easier to find and edit/fix.
fix pOut -> &Fwd
Code: [Select]
                case TKIND_ENUM:
                    if (LookupName(bstrTypeName)) break;
                    if (bstrComment != NULL && *bstrComment != L'\0')
                        BufCat(&Fwd, L"\n/* %ls */\n", bstrComment);
                    else
                        BufCat(&Fwd, L"\n");
                    DumpEnumType(&Fwd, bstrTypeName, bstrTypeName, pTypeAttr, pITypeInfo);
                    break;

                case TKIND_RECORD:
                case TKIND_UNION:
                    if (LookupName(bstrTypeName)) break;
                    if (bstrComment != NULL && *bstrComment != L'\0')
                        BufCat(&Fwd, L"\n/* %ls */\n", bstrComment);
                    else
                        BufCat(&Fwd, L"\n");
                    DumpRecordType(&Fwd, bstrTypeName, bstrTypeName, pTypeAttr, pITypeInfo);
                    break;

                case TKIND_ALIAS:
                    if (bstrComment != NULL && *bstrComment != L'\0')
                        BufCat(&Fwd, L"\n/* %ls */\n", bstrComment);
                    else
                        BufCat(&Fwd, L"\n");
                    DumpAliasType(&Fwd, bstrTypeName, pTypeAttr, pITypeInfo);
                    TKindPrev = TKIND_ALIAS;
                    break;
Title: Re: Modified TypeLib Add-In
Post by: JohnF on June 02, 2016, 08:04:53 am
If you have updated the project send it to me and I'll update the web site.

John
Title: Re: Modified TypeLib Add-In
Post by: TimoVJL on June 05, 2016, 02:38:38 pm
Latest version for testing.
I someone finds errors, just let us know about them too.

EDIT 2016-06-24: fix for WTypeLibList2, in TKIND_DISPATCH , stupid mistake.