Click here to Skip to main content
16,005,339 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionReturning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 8:02
Sam Marrocco18-Sep-06 8:02 
AnswerRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 8:41
mveDave Kreskowiak18-Sep-06 8:41 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 9:21
Sam Marrocco18-Sep-06 9:21 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 9:43
mveDave Kreskowiak18-Sep-06 9:43 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 10:00
Sam Marrocco18-Sep-06 10:00 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 10:12
mveDave Kreskowiak18-Sep-06 10:12 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 9:25
Sam Marrocco18-Sep-06 9:25 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 10:11
mveDave Kreskowiak18-Sep-06 10:11 
If you don't create the Console window, or at least grab a handle to an existing console window, you can't write to it.


smarr wrote:
I'm trying to get my app to print text to the shell from which it was called. In C, the closest thing would be a printf().


Since you created a Windows Forms app, there is no such thing as a console that is attached to it automatically. Your app has to create one, or find an existing one. This was easy in C because your C apps were console-based, non-GUI apps and ran in the context of the DOS-emulator running in that console window. The consoles Standard In/Out/Error streams are at the disposable of the console app that is launched. This concept doesn't apply to Windows Forms apps since it has no use for those streams.

You can create your own Console window using:
Declare Auto Function AllocConsole Lib "kernel32" () As IntPtr
    .
    .
    .
AllocConsole()
Console.WriteLine("This is a test...")



Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 11:37
Sam Marrocco18-Sep-06 11:37 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 13:00
mveDave Kreskowiak18-Sep-06 13:00 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Sam Marrocco18-Sep-06 14:41
Sam Marrocco18-Sep-06 14:41 
GeneralRe: Returning string to stdout from a vb.net gui app? Pin
Dave Kreskowiak18-Sep-06 15:05
mveDave Kreskowiak18-Sep-06 15:05 
Questionpassword Protection in vb.net 1.1 Pin
amaneet18-Sep-06 7:45
amaneet18-Sep-06 7:45 
AnswerRe: password Protection in vb.net 1.1 Pin
Dave Kreskowiak18-Sep-06 8:38
mveDave Kreskowiak18-Sep-06 8:38 
QuestionChange the registry of HKEY_CURRENT_USER "Control panel\colors" that is for changing each color? Pin
zyjl18-Sep-06 7:28
zyjl18-Sep-06 7:28 
AnswerRe: Change the registry of HKEY_CURRENT_USER "Control panel\colors" that is for changing each color? Pin
Dave Kreskowiak18-Sep-06 7:32
mveDave Kreskowiak18-Sep-06 7:32 
GeneralRe: Change the registry of HKEY_CURRENT_USER "Control panel\colors" that is for changing each color? [modified] Pin
zyjl18-Sep-06 7:54
zyjl18-Sep-06 7:54 
GeneralRe: Change the registry of HKEY_CURRENT_USER "Control panel\colors" that is for changing each color? Pin
Dave Kreskowiak18-Sep-06 8:39
mveDave Kreskowiak18-Sep-06 8:39 
GeneralRe: Change the registry of HKEY_CURRENT_USER "Control panel\colors" that is for changing each color? Pin
zyjl18-Sep-06 9:25
zyjl18-Sep-06 9:25 
QuestionWhat is the equivalent VB.net for this C code? Pin
TJO118-Sep-06 4:05
TJO118-Sep-06 4:05 
AnswerRe: What is the equivalent VB.net for this C code? Pin
Christian Graus18-Sep-06 12:53
protectorChristian Graus18-Sep-06 12:53 
AnswerRe: What is the equivalent VB.net for this C code? Pin
_AK_19-Sep-06 1:53
_AK_19-Sep-06 1:53 
QuestionConvert String to Date [modified] Pin
VK-Cadec18-Sep-06 3:32
VK-Cadec18-Sep-06 3:32 
AnswerRe: Convert String to Date Pin
IlanTal18-Sep-06 3:55
IlanTal18-Sep-06 3:55 
GeneralRe: Convert String to Date Pin
VK-Cadec18-Sep-06 4:04
VK-Cadec18-Sep-06 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.