Positioning image in C++

Greetings,

I am trying to insert an image into an xls document using code I resolved from APIMate. The problem is if the image size changes then the image gets rescaled improperly. I want to fix the position and size for various logos that the report can use.

I've seen examples of Delphi on the forum but none for C++. I originally used the following:
TExcelFile *xls = new TXlsFile(true);
ImgProps->Anchor = TClientAnchor::Create(TFlxAnchorType::MoveAndDontResize, 1, 0, 1, 0, 6, 0, 3, 0);

But after looking at other answers I figure I need to use the one the following:
TClientAnchor(TFlxAnchorType, Int32, Int32, Int32, Int32, Int32, Int32, IRowColSize)

The problem is I'm not sure how to pass the IRowColSize parameter. In the doc it states that " XlsFile implements this interface, so you can pass an XlsFile object anytime you need to pass this interface" for it but if I use the following code it tells me that it can't find a match for the function call.

ImgProps->Anchor = TClientAnchor::Create(TFlxAnchorType::MoveAndDontResize, 1, 0, 1, 6, 0, 3, 0, xls);

It's treating the "xls" as type TExcelFile * and not allowing it to compile.

Any thoughts?

Thanks

Thanks for reporting this. There are 2 issues here:

1)You should deference the pointer. The call should be:
ImgProps->Anchor = TClientAnchor::Create(TFlxAnchorType::MoveAndDontResize, 1, 0, 1, 6, 0, 3, 0, *xls);

2)We should add a GUID to the interface. Without GUID, C++ builder can't use them.

I'll be adding a GUID later today, please email me to adrian@tmssoftware.com with your registration data, and I'll send you an updated version with a GUID in the interface.