Link to home
Start Free TrialLog in
Avatar of pecan
pecan

asked on

Modeless dialog in VB ActiveX Dll project

I cannot create a modeless dialog when using my ActiveX DLL in Visual C++ (in VB it is OK). The return code (HRESULT) is 0x800a0196. Creating a modal dialog works well.

This is a part of my code in VB:

Private Sub Class_Initialize()
    Set frmSplashScreen = New frmSplash
End Sub

Public Sub Show()
    frmSplashScreen.Show vbModeless
End Sub

And this is my C++ invocation:

#import "Splash.dll"

DSLSplash::_SplashScreenPtr pSplash;
pSplash.CreateInstance(__uuidof(DSLSplash::SplashScreen));
HRESULT hr = pSplash->raw_Show();
Avatar of Aparna072399
Aparna072399

it is not recommended to have any kind of dialog boxes or message boxes modal or otherwise, in a DLL. I am not sure of this, but i think the documentaion say NOT specifically not to have modeless dialog boxes in a DLL. This might be cos the dialog box can be left unattended and can cause the DLL to remain in memory longer than needed
ASKER CERTIFIED SOLUTION
Avatar of AnswerTheMan
AnswerTheMan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pecan

ASKER

Although it didn't work even as an ActiveX Colntrol, your answer made me try to build my project as an ActiveX EXE and it works.