Com Interop wrappers not being generated by TLB

Discussions about GdPicture.NET usage in non managed applications built in vb6, Delphi, vfp, MFC c++ etc...
Post Reply
User avatar
justcode
Posts: 26
Joined: Wed Jul 15, 2009 9:20 pm

Com Interop wrappers not being generated by TLB

Post by justcode » Thu Sep 01, 2011 7:58 pm

Hi,
I originally generated wrapper classes for my MFC/C++ VS2008 project from the TLB file with GDPicture.NET 8.0 Ultimate Version and they generated fine.

When you released 8.1 I regenerated the wrappers to find out that most of them were missing all the methods. Only CGdPicturePDF and CGdPictureImaging generated the correct wrappers classes. CThumbnailEx, CGdViewer and CBookmarksTree were missing all of their methods.

When I tried the 8.2 version that was just released, all the wrappers generated were empty (no methods or properties). Was the TLB for the later versions messed up? The compiler does not seem to be able to generate the methods for the COleDispatchDriver wrapper class.

This is what I get now with the 8.2 TLB file:

Code: Select all

class CGdPictureImaging : public COleDispatchDriver
{
public:
    CGdPictureImaging(){} // Calls COleDispatchDriver default constructor
    CGdPictureImaging(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
    CGdPictureImaging(const CGdPictureImaging& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

    // Attributes
public:
    // Operations
public:
    // _GdPictureImaging methods
public:
    // _GdPictureImaging properties
public:
};
when I use the 8.0 TLB I get a full wrapper generated by the compiler:

Code: Select all

class CGdPictureImaging : public COleDispatchDriver
{
public:
    CGdPictureImaging(){} // Calls COleDispatchDriver default constructor
    CGdPictureImaging(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
    CGdPictureImaging(const CGdPictureImaging& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

    // Attributes
public:
    // Operations
public:
    // _GdPictureImaging methods
public:
    long CreateAnchorTemplate(long ImageID, long PosLeft, long PosTop, long Width, long Height)
    {
        long result;
        static BYTE parms[] = VTS_I4 VTS_I4 VTS_I4 VTS_I4 VTS_I4 ;
        InvokeHelper(0x1, DISPATCH_METHOD, VT_I4, (void*)&result, parms, ImageID, PosLeft, PosTop, Width, Height);
        return result;
    }
    void DeleteAnchorTemplate(long AnchorTemplateID)
    {
        static BYTE parms[] = VTS_I4 ;
        InvokeHelper(0x2, DISPATCH_METHOD, VT_EMPTY, NULL, parms, AnchorTemplateID);
    }
 ....... (all the other member functions).......

    // _GdPictureImaging properties
public:
};
Can you check and make sure the TLB generate the correct definitions. I tried VS6, VS2003 and VS2008 and all three generate the same empty classes.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Com Interop wrappers not being generated by TLB

Post by Loïc » Fri Sep 02, 2011 8:55 am

Hi,

Could you let me know how you generate the wrapper with Visual Studio ?

i am not able to find such option in the environment.

Kind regards,

Loïc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Com Interop wrappers not being generated by TLB

Post by Loïc » Fri Sep 02, 2011 9:03 am

OK I've been able to generate the classes. I am investigating the issue now...

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Com Interop wrappers not being generated by TLB

Post by Loïc » Fri Sep 02, 2011 10:03 am

Hi,

This has been fixed. The next minor release will export correct COM interfaces in the TLB.

Kind regards,

Loïc

User avatar
justcode
Posts: 26
Joined: Wed Jul 15, 2009 9:20 pm

Re: Com Interop wrappers not being generated by TLB

Post by justcode » Fri Sep 02, 2011 2:14 pm

Thanks for the quick response, sorry I forgot to mention how I generated the wrappers but you figured it out.
For reference on the VS2008 compiler, I used the Project|Add Class, choose MFC Class From TypeLib, then browse and select the TLB file and select the interfaces I need from the list to generate the C++ wrappers.

Looking forward to the new release!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests