Handling Disconnects Of Hardware In Classes That Represent Them

Jan 26, 2010

I'm working in VB.Net developing data logging software. I've developed classes implementing a common interface that works with many of the data loggers my company produces. These classes handle the low-level hardware interfacing and expose common methods for accessing the data logger's records.

[Code]...

View 1 Replies


ADVERTISEMENT

.net - Event Handling In Classes?

Sep 21, 2011

I'm completely confused about the event handling. I read some articles about it but after it I just get confused to write and use them in my classes.This is my class i. e.:

[Code]..

I dont have any argument passing. But I want to know how should I do it too. And I wanted to know if each instance of the Test class, run this event separately I mean each instance by themselves, This event AnEvent() will occur? Cuz I have lots of instances from my class.

View 2 Replies

Event Handling - Using Classes In DLL In GUI Project?

Mar 11, 2009

I've 2 projects- one containing GUI and another a DLL project containing some implementations. I'm using Classes in DLL in my GUI. All that I wanna do is when some results are manipulated in the DLL, the final output from DLL should be made available in the RichTextBox present in the GUI project. I tried the WithEvents and also Add Handler. But its not working.In the DLL, I added...

Public Event Report(ByVal info As String)
RaiseEvent Report("The folder has been Copied.") In the GUI, I added...
Public WithEvents Log As RTAF_DLL.CServer // RTAF_DLLis the project name.
CServer is the class // in which the event has been writtenLog = New RTAF_DLL.CServer
Protected Sub Log_Report(ByVal info As String) Handles Log.ReportMsgBox(info)
// Even this is not getting printedMe.RichTextBox2.AppendText(info)End Sub

The problem here is I'm not sure whether or not the event is getting raised. But I set a breakpoint and found that the Event is not handled.I tried including Imports System.Runtime.InteropServicesBut its not working.

View 10 Replies

Event Handling Between Two Unlinked Classes

Dec 22, 2010

I'm trying to raise an event in class A and catch it in class B which does not contain class A. Is this possible? [code]

View 10 Replies

VS 2008 Handling Exception In Classes?

Apr 28, 2009

I have the following code in a class of mine. The purpose of this class is to get the balance from a web server. Just in case something goes wrong with getting the balance. I will handle a exception. However, all this is easy to do. But I am left wondering what do I return in my catch statement.

Most of the examples I looked at just write to the console using:

Console.WriteLine(ex.Message);

That is all very well. But in a real application what do most developers do?

My function at the moment returns void. And I am just wondering what else I would return if the webclient is busy?

[Code].....

View 1 Replies

VS 2008 Exception Handling In User Classes

Apr 27, 2009

I have to get the balance from the web server. Once that is done it will call back into my main app with the result.However, sometime the web server fails for some unknown reason. Could be high volume of traffic or something else. However, I haven't implemented any exception handling in my class. As the app that uses this handles the exception. However, the client has confirmed that when the web server does fail it displays a unhandled exception dialog box. Then they have to click continue to keep using my application. So below I am not sure if I should implement the exception handling in my class.[code]

View 1 Replies

VS 2008 Know When A TcpClient Disconnects - Event?

Aug 31, 2010

I need to know when a TcpClient disconnects so I can properly free up the socket and process anything in my program that needs to happen when a client disconnects.

View 3 Replies

What Does & H57 Represent And How To Translate It For C#

Jun 1, 2011

I'm trying to convert old VB.NET code into C# and I'm not sure about the current line and what it means really.

[Code]....

View 5 Replies

Use LINQ To Filter Collection Of Nested Classes To Yield Dictionary Of Unique Properties Of Those Classes?

Jan 23, 2012

I have two classes, one nested in the other. [code]Neither "Name" or "ID" are unique between operations and records.I wish to construct a dictionary using LINQ = Dictionary(Of String, Of List(Of Integer), whereby the keys are uniqe examples of Names in my collection and the values are the collective set of distinct IDs that are associated with those names.

View 2 Replies

VS 2010 Structure Classes So That The User Interfaces Though A Single Class While The Supporting Classes Are Hidden From Their View?

Jun 13, 2012

How can I structure my classes so that the user interfaces though a single class while the supporting classes are hidden from their view? I think its best understood in an example:

Public Class MyInterface
Public Economic as EconomicClass
Public Sub New()
MyBase.New()

[code].....

So you might ask why am I even separating them? It's strictly for others who will be working with this interface. I need to funnel them though a logical structure:

interface.Economic.MyMethod
interface.Currency.MyMethod
etc

This way everything is already handled for them in the background and they only need to run the method they need. I don't know if I can have it both ways in VB.NET.

View 23 Replies

How To Represent Unicode Chr Code

Jun 29, 2010

I know you can put unicode character codes in a VB.Net string like this: str = Chr(&H0030) & "More text"..I would like to know how I can put the char code right into the string literal so I can use unicode symbols from the designer view.

View 5 Replies

Represent Backspace In A String?

May 9, 2011

Below is the code I am using to restrict user from entering any other characters except for the predefined ones. But using my code I cannot hit backspace.

How to include backspace also ?

Dim s As String = "0123456789$"
If s.IndexOf(e.KeyChar) = -1 Then
e.Handled = True
End If

View 3 Replies

Store And Represent Data?

May 31, 2011

I'm creating a program that outputs Quotations (and other information relating to these 1. What is the BEST way to read/write from a database (I only really know how to use Access but if XML or SQL would be better, I'm willing to learn). The database needs to be stored and accessed from the same state every time that the program opens. I've tried multiple different ways, both through DataAdapters (in code) to doing it through connecting the database through the Visual Studio GUI. Neither have seemed to work. Other people have told me that using DataAdapters and such aren't the best way, but no one has been able to tell me what this 'best way' is. Also, I need to somehow be able to link pictures in the database - apparently it's not easy to do in SQL?[code]...

View 5 Replies

VS 2010 Calling Subs And Functions Within Classes That Are Within Classes?

Oct 24, 2009

Here is some example code of what I mean:

vb
Public Class Form1
Private Sub Button1_Click(ByVal sender as Object, e as systemEventArgs) Handles Button1.Click

[Code]....

View 5 Replies

Convert Numeric Value To Represent 0 To 1024

Nov 19, 2010

I am reading a pot that has a range of 1000 to -887.I need to convert that numeric value to represent 0 to 1024Where 1000=0 and -887 = 1024.

View 4 Replies

Declare Textboxes Or Labels That Represent Them?

Oct 5, 2009

I have a parcel post assignment, and i have three textboxes that represent height, width, and length. here are my questions1. how do i decalre them as integer? do i decalre the textboxes or the labels that represent them?2. how do i multiply all three together and multiply the total by 4pence and add 20p?

View 6 Replies

How To Represent Data In A Tabular Format

Feb 8, 2012

i can retrieve the data from the DB and put it in a vector and then, vector in a JTable, to display data in a tabular format in java, all i wanted to know is there any similar way in vb dotnet?

View 4 Replies

Set Up A CLASS To Represent A Data Stream?

Apr 1, 2009

I'm trying to set up a CLASS to represent a data stream.This is a newbie question so if the answer is obvious, please excuse me.Several of the data items are multiples which I would normally represent as an Array element.For example, in the code below, the element SolarNameplate has up to 10 instances, so I'd like to use array notation.I get errors, and it doesn't work, so I assume I can't do it like below.

QUESTIONS : 1 - is it possible to use an array element in a class ?

2 - is there another way to achieve what I want ?

Public Class SM1PS01
Private _Projid As String '... name or number of project
Private _LogoFile As String '... file containing customer logo[code]...........

View 18 Replies

Use Pictureboxes To Represent A Variety Of Items?

Jan 14, 2011

I'm pondering a design that will require zooming. My intention was to use pictureboxes to represent a variety of items, and I have the code written to draw on those pictureboxes, as needed. However, there will be many pictureboxes on the form at any one time, though only a portion of them will be visible. That shouldn't be a problem, necessarily, as there isn't any issue with having controls that are not on the visible area of the screen. My issue is that when the user rolls the mouse wheel forward or back, the image will have to scroll in or out, which means that the location and size of the pictureboxes will have to scale relative to the point where the mouse is located.

Technically, this would be more easily accomplished using graphics directly, since I can use ScaleTransforms and...uh...one other, to do the scaling. However, I would prefer to stick with the pictureboxes because I will be doing lots of drag and drop work with them (dragging things into and out of them), and that code is already written. If I were to change that to use rectangles and circles drawn dynamically and scaled dynamically, I'd have to use some kind of hit testing to figure out which object I dragged or dropped onto, and where. Therefore, switching away from pictureboxes would require a fair amount of recoding. There really shouldn't be a problem scaling and translating the controls on the form, but rather than writing the math behind that, I was wondering if there were any built-in tools that will do it for me or will help with the process.

View 9 Replies

Variable To Represent Generic Dictionaries?

Mar 2, 2010

In a tic tac toe game I'm working on I have 2 dictionaries (plyrPairs and cmptrPairs) In the program there is a procedure that is used numerous times. The procedure varies with the dictionary that it calls. I'd like declare a variable in a sub procedure that will represent these two different dictionaries. Here is what I have:

Here are the two enumerations:

vb.net
' Assign values to player pairs enumeration
Private Enum plyrPairsList
empty = 0

[Code].....

View 5 Replies

Data Structure To Represent Bookable Timeslots

Apr 27, 2009

What suggestions do people have for a timeslot data structure? I have a number of activities and I'm planning to display them in a datagrid with days as columns and timeslots as rows. This suggests to me a timeslot data structure with 5 properties for the five days (the columns) for every value I want to use e.g. a timeslot ID and the number of slots left.

So.

Property Day1ID
Property Day1Slots
Property Day2ID
Property Day2Slots
Property Day3ID
Property Day4Slots
etc

Then each TimeSlot structure would be for a specific time. say 9:00 and another for each hour after that. Then I'd have a list of timeslot structures that will auto bind against the datagrid. I'm exploring new ground here and as you can see I'm not very clear on what/how to do it?

View 2 Replies

Each Button To Represent Numbers Like On A Calulator Of Keypad

Aug 10, 2009

I am creating a Point of Sale software for a small company I work for. I am a beginner with Visual Studio and have just stumbled my way around. I have completed the GUI and would like to start assigning code. The problem I am having is assigning numbers to a keypad on the screen. I would like each button to represent numbers like on a calulator of keypad. When these are pressed they need to input into TextBox2.

View 6 Replies

Hexadecimal - Parse The Byte And Represent It With Two Characters Instead Of One?

Mar 25, 2010

i am working with serial communication in vb.i need to know how to get &h1 to be &ho1 to represent the byte o1 in hex or 0000 0001 in binary.i cant remeber how to parse the byte and represent it with two characters instead of one.

View 8 Replies

Derived Classes Cannot Raise Base Classes

Jul 10, 2009

I m trying to raise Click event of Textbox explictly but I m getting "Derived classes cannot raise base classes" error.[code]....

View 1 Replies

Forms :: Creating Checkboxes In A Panel That Represent The Seats?

Jul 6, 2011

I have a theater seating project. I am creating checkboxes in a panel that represent the seats. Each of the rows has a label on it, giving it a row number.When a user clicks one of the check boxes, I need to be able to determine what row the seat was that they clicked on. I then use the row number to determine the price of the seat. I am stumped!! I can't seem to figure out how to get the row number associated with the seat. Here is my where I am configuring the seats:

Private Sub ConfigureSeating()
intTheaterID = CInt(frmTheaterTickets.cboTheater.SelectedItem)
Dim strSQL As String

[code].....

View 5 Replies

How To Format String To Represent Date In Specific Layout

Apr 28, 2009

I'm trying to format a string to represent a date in a specific format using the Format function but it's return odd results.
Here's an example:
Dim s as String = "01/01/2000"
Dim result as String = ""
result = Format(s, "dd-mmm-yyyy")
result equals "dd-mmm-yyyy" (the format string) very strange.

View 2 Replies

Make UserControls To Represent Components Of A Color Formula?

Mar 9, 2009

I have a TableLayoutPanel that is 1 column wide. In it, I make UserControls to represent components of a color formula.When a user chooses a formula on the left, I call "TableLayoutPanel.Controls.Clear" and then using the data from the formula, set the number of rows and create X many new user controls in a loop and TableLayoutPanel.Controls.Add them.

The problem is, if one keeps this screen open and selects through roughly 60 to 70 different formulas, eventually, without warning, the program will crash in an unhandled exception: Error creating window handle. (There is no debugger breakpoint)What's causing this? Is it a disposal problem? Should I be doing something other than TableLayoutPanel.Controls.Clear? Would you handle building the objects differently? I'm including a screenshot of the screen in question (you can see the usercontrols vertically on the right) and the error box that comes up.

View 1 Replies

Represent More Than One Value In Either A Variable Or Single Index Position Of An Array?

May 13, 2010

I have a very large number of tables with data in the following format:

A X Y Z
1 0-2 0-13 0-1
2 3-5 14 2-4
3 6-9 15-16 5-10

In other words, there is a variable (call it A) with a single value that corresponds to a range of values in the other variables (call them X, Y, and Z).My program needs to accept user text input of values of X, Y, Z, etc. and then match each to the corresponding value of A.Example: User enters 4 in the X text box; program determines that if X=4, A=2.Again, we're talking about tables and tables of data in this format. Unaware of a better method, I have been using arrays.

Example:

Dim a() as double = {1,1,1,2,2,2,3,3,3,3...}
Dim x() as double = {0,1,2,3,4,5,6,7,8,9,10...}

Note how I had to artificially deal with variable A so that the index of each score corresponds to the index of the matching X variable.It is this modification of the variables that is taking forever. There has to be a better way! Hypothetically, what I need is the ability to do something like this:

Dim a() as double = {1,2,3,4...}
dim x() as double = {0 to 2, 3 to 5, 6 to 9...}

Is there a way to represent a range of values at a single index of an array, such as my hypothetical example above? This would save me hours of re-shaping the data to make the arrays work.

View 6 Replies

Clone Icons In A Folder And Represent The Files In A Listview On A Form?

Jun 16, 2009

I have a program where I'm trying to clone icons in a folder and represent the files in a listview on a form. I've tried using msdn, google and F1 help to figure this out, but I don't seem to be getting it.Here's the code I have so far, but I'm getting error that object not set to an instance of the object.

[Code]...

View 1 Replies

Create A Virtual Piano Using Pictureboxes To Represent Keys That Play .wav File Versions Of Notes

Nov 5, 2011

I'm trying to create a virtual piano using pictureboxes to represent keys that play .wav file versions of notes. I've gotten this to work fine; however, I'm having trouble with two features I want to implement.The first feature is to be able to save what I play in a text file. I thought I could use this code but I'm getting an error. [code] The second feature is to play random keys using the random class. Is there any way I could store the pictureboxes in an array and then use the random class?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved