473,698 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

p/invoke and allocconsole

I read in a previous post by Tom Shelton that you can call AllocConsole via p/invoke to allocate a console window to a form application.

I've searched for info on how to do this, but have drawn a blank. Can anybody help me to get this up and running?

FYI, I want input received via a form to be passed to a console application for processing.

Thanks.
Nov 20 '05 #1
3 1815
I've searched for info on how to do this, but have drawn a blank. Can anybody help me to get this up and running?


I don't have any complete sample, but the function takes no parameters
so it should be trivial to use

Declare Function AllocConsole Lib "kernel32.d ll" () As Boolean

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #2
* =?Utf-8?B?Y29sbWFn?= <an*******@disc ussions.microso ft.com> scripsit:
I read in a previous post by Tom Shelton that you can call
AllocConsole via p/invoke to allocate a console window to a form
application.


<http://groups.google.d e/groups?selm=OpO bpGEkDHA.2676%4 0TK2MSFTNGP11.p hx.gbl>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thanks for the input, i'll give it a go and post the results!
Nov 20 '05 #4

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

Similar topics

1
4101
by: John Altland | last post by:
Here is my basic problem. I have a form that executes a cpu instensive algorithm occupying the first thread. When the algorithm is executed another form pops up telling the user the progress that has been made. Whenever I attempt to update my frmProgress, the events are put placed at the end of the thread's queue and executed after my algorithm is finished. Using the frmProgress.Label.Invoke method with delagates, I have heard would fix...
1
4858
by: boxim | last post by:
hi all, I'm having a few problems whereby my application is hanging when using the Invoke method of a form's control. Basically, when a user clicks a button on the form, it calls a remote function, which in turn fires an event that is caught by the form. The form then need to add a value passed in the event to a form object, however, when using the Invoke method, it just hangs.
2
2676
by: Tom | last post by:
Hi Everybod I want to update some controls in a form from another threads. I did it by passing the form to that thread and calling a delegate with Form1.Invoke, I want to have just one delegeate for all of my controls in the Form and dont define one delegate for each control. Some thing like to have a switch case in that delegate fucntion and passing control name to it.. what is the impact of this method in comparison with...
5
4307
by: RickDee | last post by:
Please help, anybody. I am trying to write a program so that it can launch an exe file ( which is also genereated in C# ) and then simulate the button clicking and invoke the methods inside the exe. The button clicking part is working fine, but I just cannot get the method call. Here is my program snippet. **************************************************************
0
1825
by: Dachshund Digital | last post by:
Ok, This is weird... I just love quirks with .NET 2.0 I create a Window Application in VS IDE 2005 I create a Console... via AllocConsole, all it fine I create an application context, set the mainform to a form, for 'theContext' I run the context via Application.Run(theContext) The minute the Application.Run is done, all events that SHOULD go to the Console window are blocked and seem to be routed to 'theContext' mainform.
23
2635
by: Thomas Due | last post by:
Hi, I have a class which monitors a TCP socket. This will on occasion raise an event which can be handled by a GUI. Now, I am aware of the if(InvokeRequire) { EventHandler d = new EventHandler(); Invoke(d, new object{sender, e}); } else {
6
39433
by: Dom | last post by:
I'm teaching myself about delegates and the Invoke method, and I have a few newbie questions for the gurus out there: Here are some CSharp statements: 1. public delegate void MyDelegate (int k, string s) 2. MyDelegate MyDelegateVar = MyMethod 3. MyForm.Invoke (MyDelegateVar) Some questions:
2
4420
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small or simple). I am hoping the description will generate some ideas I can check out. PROBLEM: ----------------- Switching to UI thread using Invoke(), everything seems good.
3
3230
balabaster
by: balabaster | last post by:
I have a class that I want to make thread-safe and am investigating the ISyncronizeInvoke interface and wondering just what it will take to implement this interface. So far the basic concept of my code is: Public Class MyClass1 Implements System.ComponentModel.ISynchronizeInvoke Private _InvokeRequired As Boolean = False Public Function BeginInvoke(ByVal method As System.Delegate, ByVal args() As Object) As...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3051
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.