List of Serial.sys commands
Hi, i need a list of commands in the serial.sys.
I am hoping to find a way to react on a serial input.
Something like OnCom(), but entirelie build from standard system files.
As a followup, but i could start a new thread on that, i will need multitasking and windowsmessage WM_ infos.
to sum all up:
1) serial.sys reference / where to get
2) multitasking / how to do
3) Windows messages /where to get and how to do
Thanks a lot, Johannes
Re: List of Serial.sys commands
My research shows that 1) and 3) are currently not that important for me.
However 2) looks very interesting.
I wrote some code:
Code:
Option Explicit
'**********************************************************************************
'* A Button Doomsdaydevice and a Textbox Multibox are needet in the Form Tabelle1 *
'**********************************************************************************
'**********************************************************************************
'* Kernel32 Declares *
'**********************************************************************************
Public Declare Function CloseHandle Lib "kernel32" _
(ByVal lpHandle As Long) _
As Long
Public Declare Function CreateThread Lib "kernel32" _
(ByVal lpThreadAttributes As Any, _
ByVal dwStackSize As Long, _
ByVal lpStartAddress As Long, _
ByVal lParameter As Long, _
ByVal dwCreationFlags As Long, _
ByVal lpThreadID As Long) _
As Long
'**********************************************************************************
'* Functions and Subs *
'**********************************************************************************
Private Sub Doomsdaydevice_Click()
Dim threadhandle As Long
Dim i As Long
MultiBox.Text = ""
For i = 1 To Round(((Rnd * 10) + 1), 0)
threadhandle = CreateThread(ByVal 0&, 2000, AddressOf thiswillbethepowerthread, ByVal 0&, ByVal 0, ByVal 0&)
CloseHandle (threadhandle)
Next i
End Sub
Sub thiswillbethepowerthread() 'This thread should be the multiple one
Dim i As Integer
For i = 1 To Round(((Rnd * 10) + 1), 0)
Tabelle1.MultiBox.Text = Tabelle1.MultiBox.Text + Str(i) 'Without this Line, all is well
Next i
End Sub
Now, this Line
Code:
Tabelle1.MultiBox.Text = Tabelle1.MultiBox.Text + Str(i)
Leads to some kind of crash. Error 7 Not enough memory, and the Debugger crashes without error.
Please give me some clue, thanks.
Re: List of Serial.sys commands
CreateThread has never worked properly in VB6 and is well known for causing IDE crashes.
If you need true multithreading capabilities your best bet is to move to VB.NET
Re: List of Serial.sys commands
I would love to, but my Boss says we habe to do this in VBA.
Re: List of Serial.sys commands
If your boss told you that you had to make a fire, but the fuel you had to use was water, what would you do?
Re: List of Serial.sys commands
hey, he pays me.
So i would so the following:
I would split um H20, using an anode and a cathode.
Then i would save those gases and recombine them to water.
That schould make an explosion. -> as close as we get :)
Never the less, you are right. I'll talk it over wiith him.