I want to create a library to wrap Excel Automation and expose just some of its vast functionality. I'm using the #import mechanism to work with Excel's COM, so right now I have:
// EXCELAPP.H
#import "C:\\PathTo\\mso.dll" //...
#import "C:\\PathTo\\VBE6EXT.OLB" //...
#import "C:\\PathTo\\EXCEL.EXE" //...
class ExcelApp
{
public:
ExcelApp();
~ExcelApp();
void CloseExcel();
void ShowWindow();
void HideWindow();
// ...
private:
Excel::_ApplicationPtr m_app;
};
This is in a static library project, and I'm using it just fine from my program.
The thing is, I would like to "hide" from the users of the library how it is implemented. The implementation could change in the future. Also, having the imports in the .h file exposes all the COM interface to the users of the library and I don't want them (my future-self included) to abuse it.
So I thought of doing something like the PImpl idiom, but I would need to at least forward-declare m_app, and I have no idea how to do that.
So, is there any way to forward declare _com_ptr_t pointers like Excel::_ApplicationPtr? Or is there a better way to do what I'm trying to do?