473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Show form from console app

Hello,

I have developed a COM component (using interop) which is hosted by a
console application (no message loop).

Within a call to the component I want to display a form. However, the
application gets stuck in the call to form.Show(): no form is shown and
the call never returns.

Any ideas? What else could I try?

Lars
Nov 15 '05 #1
3 12673
Use Application.Run(new myForm()) This starts the message loop for the
application and shows the form.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Lars von Wedel" <vo******@lfpt.rwth-aachen.de> wrote in message
news:Xn**********************************@137.226. 144.7...
Hello,

I have developed a COM component (using interop) which is hosted by a
console application (no message loop).

Within a call to the component I want to display a form. However, the
application gets stuck in the call to form.Show(): no form is shown and
the call never returns.

Any ideas? What else could I try?

Lars

Nov 15 '05 #2
Hello,
Use Application.Run(new myForm()) This starts the message loop for the
application and shows the form.


I have no access to the source code of the console application. The console
app just calls a method of my COM component and I currently do a
form.ShowDialog().

Do you suggest to perform Application.Run within the plugin component?

Lars
Nov 15 '05 #3
Hmm, I see. Maybe you should create a Windows Form that hosts this COM
component.

Add the component as a reference, you'll get an interop asssembly generated.
Drag the control onto your form and set it to dock-fill or limit the form
size to the size of the control then do application.Run(....) on the form
you created.
--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com

"Lars von Wedel" <vo******@lfpt.rwth-aachen.de> wrote in message
news:Xn**********************************@137.226. 144.7...
Hello,
Use Application.Run(new myForm()) This starts the message loop for the
application and shows the form.
I have no access to the source code of the console application. The

console app just calls a method of my COM component and I currently do a
form.ShowDialog().

Do you suggest to perform Application.Run within the plugin component?

Lars

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dp | last post by:
I am new to VB.NET and I have a simple question. How do I show a form from a command button click event? The code I have below is not working. I am trying to show the form frmAgent. What am I...
13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
4
by: John B | last post by:
I have a utility that minimizes to the system tray. When I double click or right-click and select restore I want to show the window and for it to be the active window again. I have tried...
4
by: Haris Bogdanovic | last post by:
how do I refer to other form from main form so I can call its Show method ? Thanks Haris
2
by: Laurence Nuttall | last post by:
I have a .net solution that is a class library. I have a form in it called frmAbout I have a public sub, or I assume what will be a method to show the form. but when I type the frmabout name...
3
by: kassemn | last post by:
How to show form by a form in another project using VB.net 2003
1
by: Thammarat charoenchai. | last post by:
hi. everyone. I'm create multiple projects in 1 solution. How can to show form in others projects from default project thanks for you help & sorry about my english
7
by: mina2040 | last post by:
Does anybody has any idea how to listen to the console and show its contents in a Windows Form Application?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.