'Failed to create an instance of a SAP2000 using c++

I am trying to customize the SAP2000 V14 and I am stuck at the very beginning of the process. After importing the .tlb file into the c++ environment, it seems that some features included in the .tlb file are missing or badly imported. to create an instance of SAP2000 I am using smart pointer CComQIPtr in this way: "CComQIPtr SAP2000::SapObject pSapObject" But I get the following error: "error C2027: use of undefined type 'SAP2000::SapObject'" but as it can be seen in the attached picture, it is most definitely has been defined in the SAP2000 Library! Any Help is highly appreciated and many thanks in advance!

the picture of the object browser

here you can find the code I am using:

#include "stdafx.h"
#include <sstream>
#include <iomanip>
#include <math.h>

#import "Sap2000.tlb" 
high_property_prefixes("Get_","Put_","PutRef_") raw_native_types 
rename("min", "sap2000v12_min") rename("SetProp", 
"sap2000v12_SetProp") rename("GetProp", "sap2000v12_GetProp") 
rename("Yield", "sap2000v12_Yield")

using namespace std;

bool CheckHRESULT(HRESULT hRes, const wchar_t* msg)
{
  if (FAILED(hRes)) {
    MessageBox(0, msg, L"ERROR!", MB_SETFOREGROUND);
    return (false);

  }
  return (true);
}

int _tmain(int argc, _TCHAR* argv[])
{
  HRESULT hRes = 0;
  int res = 0;
  hRes = CoInitialize(NULL);
  if (!CheckHRESULT(hRes, L"Error initializing COM subsystem!"))    
    return (hRes);
  CComQIPtr <SAP2000::SapObject> pSapObject;
  hRes = pSapObject.CoCreateInstance(__uuidof(SAP2000::SapObject), 
  NULL, CLSCTX_LOCAL_SERVER);
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source