Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Capture Com Port Data

I am trying to write a program to replace a DOS program which downloads and uploads data to a GPS receiver. I have asked the manufacturer for the protocols but have not had any reply yet. Probably because this model is no longer supported.

I would like to run the DOS program under WIN98 and capture the data transfers so that I can try to work out the protocols I need.

Has anyone got any ideas how this could be done?

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MSCOMM Serial Port Data Capture And Manipulation Of Data
Dear frens,

I'm writing a VB project which will receive data from a device via
RS232. I have a few problems

1) First, I can use VB to capture the RS232 data but what i get is some
characters which i think should be ASCII characters whereas i can
capture the RS232 data with some " SERIAL MONITORING" software which
will display the data nicely in HEX, for eg
A1 23 FE 41 1C 43
My question is how can i convert the RS232 data i captured above to the
HEX i mentioned, ie A1 23 FE AI and etc...? I tried using HEX but what
it came out was a continuous stream of 0s... Any idea how?

2) The question 1) is the 1st stage of my project. The 2nd project is
to parse through the patterns of the HEX data and find more specific
patterns. For eg
(i) A1 B4
(ii) A2 34
(iii) 28 33

And then for each pattern i got, i need to set a bit of a data type of
16 bits. For example, if i get (i) A1 B4, i need to set the 1st bit of
that data type to 1
If i get (ii) A2 34, i need to set the 5th bit of that data type to 1

How can i search thru the RS232 data i mentioned above? I'm not very
clear of the data types and functions of VB because this is only my 2nd
month using VB.

Also, which data type is suitable for the "data type of 16 bits" i
mentioned above for the bit setting?

Any help is appreciated... Thank you very much.

Albert Leng

Capture Data From Printer Port And Log To A File VB6
Hi guys
I have an already compiled app that sends data periodically to a printer, what I would like to do is to write a separate app that will capture this data from the computers printer port and log it to a single excel file fo ease of auditing an archiving.
I tried assigning the print driver to print to file but every time data is released it creates a seperate file while i want everyrhing to come to a singlr file,
Pls help



Port Capture? Not Sure If Thats Right
well...when someone hits button i want it to get the ip from a certain port...its like typing netstat -n in dos..and i want to get the ip adress that is connected to port 2346

Audio Port Capture
I am just curious if there is a way of using VB code to capture the audio output from a pc to a a wav or mp3 file. It would be similar to keyboard capture which records all the kb strokes into a file. If so, where should I start?

Thanks in advance,


Capture Printer Port
I want to capture the output from the printer port of an embedded system.
the only source of output from the system is the printer port. Can any one help me ?????

Ascii Capture Via RS232 Port

I am currently using HyperTerm to collect data sent via the com1 serial port. The data is sent in ASCII format is is fine for what I need.

Cutting and pasting the data after its in Hyperterm is a major pain in the butt.

I would like to find a module or script that I can incorporate in a small vb prog that will capture the data being send and save realtime into two separate user specified files.

Anyone know of or have a module or script that will get me that far?


Unable To Capture Text From Serial Port Using MSCOMM!
Private Sub Form_Load()
MSComm1.PortOpen = True
If Right$(App.Path, 1) = "" Then
Open App.Path & "outputDATA.TXT" For Output As #1
Open App.Path & "outputDATA.TXT" For Output As #1
End If
End Sub

Private Sub MSComm1_OnComm()
Print #1, MSComm1.Input
End Sub

Private Sub Form_Unload(Cancel As Integer)
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
End Sub
Currently I have two computers connected via a COM cable. On the "transmitting" computer I've written a program that opens a file and reads it line by line, transmitting each line. This works, as I've opened HyperTerminal and it shows me each of the lines being transmitted.

The part I'm having trouble with is the "receiving" program. This seems so easy and I've read through a lot of the threads here and I can't understand what I'm missing!!

I placed a break on the Print command and when I run the transmitting program and switch back to the receiving program I place my cursor over the MSCOMM1.Input item and I see the following text in the little yellow box that appears.

MSComm1.Input="1st Test Line[][]2nd Test Line[][]"

Now the [][] are the vbCRLf that is coming from the carriage returns.

When I open the outputdata.txt file it is completely empty!!

What am I missing?


Capture Barcode Scan From Serial Port && Load Into Array

I have 2D barcode that is read by a scanner. The barcode string is comma delimited. I need to load this string into an array...but I am having trouble with the scan. It appears that the data is not instantly scanned into a textbox. It is load in packets I guess. When I try to load the string even into a only captures part of it. What do I need to do to capture the whole scanned string and load it into a array. Someone also mentioned something about load it into a "stack" and using "push" and "pop". I am unfamiliar with these terms. Help!


Read Data From RS232 9 Pin(com Port) That Convert To USB Port
I need help how to write code, to retrive data from rs232 standrat communication, that convert to USB interface(cumputer)? Help me please!

Problem With Reading Data From Com Port(serial Port)

I am developing a vb program to read data from MSR (Magnetic Stripe Reader). I have connected the MSR in com port. i want to get the data(member id) from the magnetic member card when the member swipes it on the MSR. I am using the follwoing cods to initialize and read the data

i'm initializing the device MSR in form load


MSComm1.CommPort = 3
MSComm1.Settings = "19200,n,8,1"
MSComm1.RThreshold = 12
MSComm1.InputMode = comInputModeText
MSComm1.InputLen = 0
MSComm1.PortOpen = True

Private Sub MSComm1_OnComm()
Dim aaa As String
If MSComm1.CommEvent = comEvReceive Then
aaa = MSComm1.Input
Text1.Text = aaa

End If
End If
End Sub

My problem is, for some cards the above mentioned code is working fine. ie, i can get the data and i am checking the member id with teh table. fine. but sometimes i am not getting anything from MSR when the member swipes the card. I don;t know what is the problem in my code.

The length of the Member id will variy from member to member, for example

the format %99999-123? - length is 11 characters

%99999/01-1123? -length is 15 characters

%99997-1? - length is 9 characters

Pls suggest me what is the problem in my code. and y ii cannot get any data from some of the cards. that cards are working in another machines without any problem

Thanks in advance



Read Data From Serial Port Or COM Port
Anyone got code to read data from Serial Port of Com port?
Can you send me a copy?

Any help appreciated


How To Get Data From Serial Port /parallel Port
How do you capture data sent through the
serial/parallel port coming from another machine(lets
say from a pabx machine sending strings of data).

Is it possible to save the data to a txt/csv file for
processing? how?

Data Capture
I know that winsock returns chunks, but awhile ago, a friend of mine wrote me a little something that captures all the data. From <html> to </html>

I cant remember how it was written, and he no longer comes online. Any help is appreciated. It went something like this:

Private Sub Winsock1_DataArrival(ByVal bytesTotal as Long)
Dim Data1 As String
Winsock1.GetData Data1
iData = iData & Data1
End Sub

Private Sub Winsock1_Close()
iData = iData & Data1
End Sub

What's The Best Way To Capture This Data?
I have to build a database to capture some pretty simple demographic data on patients in a hospital.

The problem is that I need to be able to show the user what it is they've already entered, like a table in Access. Here's the catch though; I hate the datagrid control.

Once the user has entered a record that contains patient information, I need to let that user have access to that record and add/edit information as needed.

It's not a big system, and at most it will have three users, but I do need this up and running fairly soon.

What's the easiest way to set this up? I'm thinking VB to Access (because of the limited records), but it may be a little more extra work to give the end user a 'running list' with the ability to change/add information.

There's probably an easy way to do this in even Excel.

What do you guys recommend?

How Do I Capture Data From A Web
I want to capture data from a web page. the data to this web page is being returned by a servlet. Can I use web controls to actually read the incoming data. If so, how?

Capture Print Data
Got an email from an old friend and I'm not sure how to help him. Am thinking maybe have the report print to file and then somehow access the data from the .prn? Not sure how to that accomplish that however.

Any ideas how this can be done?

Here's their request:

The information we want to capture is already contained in a report that
is printed. Any ideas on how to capture the information in the report as
it heads to the printer and dump it into a csv for example? The report
prints to a regular networked printer.

Capture Print Data
Got an email from an old friend and I'm not sure how to help him. Am thinking maybe have the report print to file and then somehow access the data from the .prn? Not sure how to that accomplish that however.

Any ideas how this can be done?

Here's their request:

The information we want to capture is already contained in a report that
is printed. Any ideas on how to capture the information in the report as
it heads to the printer and dump it into a csv for example? The report
prints to a regular networked printer.

Serial Data Capture
I am using the following code to detect data arriving at the serial (com) port. The data arriving is in the format "Alpha, number, number, number, number full stop"(ie C,0,0,98,500.) Once the full stop is detected the com port is closed while data is extracted and displayed etc. It was working but for some reason I am now getting the following debugs:

Character C,
Character C,0,
Character C,0,0,98,500
Character .

I assume the first three debug lines are the data coming in and the 'InBuff' string is built. Why would the InBuff suddenly lose all characters and go to just the full stop. Is there a more liable way to do this.

Private Static Sub MSComm1_OnComm()
'Used for trapping communications events and errors
Dim EVMsg$
Dim ERMsg$
Dim S As Integer
InBuff = ""

' Branch according to the CommEvent property.
Select Case MSComm1.CommEvent
' Event messages.
Case comEvReceive
For S = 0 To MSComm1.InBufferCount
InBuff = InBuff & MSComm1.Input
Debug.Print "Character " & InBuff

If Right(InBuff, 1) = "." Then
MSComm1.PortOpen = False
InBuff = Left(InBuff, Len(InBuff) - 1)
Call GetCabinet(InBuff)
Exit Sub
End If

Next S

SMDR Data Capture
Dear All,
Can any one help me in capturing SMDR data which is connected via serial port a standalone computer.

SMDR card fixed on an EPABX Digital Hybrid system. The data is required for Extension to Extension, Outside and Interneral calls.

Code Required.


Data Capture Inquiry

I am using a,

Cipher Lab 1023 Magnetic Stripe Reader
Dimensions : 163mm x 88mm x 30mm

System Interface : Kb wedge

... I want to determine if my data comes from the card reader or
from the keyboard since they have the same interface.

.. in my application when the cursor is placed in a textbox
and a card is swiped.. the contents of the magnetic strip
is captured.. I want to trap those input coming from the card
reader and keyboard. Is there a way for me to do this?

Webbrowser Capture Data
I have an unusual web page i need to capture.

When i type in the URL i get a blank page.

When i right click and view source, nothing there.

But if i save the page as html, and then open the html page via wordpad, all the data i need is there.

The data i need is enclosed in...

<SCRIPT language=Javascript>

etc... the data...


How do i get this info using the webbrowser control

I have tried  eg ctlWebBrowser.Document.Body.outertext
innertext,text,innerhtml,outerhtml....!! and get next to nothing


Private Sub ctlWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)

Open "c: hewebbrowser est.txt" For Output As #1

print #1, ctlWebBrowser.Document.Body.outertext

Close #1

End Sub

Any help would be appreciated.

Regards  Kennedymr2

Need To Capture Some Data From A Print
i am looking for a way to capture some data from a web DB that is set up to
only allow a user to view one page of a query at a time or to print the
entire query. i don't want to print and retype for obvious reasons.

so i would like to "capture" the text of report that goes to the printer and
put it into a DB in my app.

so does anyone know if/how i can capture the text as it goes to the printer?

thanks for any help.


Capture Data From Webpage
This question has probably been answered before, but I can't find it so here goes...

I want to have a script that will go to a web page, (a web page that is actually a front-end for a database) select some checkboxes and dropdowns, and then click "submit". The output will be a Excel spreadsheet that I want saved to a particular location.

I have absolutely no idea how to do this, or where to begin....I mean really, no idea.

Also, this needs to be a timed thing that runs automatically.

Please let me know what you think.


Capture Print Data
Got an email from an old friend and I'm not sure how to help him. Am thinking maybe have the report print to file and then somehow access the data from the .prn? Not sure how to that accomplish that however.

Any ideas how this can be done? My guess is they do not have access to coding resources.

Can VB6.0 be used to read a .prn file and, if so, how?

Here's their request:

The information we want to capture is already contained in a report that
is printed. Any ideas on how to capture the information in the report as
it heads to the printer and dump it into a csv for example? The report
prints to a regular networked printer.

How Can I Capture Data From A Web Page?
I'm tring to get some data off a web page. I currently just copy and paste it to a file using notepad but I would like to make it automatic.

lets say from the

  NASDAQ 1843.70 -58.02 3.05%
  DJIA 9425.51 -150.53 1.57%
  S&P 500 1009.38 -19.65 1.91%
  NASDAQ-100 1339.64 -48.51 3.49%
  NASDAQ-100 PMI 1390.23 2.08 0.15%
  NASDAQ-100 AHI 1340.17 0.53 0.04%

this data is displayed on their web page. How can I go to Nasadq and get this info and save it to a file in VB. I haven't done any web stuff with vb.


Can I Capture Data That Is Sent To The Printer?
From another app.. such as IE, and is that data decypherable if in fact I can get it?


Capture Data And Put It Into The Database
Hi guys, hopefully somebody can give me some ideas and maybe even some sample code.

I have a function "Display Reports" that handles all my needs for the reports that I am running.

I am creating a new table in the sql database that has NetworkLogin, ReportID and DateRun. I want to be able to capture these details when users click the button "Done", so the data gets written to the table in the database. I am trying to see which users run which reports and what time.

Any ideas????

Greately appreciated.

Data Logging - Serial Port Data
Hi all

I have got a simple program which reads information from a serial device using a send and responce method.

The information received from the port i have got displayed in a text box on the form.

the format of the text is +0.000<cr>

what i want to do is to automatically log this information on a single excel file.

any help would be great!!!!

Capture Data From Another Apllications Print Job
Hi, is it possible to capture data from another programs print, I want to strip out the information sent to a printer, basically its a label print that outputs the surname, forename, address etc. I want to capture the information to use in my add on program.

IF I print to a generic / text print and save to a file the information is presented in a format that I can use, what I want to be able to do is put my own generic / text printer in there which doesn't ask for a filename, just either kicks off another program with the information or simply adds the information to a database that my other program could use.

Its the interface acting as a printer thats is causing me problems as I wouldn't know where to start.

Could anyone help, thanks

Releasing Capture Of Data Object

In my Form_unload event this statement doesn't release capture on the DB.


Why is this happening?

The idea behind this is renaming the extention of the data base file to something else, so the user couldn't mess with it (what one can't see, one can't brake).

I'm using Name function to do the job and it worked fine so far. Recently, I had to include Data object on the form (to bound DBGrid) and now it's causing this tinny problem. It's giving me the error: "Path/file access error".

Any idea?

Capture Streaming Data W/ Winsock
I have a server that sends data to a seperate server running an application that uses the data being recieved. I need to capture the data as it is being sent from one server to the other. I have written a simple program that is capturing the data using WinSock but the problem is, my program is only capturing a small chunk of data and I need it to capture all of the streaming data. Below is my code:

Dim strData As String * 1024

Private Sub cmdConnect_Click()
Winsock1.RemoteHost = txtHostIP
Winsock1.RemotePort = txtHostPort
End Sub

Private Sub cmdDisconnect_Click()
End Sub

Private Sub cmdStart_Click()
Winsock1.GetData strData, vbString, 1024
txtLogger = strData
Debug.Print strData
End Sub

I just need the data to stream in my text box. Currently it is only capturing data when I click the cmdStart button.

Thank you.

Capture USB Swipe Card Data
I have a USB Swipe card reader that mimics keyboard input. I need to write something VBA or VB that runs in the background and watches for a Specific character (Like the start of a string from the USB Reader) and then organizes the data and send it to a DOS program.

I am looking for some help with the background/key catcher. The rest I am ok with.

To be used with employee data cards....

Any hints in the right direction?

Mshflexgrid. How Capture A Data Cell
Hi everyones..

I have a form with several controls to show a rst data... and i have too a mshfelxgrid1 control, where I show all rst data .. Well .. i want that i apply a doubleclick in a row of mshflexgrid, the data contained in a row show it in a form.. !! using the id field that is a first field or a first column in the mshflexgrid control. Col(0) or wherever..!!!

I will apreciate some help...

Regards.. Groval

Capture Data And Compare With M Access

i search all over internet to find code for retreiving data from smart card which is inserted into smart card readre.
all i found was saying, it could be make if only the usb card reader is a serial card reader?

then, what options do i have?
1. buy a female usb with male serial converter?
2. change vb 6.0 to
3. or the converter does not exist and doesnt support usb devive communication?

but apart of above problem,
how can i manipulate the data captured from smart card to compare with the database?what are the codes?

Capture Form Data From Webpage

At my work they used a web based system to submit expenses. They all enter into System A. At the end of the month, we get a report from system A saying these expenses went through. The problem is there is no 1 to 1 correlation between what is submitted into the system and what is processed each month.

Generally, the person who inputs the expenses each month keeps a separate excel spreadsheet, with the status of each bill. At the end of the month, we compare report from system A with the excel sheet the data inputter keeps. (Noting that even though bill 100 went into system A in january, it was not processed in january, but february)

We deal with 100's of bills a month, so the excel method of comparing the lag time between the bill being entered into the system and the bill being processed by the system is becoming unwieldy.

So basically, we want to capture the data as it is entered into the web system. The program would read all of the form elements on the page, take the data, and save it to a DB when "submit" or "enter" is pressed.

How do I monitor the form elements of a web page with an external program and how do I monitor the events on that webpage (pressing submit for example)? I know this is possible, but have yet to find the correct code snippet. IE 6 is used.


Please help on CAPTURING DATA FROM COM1 or COM2 then place it to a textbox on a form...


Does Anyone Work In The Data-capture Business?
By data capture i mean capturing names and addresses from application forms and junkmail returns that the public sends in.

If you do, then please give me your opinion:

Would you be interested in a Visual Basic control that converts CSV's, Tab delimited files and fixed width files, into one of the other types for example:

From CSV to tab Delimited
From Tab delimited to Fixed width
from Fixed width to CSV

You will be able to specify source file and destination file paths, start and finish record numbers (ie top 30% will be converted, or from 504th record through 12,544th record, etc...)

i know the place i used to work at would hack off their own limbs to get something like that.

So do you think it would be of any use to your company?

When I have finished this project i will give a free copy to you if you want it.

Whaddya think?

Data Capture External Device
I am developing an application (in VB) which will take some data from a weigh bridge machine. The machine will pass the weight details to the computer attached. The computer will then take the data and will get processed. The weigh bridge attached to a port on the system. How should I capture the data supplied by the weigh bridge machine?

I appreciate the quick reply.

Thanks & Regards,


Datagrid (capture Data) And Change Value
I made an usual DataGrid to obtain data, I don't have problem with that. The trouble is that I have no clue nor any forum provide some insight on how to change the value once the data is loaded into the DataGrid, if modification has to be done, then that is fine...

What I am trying to do is when the data is being pulled from the Access Database, and gets the value "-1". I want to capture that value and change that value in the datagrid ONLY as "Done" or if the value is 0 then "Not Done". and repeat for each "row" on that particular value.

How would I go about doing that?



GPS Data Capture In EVB Application On IPAQ
I wrote a simple application of capturing GPS data from Navman 3000 attached to a iPAQ 3900. I used the comm port detection program given by Navman technical support to find the port number that GPS receiver is using and transmit the raw GPS data (NMEA sentences) to a textbox on the interface of the application. That is very clear and simple I think. But the program can't work at all. There is no response in the textbox (code is shown underneath). what's more, it seems some fatal error (dead loop) occured within the program cause the process was always locked after I start the application. I can only re-run the debug to kill the process and release the from. Is Anybody here met the same problem or got idea of handling it? Thanx in advance!

source code:

Option Explicit

Public Declare Function RegOpenKeyEx Lib "Coredll" Alias "RegOpenKeyExW" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib "Coredll" Alias "RegQueryValueExW" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long
Public Declare Function RegCloseKey Lib "Coredll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKeyEx Lib "Coredll" Alias "RegCreateKeyExW" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long
Public Declare Function RegSetValueEx Lib "Coredll" Alias "RegSetValueExW" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long
Public Declare Function RegEnumKeyEx Lib "Coredll" Alias "RegEnumKeyExW" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As Long) As Long
Public Const SYNCHRONIZE = &H100000
Public Const KEY_NOTIFY = &H10
Public Const READ_CONTROL = &H20000
Public Const STANDARD_RIGHTS_READ = &H20000
Public Const KEY_QUERY_VALUE = &H1
Public Const KEY_SET_VALUE = &H2
Public Const ERROR_SUCCESS = 0
Public Const REG_SZ = 1
Public Const HKEY_LOCAL_MACHINE = &H80000002

Private Sub Command1_Click()
  Dim portNumber As Long
  Timer1.Interval = 4000 'set time interval of updating received GPS data
  RxData.Text = "" 'clear the textbox
If GetNavmanSleevePort(portNumber) Then
'call the function GetNavmanSleevePort() to find the right comm port used by Navman 3000

    Comm1.CommPort = portNumber ' pass the right port number to application
    Comm1.Settings = "57600,N,8,1" 'comm port settings
    MainForm.Caption = "Tty Com" + portNumber + ": 57600"
    Comm1.PortOpen = True
    RxData.Text = "Com Port Open Failed"
  End If
End Sub

Private Sub Command2_Click()
  If Comm1.PortOpen Then
    Comm1.PortOpen = False
  End If
  App.End 'close comm port and stop the application
End Sub

Private Sub Form_OKClick()
End Sub

' Get Port Number Extracts the Com Port Number from the Name registry key.
' Returns True if successful
' Used by GetNavmanSleevePort
Private Function GetPortNumber(ByVal hKey As Long, ByRef port As Long) As Boolean
  Dim KeyStr As String
  Dim nameSize As Long
  Dim dwType As Long
  Dim Value As String
  Dim lRes As Long
  nameSize = 256
  KeyStr = String(nameSize, 0)
  Value = String(nameSize, 0)
  KeyStr = "Name"
  GetPortNumber = False
  lRes = RegQueryValueEx(hKey, KeyStr, 0, dwType, Value, nameSize)
  If (lRes = ERROR_SUCCESS) Then
    KeyStr = "COM"
    If InStr(Value, KeyStr) Then
      port = Mid(Value, 4, 1)
      GetPortNumber = True
      Exit Function
    End If
  End If

End Function

' Gets the port number for all Navman devices (The navman Expansion pack sleeve
' and the Navman CF Receiver).
' Returns True if successful.
' If successful port contains the com port number.
Public Function GetNavmanSleevePort(ByRef port As Long) As Boolean

Dim lRes As Long
Dim Key_Read As Long
Dim hKey As Long
Dim hActiveKey As Long
Dim I As Long
Dim KeyStr As String
Dim Value As String
Dim nameSize As Long
Dim fileTime As Long
Dim dwType As Long

port = 1
nameSize = 256
KeyStr = String(nameSize, 0)
Value = String(nameSize, 0)
GetNavmanSleevePort = False


KeyStr = "DriversActive"

lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, KeyStr, 0, Key_Read, hKey)

If (lRes = ERROR_SUCCESS) Then

  I = 0

  nameSize = 256
  While (RegEnumKeyEx(hKey, I, KeyStr, nameSize, 0, 0, 0, fileTime) = ERROR_SUCCESS)
    KeyStr = "DriversActive" + KeyStr
    lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, KeyStr, 0, Key_Read, hActiveKey)
    If (lRes = ERROR_SUCCESS) Then
      KeyStr = "Key"
      dwType = 0
      nameSize = 256
      lRes = RegQueryValueEx(hActiveKey, KeyStr, 0, dwType, Value, nameSize)
      If (lRes = ERROR_SUCCESS) Then
        KeyStr = "DriversOptPack100"
        If InStr(Value, KeyStr) Then
          GetNavmanSleevePort = GetPortNumber(hActiveKey, port)
        Else 'Check if it is a Navman CF receiver
          KeyStr = "PnpId"
          dwType = 0
          nameSize = 256
          lRes = RegQueryValueEx(hActiveKey, KeyStr, 0, dwType, Value, nameSize)
          If (lRes = ERROR_SUCCESS) Then
            KeyStr = "NAVMAN"
            If InStr(Value, KeyStr) Then
              GetNavmanSleevePort = GetPortNumber(hActiveKey, port)
            End If
          End If
        End If
      End If
    End If
    I = I + 1

End If

End Function

Private Sub Comm1_OnComm()

End Sub

Private Sub Form_Load()
End Sub

Private Sub Form_OKClick()
End Sub

Private Sub RxData_Change()

End Sub

Private Sub Timer1_Timer()

  Select Case Comm1.CommEvent
  Case comEvReceive
    RxData.Text = RxData.Text & vbCrLf & Comm1.Input
  End Select
'display the raw GPS data transmitted from Comm1 port

End Sub


Can We Capture Data From A Webpage ??????? NewBie Q
    I want to retreive data which is in a text box in a web page. Can it be downloaded in our VB application.
Actually I want to translate captions in others languages, there are many free web services which does that. They provide a text box on their page. Now when the user puts his/her text in the text box and press translate button , the data is translated.

This translated data is displayed in another page in another text box.

How to use Vb application to send data typed in VB textbox and retreive the translated text.

It can be done in VB as I have seen an VB application doing so. Actually the exe needed VB Runtime file and the creator was a VB Certified So I guessed it has to be built in VB.

The User controls and all other things are of VB style but I can't think how to replicate the idea of Interactive communication with a website.

I am attaching the picture of two pages ie when the text is entered and when the translation page is received.

Thanks You very much For Reading this.
Double Thanks If somebody Replied.


Er. Gurpreet Singh
C.E.O Sukhmani Software
New Delhi

Difficult Things are Those that can be done Instantly.

Impossible things are those which take little long - Unknown

Capture Required Data From ClipBoard

I need to select particular data from clip board and paste it into my text box. How can i do that?

Let's say I have the following data/Text in ClipBoard:

Student ID: 123
Student Name: ABC
Class: 12th
Year: 2005-06

I need to capture the student Name "ABC" alone.

How can I achieve that?

Thanks in advance.


Optimisation Of Serial Communication's Data Capture In VB6
Dear friends,

I've actually posted questions about my project in a previous thread. Since the thread is getting a bit long, i'll post in a new thread.

My VB project will capture bytes from a fire alarm panel like
04 AB 78 A0 0F 67 continuously. Then, the program needs to look for specific pattern of bytes (which represents states of Alarm like Fire, Technical Fault and so on), for eg, (i) AB 78 (ii)2A 3D & etc and set certain bits of a data type of LONG. I managed to do all these but there's one issue: SPEED. Before i carry on with description of my issue, below is the setting between my PC and the Fire Alarm Panel:
BaudRate: 600, Parity: None, WordLength: 8, Stop bits: 1.
Buffersize of Alarm Panel: 65
For Fire Alarm, after every data transmission, a delay time of 0 to 8 seconds will follow.

A typical Fire Alarm message (Normal or Alarm triggered) is 20 bytes. I use RThreshold and InputLen to be 21 bytes. Everything is okay which i can capture the specific byte patterns and set the relevant bits. When the specific byte patterns are found to be non present, the bit is reset to 0 again. All go well except the below cases:

1) If there are more than 1 alarm is triggered, 2 or more messages are being sent to my VB project. This poses a problem which the 2nd message will be captured later and cause a delay to set its related bit. This problem is exceptionally obvious if i trigger many alarms at the same time, say 10 alarms. For large number of fire alarm messages, a de-activated alarm's message may noy be captured on-time also as its message may be very far behind in the fire alarm queue. Does anybody have any idea for this? How can i improve the speed of my program's capturing of Fire Alarm Data with the limitations of Baud = 600, Fire Alarm's buffer of 65 and others which i mentioned above? I tried to use higher value for RThreshold and InputLen. It works but it's simply too slow for the fire alarm message to be sent to my PC.Sorry if my English is awful.

Hope to receive your reply soon.


DDE Stock Market Link And Data Capture

I use ESignal stock market monitoring software. It has a DDE link to EXCEL which I have working (up to the 50 stock symbol limit at the moment - still pretty spiffy). Right now the spreadsheet is constantly updating the same cells and I want to write a VB for Applications module to write each stock trade to another spreadsheet dedicated to each stock I monitor. So the DDE linked sheet acts as a sort and route node.

So, if IBM updates on the DDE link sheet I want to write the new IBM stock trade data and retain it, basically logging all the trades of all the stocks I am monitoring. By the end of trading I want each individual stock sheet to read down with every trade so that my customized stock analysis programs can kick in.

I have a few questions.

1. Will running a VB module interrupt the DDE link updates making VB for appls the wrong choice for doing this?

2. But if VB for apps in Excel allows DDE to keep updating, what program statements work best to trigger on a change in cell value to write the whole row to another sheet?
I've been looking for the ideal command statements to use but cannot find something that says "on change in value in cell on sheet and workbook such and such, copy row ....".
I seem to be forced to consider a looping logic that first sets some key variables to the DDE values and then checks every second by writing the values again to another bunch of variables, compare the two, if different write the values to the respective sheets.
(even if the DDE sheet I see does not update the screen when VB for app module runs, if the actual data in the background cell in the sheet I use is updating anyway that would be okay as long as the individual stock logs get written to).

3. On an earlier post someone suggested I write the data to a database. How can the DDE link log to say ACCESS instead. That would be excellent. For clarity, the DDE link functions with the following type formula: =WINROS|last!IBM where "last" is the stock data for last trade price, for instance. Each cell has a similar formula using different DDE variable names from Esignal.

4. If you open multiple EXCEL programs, is there some way to reference VB across the open programs? I have a network of PC's that will be dedicated to individual stock analyses, but at times will want to join data with others on the network. The volume of data will eventually make it impractical for all of this to happen on one PC. So I need to get different EXCEL programs to pass data and for multiple VB programs to interact as well.

Thanks - alternative approaches welcomed!!

Capture Data From TWAIN Scanner Source
Anyone know how to go about capturing data from a TWAIN driver for a
scanner? I have a third party OCR package that interfaces with a scanner
now, but I don't need the whole OCR part for this project. Anyone have any
experience adding support for a scanner in their VB app?

Data Capture In A DO WILE .. LOOP Instruction
Hi all,

I am a new visual basic programmer.

In a visual basic program, I want the end user to capture a string (3 characters).
The user must enter something.

What is the best way to proceed?

Thanks a lot.

Unplugging USB In Middle Of Sending Data (capture This Before Hangs??)
Using sysinfo to capture device installation, and removal. However, in a timer with 500ms interval, i am sending a packet (requesting updated data). This program sometimes hangs right on ".output = byte" (once in a great while CTRL+BREAK will stop the hang):

For intCtr = 0 To UBound(SendBuffer)
CommsBroke = True
Timer2.Interval = 500 'reset
comRS232.Output = Chr$(SendBuffer(intCtr)) ' send byte
CommsBroke = False
End If
Next intCtr

Using another timer for timeout purposes, as you see. Any way to capture/generate an event or timeout with MSCOMMS?

Program isn't running at all when it hangs, because 2nd timer doesn't time out when this happens. 4 out of 5 times, either sysinfo or 2nd timer captures, but on the 5th time prog hangs something fierce, and can't even use CTRL+BREAK!



How To Recognize And Capture The Sound From The Microphone As Streaming Data

I want to know how we can recognize the sound from the microphone as streaming data.

I want to capture that raw data and pass it to some other PC over network immediately and the other PC will decode that data and play it.

Is it possible using VB?


Capture Data From Outlook After Ending A MAPI Email
Hi folks,

I've been driving myself nuts trying to find out how to retreive the data from a user composed email created using simple MAPI and was hoping somone could give me a clue.

I basically have the code shown below and I'd like to capture RecipAddress, MsgSubject and MsgNoteText once the send button in Outlook 2000 is pressed.

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Send True
'capture and store RecipAddress, MsgSubject and MsgNoteText

Anyone able to give me a pointer?

Copyright 2005-08, All rights reserved