473,805 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4385
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******@discu ssions.microsof t.comwrote in message
news:5A******** *************** ***********@mic rosoft.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_Declar ations 'Inp and Out declarations for port I/O using
inpout32.dll.
Public Declare Function Inp Lib "inpout32.d ll" Alias "Inp32" (ByVal
PortAddress As Short) As Short
Public Declare Sub Out Lib "inpout32.d ll" 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 "FindWindow A"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function SendMessage Lib "user32" Alias "SendMessag eA"
(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 "FindWindow ExA"
(ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal
lpsz2 As String) As Integer
Private Sub frmSend_Load(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim FHandle As Integer
Dim currentstatus As String
Dim THandle As Integer
FHandle = FindWindow(vbNu llString, cHIDDEN_WINDOW_ TITLE)
THandle = FindWindowEx(FH andle, 0, vbNullString, vbNullString)
currentstatus = Inp(&H379S)
MsgBox(currents tatus)
While FHandle <0
SendMessage(THa ndle, WM_SETTEXT, 0, currentstatus)
System.Threadin g.Thread.Sleep( 500)
FHandle = FindWindow(vbNu llString, 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******@discu ssions.microsof t.comwrote in message
news:5A******** *************** ***********@mic rosoft.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
23658
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 the server since it's GET or POST request. But if just form-to-form communication, why we need to send the form to the server? Please help clarify. Thanks!! <form action="process.asp" method="get"> //form controls <input type="submit">
3
4299
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 exe)? They are supposed to work "live", e.g. one prog picking up data from a device and then pass it to the other prog that will analysis or use the data for animation. And, how to do that? They are developed by two different people, so I do...
14
9066
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 ..... So the PHP script does something on the server database, then when a linked table is viewed within access, the data changes have been made?
17
7081
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 returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
3
3184
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. I am currently using the url to pass the values such as
5
5087
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 dbo_Roster to access 2000, I try to group data by Service and dates, for example 01/01 to 01/31 is Jan08, 01/02 to 28/2 is Feb08 and so on. The result should be like below : Service Jan08 Feb08 Mar08 Apr08 May08 Jun08 ...
9
2294
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 127.0.0.1 - - "GET /symfony/ HTTP/1.1" 404 289 127.0.0.1 - - "GET /symfony/sf_sandbox HTTP/1.1" 404 299 127.0.0.1 - - "GET / HTTP/1.1" 200 3466 127.0.0.1 - - "GET /appserv/members.gif HTTP/1.1" 200 755
9
6187
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 or so or it can contain as much 10000000 bytes. In reality, I do not know the maximum number of bytes. In my function, I am going to read() the byte stream using a buffer. Now, is it better to read it into a buffer and dump the buffer into a...
1
1500
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
0
9716
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
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
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...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6874
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
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
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
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.