none
[ATL,C++,Outlook addin] problem with displaying atl dialog boxes in a guest virtualbox (with specific graphic drivers) RRS feed

  • Question

  • Hi,

    I have made an outlook addin with ATL,C++.In a windows 7 guest in virtualbox the two dialog boxes of my addin don't appear

    (refreshing problem with the graphic driver because they appear if I put an windows explorer above the dialog)

    my two dialog boxes are ATL dialog boxes (derivated from CDialogImpl)

    another user have the problem too but I don't know if he uses virtualbox or not.

    so is there any solution to this graphic problem ? (I have used visual studio 2013 community and  atl)

    Wednesday, April 5, 2017 8:42 AM

All replies

  • Does the same problem exist for a plain Win32 application using any of the DialogBox, DialogBoxIndirect, etc. methods to display a dialog?  If the problem recurs, then it's highly unlikely that its a coding issue.

    It would be helpful if you had another platform for testing.  Maybe a VMware vm, Hyper-V vm or even a real machine.

    If the problem is related to virtualbox and/or a driver in that virtual environment then you should pursue a solution with those software publishers.
    • Edited by RLWA32 Wednesday, April 5, 2017 10:45 AM
    Wednesday, April 5, 2017 10:12 AM
  • the problem doesn not exist in my windows host (other hard disk because I have a multiboot system),it is only under windows as virtualbox guest by me and for the user perhaps with a specific graphic driver.

    I use only two common atl dialog box derivated from CDialogImpl in my addin...

    Wednesday, April 5, 2017 11:47 AM
  • the problem doesn not exist in my windows host (other hard disk because I have a multiboot system),it is only under windows as virtualbox guest by me and for the user perhaps with a specific graphic driver.

    I use only two common atl dialog box derivated from CDialogImpl in my addin...


    This is not an Outlook development issue.  I suggest you pursue the issue with publishers of virtualbox and the specific driver.  Perhaps their support resources will contain your answer.
    Wednesday, April 5, 2017 11:58 AM
  • OK, thanks rlwa...
    Wednesday, April 5, 2017 12:26 PM
  • Did you make sure you are using the right HWND for the dialog's parent?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, April 5, 2017 2:37 PM
  • HI,dimitry, I have used modals dialog boxes so I have put : DoModal()

    so the HWND is active windows because of that :

    DoModal(
      HWND hWndParent = ::GetActiveWindow(), 
      LPARAM dwInitParam = NULL);
    


    Wednesday, April 5, 2017 3:38 PM
  • Is this on the main thread? Have you tried to use GetForegroundWindow?

    The right way would be to query Application.ActiveWibndows for IOleWindow and use IOleWindow::GetWindow().


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, April 5, 2017 4:09 PM
  • OK thanks dmitry, I have now made that :

     m_app->ActiveWindow(&act);
    IOleWindowPtr windowp = (IOleWindowPtr)(IDispatch*)act;
    windowp->GetWindow(&hwndp);
     
    		
    dlg.DoModal(hwndp);

    and now I will test it

    Thursday, April 6, 2017 7:16 AM
  • Hi Dmitry,is it not possible to get the explorer window handle instead of the active window?
    Thursday, April 6, 2017 7:23 AM
  • Hi, Dmitry, I have used GetForeGroundWindow() to get a HNWD parent in (Onstartupcomplete) for the first DoModal() that is the login dialog, and I have used the code above for the the second dialog that is the configuration dialog box and it still works but I have always displays and refreshing problem in my virtualbox guest so I think it comes from virtualbox graphic driver because under a normal window, (not a guest) I haven't any problem.
    • Edited by stephane_l2 Thursday, April 6, 2017 8:06 AM
    Thursday, April 6, 2017 7:39 AM
  • Sure, use Application.ActiveExplorer

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, April 6, 2017 2:29 PM