NO

Author Topic: Modified TypeLib Add-In  (Read 2118 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1640
Modified TypeLib Add-In
« 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
« Last Edit: June 11, 2016, 04:23:36 pm by TimoVJL »
May the source be with you

Offline JohnF

  • Member
  • *
  • Posts: 1114
    • http://www.johnfindlay.plus.com/
Re: Modified TypeLib Add-In
« Reply #1 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
« Last Edit: September 13, 2012, 07:36:39 am by JohnF »

Offline JohnF

  • Member
  • *
  • Posts: 1114
    • http://www.johnfindlay.plus.com/
Re: Modified TypeLib Add-In
« Reply #2 on: September 13, 2012, 01:58:54 pm »
Oh right, thanks. I've uploaded the second one to my web site.

John

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1640
Re: Modified TypeLib Add-In
« Reply #3 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;
« Last Edit: June 11, 2016, 04:23:19 pm by TimoVJL »
May the source be with you

Offline JohnF

  • Member
  • *
  • Posts: 1114
    • http://www.johnfindlay.plus.com/
Re: Modified TypeLib Add-In
« Reply #4 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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1640
Re: Modified TypeLib Add-In
« Reply #5 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.
« Last Edit: June 24, 2016, 03:03:43 pm by TimoVJL »
May the source be with you