Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CColosseumCtrl::OnShowWindow(BOOL bShow, UINT nStatus)
- {
- /* This method is called the instance the control is show to the user
- * What happens here is that we get the file name from m_server and convert it from
- * CString to char* and send it to the CIFCEngineInteract object to retrieve information
- * from the file and initialize the CIFCEngineInteract object.
- * We then initialize the m_width and m_height with the width and height of the control
- * sent with <OBJECT> tag in the html file.
- * After that we assign to m_hwndRenderWindow the handle of the window that we are going to draw
- * in because we are going to use to initialize the DirectX device module and initialize the device buffer .
- * Lastly we render the changes.
- */
- /** Trying the web service */
- std::ofstream f("C:\\temp.ifc");
- try {
- int limit = m_serviceConsumer.getLimit();
- std::string objectRequired = "IFCWINDOW";
- TRACE("Limit: %i", limit);
- std::string uuid = m_serviceConsumer.openSession(m_fileNumber);
- TRACE("UUID: %s", uuid.c_str());
- int offset = 0;
- bool notFinished = true;
- std::string returned = "";
- do {
- do {
- returned = m_serviceConsumer.getObject(uuid, objectRequired, offset);
- TRACE("%s", returned.c_str());
- f << returned;
- offset += returned.length();
- }while( returned.length() == limit);
- offset = 0;
- returned = m_serviceConsumer.getObject(uuid, objectRequired, offset);
- if(returned.length() <= 0)
- notFinished = false;
- else {
- TRACE("%s", returned.c_str());
- f << returned;
- }
- f.flush();
- }while( notFinished );
- m_serviceConsumer.closeSession(uuid);
- f.close();
- }catch(std::exception &e) {
- TRACE("%s", e.what());
- f.close();
- ASSERT(1==0);
- }
- if ( 0 == m_engineInteract->retrieveObjectGroups("C:\\temp.ifc"))//(m_server.GetBuffer(0))))
- m_engineInteract->enrichObjectGroups();
- else
- ASSERT(1==0);
- CRect rc;
- GetWindowRect(&rc);
- m_width = rc.Width();
- m_height = rc.Height();
- m_hwndRenderWindow = this->m_hWnd;
- initializeDevice();
- initializeDeviceBuffer();
- if(m_initialized)
- render();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement