Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Modeless dialog in VB ActiveX Dll project

Posted on 1999-07-29
3
Medium Priority
?
609 Views
Last Modified: 2012-05-05
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();
0
Comment
Question by:pecan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:Aparna072399
ID: 1528183
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
0
 
LVL 5

Accepted Solution

by:
AnswerTheMan earned 300 total points
ID: 1528184
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.

0
 

Author Comment

by:pecan
ID: 1528185
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question