It is currently Wed Nov 25, 2020 12:52 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject:
PostPosted: Tue Jul 10, 2001 5:19 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by wavemaker.

Hello:

I wrote this program trying to get the STDIN string to write a CGI program -handling forms data, etc.- in PB Windows, but I can't even get SetConsoleMode_ working. Any help?

InitWindow(0)
temporal.s = " "
numero.l = 0
If OpenWindow(0, 100, 100, 195, 260, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")
resultado = GetStdHandle_(#STD_INPUT_HANDLE)
If SetConsoleMode_(resultado,#ENABLE_LINE_INPUT | #ENABLE_ECHO_INPUT | #ENABLE_PROCESSED_INPUT)
Repeat
EventID.l = WaitWindowEvent()
If ReadConsoleInput_(resultado,@temporal,1000,@numero)
MessageRequester("Stdin:",temporal,0)
EndIf
If EventID = #PB_EventCloseWindow
Quit = 1
EndIf
Until Quit = 1
EndIf
EndIf
End

Thanks

Juan Calderón Alonso
Registered user


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jul 11, 2001 5:03 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Mr.Skunk.

Don't have really time for the moment to experiment your code, but i saw two errors:
resultado must be Long => resultado.l (as the result is a handle DWORD)
There is a problem from GetStdHandle (the result is -1 instead of the handle address), so perhaps SetConsoleMode would work if you solve the GetStdHandle problem...

Hope it can help you...

Mr.Skunk

Edited by - mr.skunk on 11 July 2001 06:49:45


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jul 11, 2001 4:52 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Mr.Skunk.

On your code, you need AllocConsole_() just before calling GetStdHandle to make it work.

Your temporal.s is not the good way to retreive info from console with your ReadConsoleInput_(). See here :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/hh/winbase/conchar_8p6a.asp

You have to create an input record buffer which is much more than a simple string (key event, mouse event...)
It should works with this input record buffer

Hope it helps...

Mr Skunk

Edited by - mr.skunk on 11 July 2001 17:52:54


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye