Solved

RunTime Error 406

Posted on 2002-04-19
2
756 Views
Last Modified: 2008-02-20
Run-time error '406':

Non-modal forms cannot be displayed in this host application from an ActiveX DLL, ActiveX Control, or Property Page.

I get this error when I try to show a form modeless in an ocx loaded in IE.

The question is, why I don't get this error when I run the ocx from VB (in debug). Then the form apears normally.

How can I show a modeless form in IE also after I compile the ocx (not started from VB)?
0
Comment
Question by:Azmodan
2 Comments
 
LVL 2

Accepted Solution

by:
corvanderlinden earned 60 total points
ID: 6952772
Visual Basic enables you to test whether a client supports nonmodal forms through the App.NonModalAllowed read-only property.

If App.NonModalAllowed Then
    frmChart.Show
Else
    frmChart.Show vbModal
End If

If you consider that the vbModal constant is 1 and that the App.NonModalAllowed returns 0 or -1, you can do everything in just one statement:

frmChart.Show (1 + App.NonModalAllowed)

Unfortunately, you can't test this feature without COMPILING the component into an actual ActiveX DLL because the App.NonModalAllowed property always returns True when the program runs in the Visual Basic environment.

0
 

Author Comment

by:Azmodan
ID: 6952925
thanx man
i really didn't know about this property

it's somehow inconvenient for me...

see my other problem in this question
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20291272

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

864 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now