Solved

RunTime Error 406

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

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

840 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