• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 684
  • Last Modified:

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;
HRESULT hr = pSplash->raw_Show();
1 Solution
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
Donno, after long expireince writing ActiveXs(Controls,DLL,EXE), i more and more convinced that if going
to do any GUI actions in th ActiveX - it should not be a DLL.
what's for ? you can use activeX control for that.

as for the Modal thing in MFC:
try to create a dirived CDialog class that will be activated
with DoModal();
maybe you can kinda wrap the ActiveXDLL inside the process of the Dialog. never tried it myself.

pecanAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now