title: Chromium Embedded Framework (CEF) - Call_back is not called
body: <p>Please tell me,</p>
  <p>I have simplified the selfsimple example to a minimal amount of code: this code successfully creates a browser window and opens the specified page:</p>
  <p>1.int main()</p>
  <p>2.class my_SimpleApp</p>
  <p>3.class my_work_handle</p>
  <pre><code>int main()
  {
  //-------------------------------------------------------------------------
  HINSTANCE hInstance = GetModuleHandleA(NULL);
  CefMainArgs args(hInstance);
  int ec = CefExecuteProcess(args, nullptr, nullptr);
  
  if (ec &gt;= 0)
  {
     return ec;
  }
  
  CefSettings settings;
  settings = { 0 };
  //-------------------------------------------------------------------------
  
  
  CefRefPtr&lt;my_SimpleApp&gt; my_app;     
  my_app = new my_SimpleApp[1];
  
  CefInitialize(args, settings, my_app.get(), nullptr);
  
  
  //-------------------------------------------------------------------------
  CefRunMessageLoop();           
  CefShutdown();
  //-------------------------------------------------------------------------
  }
  </code></pre>
  <ul>
  <li></li>
  </ul>
  <pre><code>class my_SimpleApp : public CefApp, public CefBrowserProcessHandler
  {
  
  public:
  
     CefRefPtr&lt;CefBrowserProcessHandler&gt; GetBrowserProcessHandler() override
     {
        return this;
     }
  
  
     void OnContextInitialized()
     {
        std::cout &lt;&lt; &quot;OnContextInitialized&quot; &lt;&lt; std::endl;
  
        CEF_REQUIRE_UI_THREAD();
  
        CefBrowserSettings browser_settings;
        std::string url = &quot;http://www.google.com&quot;;
  
        CefWindowInfo window_info;
        window_info.SetAsPopup(nullptr, &quot;cefsimple&quot;);
  
        CefRefPtr&lt;my_work_handler&gt; my_work_handler_;
        my_work_handler_ = new my_work_handler[1];
  
        CefBrowserHost::CreateBrowser(window_info, my_work_handler_, url, browser_settings, nullptr, nullptr);
     }
  
  
  private:
     IMPLEMENT_REFCOUNTING(my_SimpleApp);
  };
  </code></pre>
  <ul>
  <li></li>
  </ul>
  <pre><code>class my_work_handler : public CefApp, public CefLifeSpanHandler, public CefClient
  {
  
  public:
  
     void OnAfterCreated(CefRefPtr&lt;CefBrowser&gt;my_CefRefPtr) override
     {
        std::cout &lt;&lt; &quot;OnAfterCreated&quot; &lt;&lt; std::endl;
     }
  
  
      bool DoClose(CefRefPtr&lt;CefBrowser&gt;my_CefRefPtr) override
     {
         std::cout &lt;&lt; &quot;DoClose&quot; &lt;&lt; std::endl;
         return false;  //at the moment, it doesn't matter what returns
     }
  
  
      void OnBeforeClose(CefRefPtr&lt;CefBrowser&gt;my_CefRefPtr) override
     {
         std::cout &lt;&lt; &quot;OnBeforeClose&quot; &lt;&lt; std::endl;
         CefQuitMessageLoop();   
      }
  
  
  private:
     IMPLEMENT_REFCOUNTING(my_work_handler);
  };
  </code></pre>
  <p>This code is executed successfully, a browser window is created and opens google.com .
  But I can't understand why the console doesn't display the message ---&gt; &quot;OnAfterCreated&quot;</p>
  <p>If i run the cefsimple example, it is output there, but in my case, for some reason not.
  I can 't figure out what the reason is ?</p>
  <p>PS: and when closing the browser window - also not output - &quot;DoClose&quot; and &quot;OnBeforeClose&quot;</p>