473,382 Members | 1,389 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,382 software developers and data experts.

how to pass data from between process in vb.net 2008

Hi,

I need to have 2 processes, one is monitorring the parallel port status in
every 30 sec at the background and then send the status to the listbox of
another window, I am new to vb.net, many thanks for any advice.
Nov 3 '08 #1
2 4370
Why do you need two processes? With a single process, you could use a timer
set to tick every 30s and simply update the port status display each tick.

If you can use threads instead of separate processes, then that would be the
next best option. See:
http://support.microsoft.com/kb/316422
(especially the simpler examples)

If you really must use separate processes then you will need some
interprocess communication, such as a named pipe. This is starting to get
complicated. See
http://support.microsoft.com/kb/871044

"golden_au" <go******@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
Hi,

I need to have 2 processes, one is monitorring the parallel port status in
every 30 sec at the background and then send the status to the listbox of
another window, I am new to vb.net, many thanks for any advice.
Nov 3 '08 #2
Thanks for your advise, on the other hand I found sendmessage() funtion can
do the job:

++++++++++++++++++++++++++++++++++++++++++++++++++ ++
Option Strict Off
Option Explicit On

Module InpOut32_Declarations 'Inp and Out declarations for port I/O using
inpout32.dll.
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal
PortAddress As Short) As Short
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal
PortAddress As Short, ByVal Value As Short)
End Module
Friend Class frmSend
Inherits System.Windows.Forms.Form
Const cHIDDEN_WINDOW_TITLE As String = "Main Control Panel - Robot
Control Centre"
Const WM_SETTEXT As Integer = &HC

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef
lParam As Integer) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"
(ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal
lpsz2 As String) As Integer
Private Sub frmSend_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim FHandle As Integer
Dim currentstatus As String
Dim THandle As Integer
FHandle = FindWindow(vbNullString, cHIDDEN_WINDOW_TITLE)
THandle = FindWindowEx(FHandle, 0, vbNullString, vbNullString)
currentstatus = Inp(&H379S)
MsgBox(currentstatus)
While FHandle <0
SendMessage(THandle, WM_SETTEXT, 0, currentstatus)
System.Threading.Thread.Sleep(500)
FHandle = FindWindow(vbNullString, cHIDDEN_WINDOW_TITLE)
'MsgBox(FHandle)
End While
Me.Close()
End Sub
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
the adove code can send a integer from on window to another, but the problem
is the integer send from sender can not display properly in the textbox of
receiver, for example, I send 123, it display {, if sent other integer, it
may display some unknow contents, do you have any idea?
"James Hahn" wrote:
Why do you need two processes? With a single process, you could use a timer
set to tick every 30s and simply update the port status display each tick.

If you can use threads instead of separate processes, then that would be the
next best option. See:
http://support.microsoft.com/kb/316422
(especially the simpler examples)

If you really must use separate processes then you will need some
interprocess communication, such as a named pipe. This is starting to get
complicated. See
http://support.microsoft.com/kb/871044

"golden_au" <go******@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
Hi,

I need to have 2 processes, one is monitorring the parallel port status in
every 30 sec at the background and then send the status to the listbox of
another window, I am new to vb.net, many thanks for any advice.

Nov 4 '08 #3

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

Similar topics

7
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to...
3
by: Hong | last post by:
Hi Group, I hope I got into the right place. If I have two different C++ programs (exe). Is there anyway I can pass data (numbers, strings, etc) between the 2 programs (without combining into 1...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
3
by: Aussie Rules | last post by:
Hi, I have a few aspx (.net2) form. The first form allows the user to enter into text box, and select values from drop downs The second form needs to use these values to process some data....
5
by: HowHow | last post by:
First time using crosstab query because tired of creating queries and put them together in one query (such a stupid thing to do :D). Not sure how it works still. I have link table called...
9
by: pavanponnapalli | last post by:
hi, i have data as under. 127.0.0.1 - - "GET /favicon.ico HTTP/1.1" 404 292 127.0.0.1 - - "GET /favicon.ico HTTP/1.1" 404 292 127.0.0.1 - - "GET /pear/symfony/ HTTP/1.1" 404 294...
9
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I've an optimization question for you all really quick. I have a stream that I am reading some bytes. At times, the stream can contain a small amount of bytes such as 50...
1
by: jonjonkershaw | last post by:
I have two data tables in the dataset datatable1 looks like such increment 11/05/2008 - 10:30 11/05/2008 - 10:00 11/05/2008 - 9:30 etc datatable2 looks like this
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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.