- Joined
- 5/28/23
- Messages
- 10
- Points
- 3
I'm learning the book "Financial Instrument Pricing Using C++, 2nd Edition" for excel interaction.
My environment: Visual Studio 2017 + Excel Office 365
Following exising discussion, my test code below
I got below error after try and fail many times. Above code is already a summary of previous discussion.
It seems DataPrivacyOption is a new feature of Office, so I only had error related to those. How can I exclude it?
I already try exclude ("Ifont","IPicture","ISensitivityLabelPolicy")
My environment: Visual Studio 2017 + Excel Office 365
Following exising discussion, my test code below
C++:
#include <iostream>
#include "atlsafe.h"
#import "D:\project_CPP\C++_study\instrument_pricing\lib\mso.dll" rename("DocumentProperties", "DocumentPropertiesXL") rename("RGB", "RGBXL")
#import "D:\project_CPP\C++_study\instrument_pricing\lib\VBE6EXT.OLB" rename("RGB", "RBGXL")
using namespace Office;
#import "C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE" rename("DialogBox", "DialogBoxXL") rename("RGB", "RGBXL") rename("DocumentProperties", "DocumentPropertiesXL") rename("ReplaceText", "ReplaceTextXL") rename("CopyFile", "CopyFileXL") exclude ("Ifont","IPicture","ISensitivityLabelPolicy") no_dual_interfaces no_function_mapping
int main()
{
std::cout << "Hello World!\n";
system("pause");
}
I got below error after try and fail many times. Above code is already a summary of previous discussion.
It seems DataPrivacyOption is a new feature of Office, so I only had error related to those. How can I exclude it?
I already try exclude ("Ifont","IPicture","ISensitivityLabelPolicy")
C++:
1>testExcel.cpp
1>d:\project_cpp\c++_study\testexcel\testexcel\testexcel.cpp(9): warning C4192: automatically excluding 'IFont' while importing type library 'C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7353): error C2039: 'SensitivityLabelPolicyPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7353): error C3646: 'SensitivityLabelPolicy': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7353): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7759): error C2039: 'DataPrivacyOptionsPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7759): error C3646: 'DataPrivacyOptions': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7759): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8721): error C2039: 'DataPrivacyOptionsPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8721): error C3646: 'GetDataPrivacyOptions': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8721): error C2059: syntax error: '('
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8721): error C2238: unexpected token(s) preceding ';'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8725): error C2039: 'SensitivityLabelPolicyPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8725): error C3646: 'GetSensitivityLabelPolicy': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8725): error C2059: syntax error: '('
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(8725): error C2238: unexpected token(s) preceding ';'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(10565): error C2039: 'ISensitivityLabelPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(10565): error C3646: 'SensitivityLabel': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(10565): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(11171): error C2039: 'ISensitivityLabelPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(11171): error C3646: 'GetSensitivityLabel': unknown override specifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(11171): error C2059: syntax error: '('
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(11171): error C2238: unexpected token(s) preceding ';'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4912): error C2039: 'DataPrivacyOptionsPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4912): error C2039: 'GetDataPrivacyOptions': is not a member of 'Excel::_Application'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7264): note: see declaration of 'Excel::_Application'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4912): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4912): error C2146: syntax error: missing ';' before identifier 'GetDataPrivacyOptions'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4913): error C2039: 'DataPrivacyOptions': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4913): error C2143: syntax error: missing ';' before '*'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4913): error C2079: 'DataPrivacyOptions' uses undefined struct 'Excel::GetDataPrivacyOptions::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4913): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4914): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4914): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4915): error C2027: use of undefined type 'Excel::GetDataPrivacyOptions::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4913): note: see declaration of 'Excel::GetDataPrivacyOptions::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4915): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4915): warning C4508: 'Excel::GetDataPrivacyOptions': function should return a value; 'void' return type assumed
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4916): error C2617: 'Excel::GetDataPrivacyOptions': inconsistent return statement
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4912): note: see declaration of 'Excel::GetDataPrivacyOptions'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4929): error C2039: 'SensitivityLabelPolicyPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4929): error C2039: 'GetSensitivityLabelPolicy': is not a member of 'Excel::_Application'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(7264): note: see declaration of 'Excel::_Application'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4929): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4929): error C2146: syntax error: missing ';' before identifier 'GetSensitivityLabelPolicy'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4930): error C2039: 'SensitivityLabelPolicy': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4930): error C2143: syntax error: missing ';' before '*'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4930): error C2079: 'SensitivityLabelPolicy' uses undefined struct 'Excel::GetSensitivityLabelPolicy::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4930): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4931): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4931): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4932): error C2027: use of undefined type 'Excel::GetSensitivityLabelPolicy::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4930): note: see declaration of 'Excel::GetSensitivityLabelPolicy::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4932): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4932): warning C4508: 'Excel::GetSensitivityLabelPolicy': function should return a value; 'void' return type assumed
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4933): error C2617: 'Excel::GetSensitivityLabelPolicy': inconsistent return statement
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(4929): note: see declaration of 'Excel::GetSensitivityLabelPolicy'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9084): error C2039: 'ISensitivityLabelPtr': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9084): error C2039: 'GetSensitivityLabel': is not a member of 'Excel::_Workbook'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tlh(10330): note: see declaration of 'Excel::_Workbook'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9084): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9084): error C2146: syntax error: missing ';' before identifier 'GetSensitivityLabel'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9085): error C2039: 'ISensitivityLabel': is not a member of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\mso.tlh(13): note: see declaration of 'Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9085): error C2143: syntax error: missing ';' before '*'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9085): error C2079: 'ISensitivityLabel' uses undefined struct 'Excel::GetSensitivityLabel::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9085): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9086): error C2355: 'this': can only be referenced inside non-static member functions or non-static data member initializers
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9086): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9087): error C2027: use of undefined type 'Excel::GetSensitivityLabel::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9085): note: see declaration of 'Excel::GetSensitivityLabel::Office'
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9087): error C2065: '_result': undeclared identifier
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9087): warning C4508: 'Excel::GetSensitivityLabel': function should return a value; 'void' return type assumed
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9088): error C2617: 'Excel::GetSensitivityLabel': inconsistent return statement
1>d:\project_cpp\c++_study\testexcel\testexcel\debug\excel.tli(9084): note: see declaration of 'Excel::GetSensitivityLabel'
1>Done building project "testExcel.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========