Solved

RunTime Error 406

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

628 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