VB6 to VB.Net Migration

Status
Not open for further replies.
Q

QXJ0aXN0aWNQaW5veQ

I have a VB6 Outlook Add-in that has been in production. I tried migrating it

to Vb.Net. Now I get this error "Non-modal forms cannot be displayed in this

host application" when I execute this code:

Dim oSetup As frmSetup

oSetup.ShowDialog() 'error here

What is the work-around please?
 
K

Ken Slovak - [MVP - Outlook]

There's something else going on, ShowDialog() is a modal call, not

non-modal. To display the form non-modally you would call Show(), not

ShowDialog().

You do get an error if you try to show a non-modal form when a modal form is

open, but that's not the case here.

In what context is this dialog being displayed? Are any other forms open

either modally or non-modally?

Does it make a difference at all if you structure your code like this?

Dim oSetup As New frmSetup

oSetup.ShowDialog()

"ArtisticPinoy" <ArtisticPinoy> wrote in message

news:885C33CC-DDC0-454D-9832-A926C6929E88@microsoft.com...
> I have a VB6 Outlook Add-in that has been in production. I tried migrating
> it
> to Vb.Net. Now I get this error "Non-modal forms cannot be displayed in
> this
> host application" when I execute this code:

> Dim oSetup As frmSetup
> oSetup.ShowDialog() 'error here

> What is the work-around please?
>
 
Q

QXJ0aXN0aWNQaW5veQ

The code is for showing a dialog box much like when you click on

Help...About. Originally, the code was oSetup.Show in VB6.

But after migrating the project to VB.Net, I got an error on this line and I

got a suggestion to use oSetup.ShowDialog() and setting the Owner property of

the form to Support UI Automation. So the question i posed was "What is the

code for setting the Form.Owner's property to support UI Automation?"
wrote:


> There's something else going on, ShowDialog() is a modal call, not
> non-modal. To display the form non-modally you would call Show(), not
> ShowDialog().

> You do get an error if you try to show a non-modal form when a modal form is
> open, but that's not the case here.

> In what context is this dialog being displayed? Are any other forms open
> either modally or non-modally?

> Does it make a difference at all if you structure your code like this?

> Dim oSetup As New frmSetup
> oSetup.ShowDialog()

> >

>

> "ArtisticPinoy" <ArtisticPinoy> wrote in message
> news:885C33CC-DDC0-454D-9832-A926C6929E88@microsoft.com...
> >I have a VB6 Outlook Add-in that has been in production. I tried migrating
> >it
> > to Vb.Net. Now I get this error "Non-modal forms cannot be displayed in
> > this
> > host application" when I execute this code:
> > Dim oSetup As frmSetup
> > oSetup.ShowDialog() 'error here
> > What is the work-around please?
> >


>
 
K

Ken Slovak - [MVP - Outlook]

There's no setting I know of that sets an form Owner property to support UI

automation, I have no idea what you're talking about. You set a form owner

to another form or to the window handle of some application's window, such

as the main Outlook window or an Inspector window.

Usually that's not at all necessary however, unless in a special case such

as with WordMail and the dialog you are showing is coming up under the

WordMail window and using the usual methods for setting z-order aren't

working.

"ArtisticPinoy" <ArtisticPinoy> wrote in message

news:377A0C8F-AE37-498F-8969-66E0632E1744@microsoft.com...
> The code is for showing a dialog box much like when you click on
> Help...About. Originally, the code was oSetup.Show in VB6.

> But after migrating the project to VB.Net, I got an error on this line and
> I
> got a suggestion to use oSetup.ShowDialog() and setting the Owner property
> of
> the form to Support UI Automation. So the question i posed was "What is
> the
> code for setting the Form.Owner's property to support UI Automation?"
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J VB6 Add-in fails to load in Outlook 16 - message useless Outlook VBA and Custom Forms 4
A vb6 run time error 5 when Outlook 2007 Explorer object displayed Outlook VBA and Custom Forms 1
R Sending email using VB6 Outlook VBA and Custom Forms 1
Y Encode TNEF file with VB6 Outlook VBA and Custom Forms 1
W OL2003 & VB6:- "Could not send the message" Outlook VBA and Custom Forms 7
glnz How to retrieve or redo Verizon.net email password without affecting Outlook connection? Using Outlook 1
R Unable to send mail using Cox.net Using Outlook 1
T Outlook.com and Comcast.net profiles Using Outlook 12
W I Need help with vb.net and outlook 2010 Using Outlook 2
I Outlook will not fetch or send emails after changes to Win .Net Framework prog Using Outlook.com accounts in Outlook 2
R Error 0x80040900 in Outlook via Comcast.net Using Outlook 2
T Shared addin using .net - deployment for non admins Outlook VBA and Custom Forms 3
T Outlook 2010 BCM Migration to Standard Contacts BCM (Business Contact Manager) 0
Microfiche Migration from Office 2016 H&B to Office 365 Using Outlook 0
B Headache with Hotmail and Outlook since migration Exchange Server Administration 10
Diane Poremsky Data loss may occur during public folder migration Using Outlook 0
M The coming Outlook migration Using Outlook 1
M Data File Management confusion after migration Using Outlook.com accounts in Outlook 1
Diane Poremsky Outlook.com Migration Status Using Outlook 0
A Migration to Exchange, still happening? How will I know when? Using Outlook.com accounts in Outlook 1
W Outlook.com -> Exchange Migration Using Outlook.com accounts in Outlook 2
Diane Poremsky Exchange Server Migration Tools Using Outlook 0
C Changing Domain -- Assigned To User field Migration? BCM (Business Contact Manager) 1
H Exchange 2013 ECP migration connects to crashed server Exchange Server Administration 0
J Migration from BCM 2010 to 2013 is messing up the label fields BCM (Business Contact Manager) 4
P correct public folder migration exchange 2003 to 2010 Exchange Server Administration 1
P migration issue from OL2003 to OL2010 with custom contact form Using Outlook 7
S BCM 2007 to 2010 migration failure issue BCM (Business Contact Manager) 1
S Public FolderEmail Sort Problems Outlook 2010/Migration from 2003 SBS to 2011S Using Outlook 3
C Outllook Migration - Office 200? - 2010 - Shared Mailbox Export-Bulk 500 users Using Outlook 1
D Biggest migration problem - X500 addresses Exchange Server Administration 1
C BCM 2007 to 2010 Migration BCM (Business Contact Manager) 1

Similar threads

Top