Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.11 KB | None | 0 0
  1. void CColosseumCtrl::OnShowWindow(BOOL bShow, UINT nStatus)
  2. {
  3.     /* This method is called the instance the control is show to the user
  4.      * What happens here is that we get the file name from m_server and convert it from
  5.      * CString to char* and send it to the CIFCEngineInteract object to retrieve information
  6.      * from the file and initialize the CIFCEngineInteract object.
  7.      * We then initialize the m_width and m_height with the width and height of the control
  8.      * sent with <OBJECT> tag in the html file.
  9.      * After that we assign to m_hwndRenderWindow the handle of the window that we are going to draw
  10.      * in because we are going to use to initialize the DirectX device module and initialize the device buffer .
  11.      * Lastly we render the changes.
  12.      */
  13.     /** Trying the web service */
  14.     std::ofstream f("C:\\temp.ifc");
  15.     try {
  16.        
  17.         int limit = m_serviceConsumer.getLimit();
  18.         std::string objectRequired = "IFCWINDOW";
  19.         TRACE("Limit: %i", limit);
  20.         std::string uuid = m_serviceConsumer.openSession(m_fileNumber);
  21.         TRACE("UUID: %s", uuid.c_str());
  22.        
  23.         int offset = 0;
  24.         bool notFinished = true;
  25.         std::string returned = "";
  26.  
  27.         do {
  28.             do {
  29.                 returned = m_serviceConsumer.getObject(uuid, objectRequired, offset);
  30.                 TRACE("%s", returned.c_str());
  31.                 f << returned;
  32.                 offset += returned.length();
  33.             }while( returned.length() == limit);
  34.             offset = 0;
  35.             returned = m_serviceConsumer.getObject(uuid, objectRequired, offset);
  36.             if(returned.length() <= 0)
  37.                 notFinished = false;
  38.             else {
  39.                 TRACE("%s", returned.c_str());
  40.                 f << returned;
  41.             }
  42.             f.flush();
  43.         }while( notFinished );
  44.         m_serviceConsumer.closeSession(uuid);
  45.         f.close();
  46.  
  47.     }catch(std::exception &e) {
  48.         TRACE("%s", e.what());
  49.         f.close();
  50.         ASSERT(1==0);
  51.     }
  52.    
  53.     if ( 0 == m_engineInteract->retrieveObjectGroups("C:\\temp.ifc"))//(m_server.GetBuffer(0))))
  54.         m_engineInteract->enrichObjectGroups();
  55.     else   
  56.         ASSERT(1==0);
  57.    
  58.     CRect rc;
  59.     GetWindowRect(&rc);
  60.     m_width = rc.Width();
  61.     m_height = rc.Height();
  62.  
  63.     m_hwndRenderWindow = this->m_hWnd;
  64.     initializeDevice();
  65.     initializeDeviceBuffer();
  66.    
  67.     if(m_initialized)
  68.             render();      
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement