A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VB6 to VB.Net Migration



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 10th 09, 07:53 AM posted to microsoft.public.outlook.program_forms
ArtisticPinoy
external usenet poster
 
Posts: 2
Default VB6 to VB.Net Migration

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?

  #2  
Old April 10th 09, 02:59 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VB6 to VB.Net Migration

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()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ArtisticPinoy" wrote in message
...
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?


  #3  
Old April 10th 09, 03:42 PM posted to microsoft.public.outlook.program_forms
ArtisticPinoy
external usenet poster
 
Posts: 2
Default VB6 to VB.Net Migration

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?"





"Ken Slovak - [MVP - Outlook]" 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()

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ArtisticPinoy" wrote in message
...
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?



  #4  
Old April 13th 09, 03:17 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VB6 to VB.Net Migration

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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"ArtisticPinoy" wrote in message
...
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?"


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Contacts migration D.N.Dunlap Outlook - Using Contacts 1 April 22nd 07 04:48 AM
OE Migration Befuddled-1 Outlook Express 9 January 1st 07 12:12 AM
Possible Migration Problem Befuddled-1 Outlook - Installation 1 December 30th 06 06:53 PM
Thunderbird Migration Bill Martin Outlook - General Queries 5 February 17th 06 03:41 PM
Migration Levi Williamson Outlook - Installation 1 February 8th 06 10:15 PM


All times are GMT +1. The time now is 10:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.