Solved

RunTime Error 406

Posted on 2002-04-19
2
751 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

708 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

11 Experts available now in Live!

Get 1:1 Help Now