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::_SplashScreenPt r pSplash;
pSplash.CreateInstance(__u uidof(DSLS plash::Spl ashScreen) );
HRESULT hr = pSplash->raw_Show();
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::_SplashScreenPt
pSplash.CreateInstance(__u
HRESULT hr = pSplash->raw_Show();
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.