News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Modified TypeLib Add-In

Started by TimoVJL, September 12, 2012, 04:14:46 PM

Previous topic - Next topic

TimoVJL

Modified TypeLib Add-In.
I think that those IUnknown methods was at wrong place.
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
May the source be with you

JohnF

#1
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

JohnF

Oh right, thanks. I've uploaded the second one to my web site.

John

TimoVJL

#3
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
                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;
May the source be with you

JohnF

If you have updated the project send it to me and I'll update the web site.

John

TimoVJL

#5
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.
May the source be with you