I'd like my application to be able to detect a where a particular USB device has been mounted, and adapt accordingly. Ideally, I'd associate paths with a USB serial number, rather than with a given path. However, I cannot figure out a simple way to access these unique IDs from VB.Net code.
I have USB device that is detected as human interface device (HID). The device has one button on it. I want to have more of same devices attached to one PC. I would like to simulate a click on that device (it is not a mouse!). It should be simple using Windows API, but I just can't seem to find an example or at least function that does that (I successfully found code that takes position of a MOUSE, and sends click to a MOUSE, but I need that for my HID). What i really need is an example how to simulate click on HID (something like joystick).Second question is a bit more complicated and I can't find a solution. The HID when button is clicked returns data (5-6 bytes). But data returned is immediately printed to the screen (like i typed it on keyboard) and it is followed by CR, however no data is left on clipboard. I don't know how to get that data to my program. Detecting keystrokes using Windows API (something like keylogger), or to make a control (richtextbox) and retrieve data from that control? Thou important notice is that my program is complicated, involves multithreading (cross-thread operations are a mess) and is TIME CRITICAL (as much as it can be on Windows - you get what I mean), so cross-thread access of control will slow me down a lot or even just won't work. Something like this:[code]Even if this problem is solved it still makes it buggy because user should be able to use GUI all the time.
I am writing a small app that is retrieving data from a device connected to a virtual com-port. I connect without problems to the device using the settings 9600-8-N-1.
I need to send the command <esc>MS , the device then sends back the data to a computer. I have tried this using Hyperterminal with success. I also did this with Excel and VBA. I used the MSComm32 Active X control:
MSComm1.Output = Chr$(27) + "M" + "S" + Chr$(13)
Msgbox(MSComm1.Input)
This made the data from the device pop up in a messagebox. I am writing a winforms app in vb.net, using VS2005. I have a form, on which I have a Placed a SerialPort control, named sp. My sample code is as follows:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e
[CODE]...
This returns the error message "Error: expecting a command". I have done som tests in HyperTerminal, and have concluded with:
-If I dont send <esc>, I get error "Expecting a command"
-If I send wrong command (ie MD instead of MS) i get error "Bad command"
Based on this, I suspect that I don't pass the escape character correctly to my device. So I wonder how to do this?
A Problem in accessing a device from VB Windows cannot load the device driver for this hardware because there is a duplicate device already running in the system. (Code 42) This error is because i am using 2 devices of the same company which has the mass usb storage on it and when i install one of the device the other hides. So one is detected the Other is not. It also give a error called designed dragnonacally something...
[code]I have this XML file, how do i get the ID attribute? this question is not about "how to get attributes in xml's", i've found several solutions, but somehow i can't address to this specific attribute in this specific node.i can get info inside tables that are within "infNF" and i'm loading it into a dataset and using this code: ds.Tables(Table).Rows(row)(node)is there a similar way to do what i want to get THIS attribute?
I have a question that relates to identifying words or characters in text boxes.Okay, I know that I can identify the entire text with textbox1.text = "~~~~". But say I want to search for a specific part.e.i.(in textbox)Hello, how are you?(in textbox)How, in code, would I find and select, let's say, the word "how"?Please, if you can help, I need it. I want to learn as much as I can about Visual Basic so I can become a better programmer.
My VB.NET (3.5) application generates Excel reports. Newer versions of Excel support the Office Open XML file format, while older versions don't.
I'd like my application to identify which version of Excel is installed on the local machine, and use a different method for generating the report (Newer versions: by generating an XML file. Older versions: by utilizing Excel Automation).
How can I identify the Excel version installed on the local machine?
The basic question is can I assign a variable to represent a control? As an example which of 12 tickBoxes have been ticked. Is this possible with a for next loop?
Is there an automated tool for VB.Net that will identify all global variables in a project?Short of that, is there any scripts that can be used that will facilitate a manual review of global variables?There seems to be tools for C/C++, but not for VB.Net:Tools to find global/static variables in C codebases there a tool to list global variables used and output by a C function?
EDIT: My current approach uses the following VS REGEX searches: For finding global variables:
In the dgv_CellEndEdit event I know I can find which cell I'm in by the "CurrentCell.ColumnIndex" property. I'd like to be able to check the current column name. If I use "columnIndex" and a column is added or deleted this could cause errors.
I have a table of data exported to an Excel file that contains a Date/Time Field. The entries in the table are formatted like 01/01/2009 14:00 (military time). Every line in the table contains unique information that is specific to that particular date/time information, 1800 lines of data (the reason that I dont want to hand sort this table). How can I identify the items in the table that fall after a particular time of day? More specifically, I need to identify which of the data fields have a time after 14:00 on that particular day.
What conditional statement is used to identify if username.text is empty or password.text is empty or both is empty then prompt a msgbox that tells what part is empty. My attempt was bad and my first time to use select case. [code]
I've been trying to complete a program that I have to write for a class but keep getting an error that when double clicked, takes me to the Application.Designer.vb screen. The error that shows up in the Error List is "Employee' is a type in 'WindowsApplication1' and cannot be used as an expression." The resources I've tried to use (book and web) have been no help. Does anyone know what needs to be done to correct this error so I can test my program and correct any other possible errors? I can also provide the code for the program, if that will be any help. Here is the code that shows up in the Designer window:
My issue is regarding overloaded functions of the already provided IIf function that would handle specific types. As you all know the IIf function provided returns objects, rather a specific type so for my needs I created a few overloaded function to do just that but with a specific type in mind. So having said I have IIf functions for types of booleans, strings, bytes, integers, etc etc.
Now my problem is when I'm trying to pass a byte value to this function that would return one of the two byte values. When I do this the designer keeps confusing my values as an integer value and calls for me to convert it to a byte. If I did this then it would defeat my entire purpose for creating these functions-which is to avoid any conversions. The only way I can solve this is by converting the whole statement itself or the true/false parameter parts individual to specify to the designer that these values are bytes. I'm just hoping there's a way of identifying the difference between bytes and integers..
The problem at hand is to search an Access database for "duplicate" street addresses, given user input of street address, city, state, and zip code.Given the zip code, city and state do not need to be looked at.
My thought was to select off records in the database with the zip code that matches the input, then loop through those records, performing a "similarity" test on the street address field as compared to the input street address. Obviously we cannot test for exact matches (i.e. "SW" vs. "South West", etc.). This problem has obviously been solved before with post office software, algorithms used by mapping applications, etc.
But do you have any thoughts on what algorithm I might implement in a VB 2005 app?
I can get the LAN Device Names (using code below) but how do you get those strings from the "Name" column (see image) that the user can change?
' get list of enabled lan card device names Dim cat As New PerformanceCounterCategory("Network Interface") Dim instances As String() = cat.GetInstanceNames() For Each instance As String In instances Debug.WriteLine(instance) Next
I`m working on a project where i have connected a FPGA chip to the PCI bus but now i am trying to figure out how to communicate in VB to that device? Normally the device has memory assigned to it in XP (address h00000200 to h0000037F) but i don`t know how to read/Write to that memory directly in VB...
I need to detect a usb device when it is connected to PC.I found next code that is working. But it works only with Mass Storage.Imports System.Management
Public Class Form1 Private WithEvents m_MediaConnectWatcher As ManagementEventWatcher Public USBDriveName As String
Device : USB Scanner Application : A Application : B
Let's say there are two applications are running, which are A and B, on windows XP and they all have only one simple form with a text box to receive a data from the scanner. Is it possible to read a number by the scanner and write the number for those two text box on A and B at the same time?
How would a person test to see if a usb device is on? I have a program with a usb reader attached to it and would like to throw an exception if it is not on.
I am trying to write a 'simple' program with vs 2005 that recognises my specific usb memory stick so that I can make windows log off or 'lock' when the device is not in any slot. I have found some ready code and I am trying to modify it for my needs. There compiling works but when it doesnt find any of the usb ports.It works by checking each port if it is a usb port and then compares the vendor and produck ID to the given. it seems simple enough but I cant get it to find the USB.
I'm trying to access a device with modbus in VB or C#. I've been searching all over for a simple way to do it. I know that It would be connecting through a TCP Connection, and I know the address of the device. I need to read the input on it (whether of not it's on), and to toggle the relay on it as well.
I have spent couple of days searching the Internet for some hints, but I haven't succeeded. I need to enumerate all removeable USB storage devices and search for a file. It's important to say, I am looking for a device, which has no drive letter assigned - e.g. Garmin GPS etc.. how to enumerate the devices, indentify storage one and/or access its files?
I have spent couple of days searching the Internet for some hints, but I haven't succeeded.I need to enumerate all removeable USB storage devices and search for a file. It's important to say, I am looking for a device, which has no drive letter assigned - e.g. Garmin GPS etc..
I need to know, how can we attach an USB to any device and detach an USB. I'm using VB 2008 version. I need to write a code for usb detach and attach in windows xp. Whenever usb is detach from the PC side, i should get a message in command prompt saying that, USB is detached and if you insert an USB , then i should get a message saying that, usb attached.
I'm struck which api should use to communicate with usb , to get info such that usb has been attached or detached?