Читал статьи на сайте про Office & MFС, но как-то не вышло сделать тоже самое в сабжевой среде.
Выполнял следующие шаги, описанные на
http://support.microsoft.com/kb/q178749/
1. Project -> Add Class
2. MFC Class from TypeLib
3. Либо из Registry(Microsoft Excel 11.0 Type Library) либо прямо из файла
4. Добавляю один класс Application (Переименовываю в _Application).
5.
#include "_Application.h"
6. И, не создав ни единого объекта, получаю мнооооого ошибок по генерируемому файлу Debug\excel.tlh:
warning C4278: 'RGB': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'RGB': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4192: automatically excluding 'IFont' while importing type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE'
warning C4192: automatically excluding 'IPicture' while importing type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE'
warning C4278: 'DialogBox': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'CopyFile': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'ReplaceText': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'ReplaceText': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'RGB': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'RGB': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'CopyFile': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
warning C4278: 'DialogBox': identifier in type library 'E:\\knell\\dev\\cpp\\AmwayViewer\\EXCEL.EXE' is already a macro; use the 'rename' qualifier
error C2371: 'FontPtr' : redefinition; different basic types
d:\program files\microsoft visual studio 8\vc\include\comdef.h(312) : see declaration of 'FontPtr'
error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int)' : invalid operand for __uuidof
error C2923: '_com_IIID' : 'Rectangle' is not a valid template type argument for parameter '_Interface'
d:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(3514) : see declaration of 'Rectangle'
error C3203: '_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type
error C2786: 'BOOL (__stdcall *)(HDC,int,int,int,int,int,int,int,int)' : invalid operand for __uuidof
error C2923: '_com_IIID' : 'Arc' is not a valid template type argument for parameter '_Interface'
d:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(2765) : see declaration of 'Arc'
'_com_IIID' : unspecialized class template can't be used as a template argument for template parameter '_IIID', expected a real type
'PicturePtr' : redefinition; different basic types
d:\program files\microsoft visual studio 8\vc\include\comdef.h(326) : see declaration of 'PicturePtr'
error C2504: '_IMsoDispObj' : base class undefined
error C2504: '_IMsoDispObj' : base class undefined
error C2504: '_IMsoDispObj' : base class undefined
error C2146: syntax error : missing ';' before identifier 'GetRGB'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
warning C4183: 'GetRGB': missing return type; assumed to be a member function returning 'int'
error C2061: syntax error : identifier 'MsoRGBType'
error C2061: syntax error : identifier 'MsoRGBType'
error C2061: syntax error : identifier 'MsoRGBType'
error C2504: '_IMsoDispObj' : base class undefined
error C2146: syntax error : missing ';' before identifier 'GetTransparencyColor'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
и так далее, более 100 ошибок...
Как побороть??