VS 2005 Changing Structure Of Code?
Jun 24, 2009
How do I change the program path '"logic.txt", "G:"' in the code below to theOpenFileDialog.FileName? Cos when I tried it, I receive String conversion errors and I tried altering the codes but it didn't work out well
vb.net
Sub Button1Click(ByVal sender As Object, ByVal e As EventArgs)
Dim sb As New StringBuilder(260)
[code]......
View 1 Replies
ADVERTISEMENT
Nov 25, 2009
I have some structures and I change the data inside a loop. This works ok. But as soon as the method ends, all values in the structure are reset???
Heres my
Private Sub ReadDevice(ByRef device As Device)
Console.WriteLine(" Reading device " & Device.name)
Dim data As Short
[Code].....
View 5 Replies
Feb 8, 2011
I have created a Class Library (dll) with a module and a class in it.The module declares a structure, and an instance of this structure.In the class, there is an arraylist declared.My main program calls a function in the class library class. The class calculates data, stores it in the instanceof structure. Then adds it to the arraylist.When i want to use this data in my main program, i get a Cast void error. Its because The structure of the data in the array if of the structure in Class Library module. Is there a way to change the structure of this array to an identicle structure in the main programs Module. When the function returns the arraylist I have tried storing it in a tmp arraylist and copying, cloning etc the data into another arraylist in my main program. still not working. Do i have to loop through all the data and copy each value to a new instanceofstructure, and store this in the new arraylist?
View 3 Replies
Apr 6, 2011
I have a question that I really hope someone can shed some light on for me, as this is driving me crazy trying to figure this out. Consider this code..
'declare and allocate
Dim lstNumbers As New List(Of Integer)
Dim nCount As Integer
[code]....
View 4 Replies
Aug 27, 2010
How do I change the program path '"logic.txt", "G:"' in the code below to the OpenFileDialog.FileName? Cos when I tried it, I receive String conversion errors and I tried altering the codes but it didn't work out well. [code]...
View 1 Replies
Mar 26, 2009
I am once again struggling with my weekly project. I am assigned to write a program that converts a predetermined english sentence to both french and german. The code is to contain an Array and a structure. Also we have not covered retrieving array data from a TXT file, so we are to hard code in the array data. I coded the structure and the array, I added the array data, but am confused how to access the data. The examples I have found all deal with retrieving data from a TXT file. Can someone give me a nudge in the right direction.[code]....
View 3 Replies
Mar 13, 2009
I am trying to return a structure from a class.vb file to an aspx page. Is this possible, if so how would you do it in the aspx page and the class.vb file?
View 1 Replies
Jan 28, 2011
5 records to add
Try
Do While
Insert Statement
[code]....
When i get an error concerning duplicated values found, it just catch the sqlexception, display a message and exit try. But i want it to continue adding the remaining record even when a record of duplicated values is found.
View 10 Replies
Aug 20, 2011
Can any one show me how to type cast a structure , when passed as thread parameter
View 7 Replies
Jul 7, 2009
I'm running around a problem I can't figure out. In my application I have to usethen MAPIInitialize function to initialize the MAPI32 and doing some work ...
<DllImport("MAPI32.DLL", CharSet:=CharSet.Ansi)> _
Private Function MAPIInitialize(ByVal lpMapiInit As IntPtr) As Integer
End Function
[code]....
View 2 Replies
Nov 26, 2011
Well... I'd like to ask you a question that makes me crazy...Could I create an array of structure and later delete a value from that?For Example I have a structure called "Examples". I create an array of structure and insert 3 values (whatever). Then, I want to delete the value in the position 2 (which real position is 1 [0, 1, 2]). Could I do that?
View 2 Replies
Dec 22, 2009
I want my function to return a value of a structure. The function is supposed to change the values and then return the answers in one structured value. Here is my code... as you can see it does not work... it needs a LOT of things. I placed question marks were i am really lost.
[Code]...
View 13 Replies
Mar 11, 2009
I need to send a structure which contains structure to a socket server but i am abit lost here.Structure example
'example of first structure
structure firstStruct
Dim headerName as u
[code].....
View 6 Replies
May 18, 2010
What is the Microsoft Standard for Code Commenting
1. In case of Class 'Class header Comments
2. Function Comments
3. Subroutine Comments
There are different ways to comments like XML Documentation using ///
CODE:
Which Stnd should follow? May be something else other than above?
View 1 Replies
Dec 11, 2009
I am upgrading a project from VB6 to VB.NET. Unfortunately, I cannot include the DLL or even the name of the DLL that I am using here, I am under a confidentiality agreement. However, I hope I can post enough info here to get this frustrating problem solved.
In VB.net: Code:
So, if I run it as such, it errors out while calling SetParameters saying
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
If I comment out the line m_Parameters.SProperties = New S_Properties(9) {...}, then it does not error out, however the function returns 0, which means it did not actually set the parameters to the device. Trying to ReDim SParameters(9) will also give the hresult error. Doing it with my example above, I put a watch on m_Parameters in both VB6 and VB.net and they look IDENTICAL. All data is the same. Why would I get this ArgumentException in VB.NET and not in VB6 when I am passing in the exact same arguments as in VB6?
View 6 Replies
Aug 23, 2010
I have a database structure filled with data that I'm trying to write out to an XML file. Here's a taste of the way the VB code is structured:[code]I can't see or report any progress, because the processing is all tied to one giant LINQ query. Even if I can't make it any faster, I'd like to know how much longer I have to wait. My first version of this code had For loops instead of queries, so I could display progress, but it took a loot longer.Obviously I'd like to speed this up considerably. It seems like there should be a simpler way to convert the data to an XML file, especially since the database structure was created from the XSD in the first place.
View 1 Replies
Feb 2, 2009
I'm trying to write a short program to for work but I'm not quite sure how to structure the code. This is what I currently have;[v
I'm pity sure this is majority the wrong way to structure it as at crashes with the IF/ELSE field going up to around 50000, but it does work (if a little sluggishly) when set to 5000.[code].....
View 13 Replies
Mar 20, 2009
, I was wondering if it was possible to reference a member of a structure by using a string variable. Here's an example of what i'm talking about:
[Code]....
Now, I know that you would usually reference the value in any of the members by using the following (String1 in this case)
[Code]....
View 4 Replies
Aug 28, 2009
I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.[code]
View 6 Replies
Mar 9, 2009
I'm currently trying to make a vocabulary/flash-card program so I want an array that can store multiple values per item. That way I can shuffle the "cards" (array items) while keeping the word, definition, and part of speech on the same "card". So if I where to access the array I would want to be able to do something like this:
Dim vocabList as VocabArray
vocabList(0).Word = "blah"
vocabList(0).Definition = "blah"
vocabList(1).Definition = "blah"
And then if I where to re-arrange them the properties would remain together but just in a different spot of the array.I can get really close to this using an Item Structure and declaring the variable name with () but the problem is I have to include a number with () and I need to be able to add infinite values to the array, I can't have a set number.Also I would prefer to make it like an ArrayList as it has .Add, .RemoveAt, .Insert etc. In normal Arrays there's no easy way to add, you have to resize and stuff.
Anyways here's close to what I want, but I can't have a set amount and I'd prefer the ArrayList structure so I can just have like Array.Add and then have a Item added onto the end with 3 variables on it. The only thing is that with .Add you usually put something in paranthesis after it to denote the value to add, but if I have 3 possible values then I would have to have parameters for it or something, like .Add(Word, Definition).
Structure SpecialArrayList
Public Property1 as String
Public Property2 as String
[code]....
View 6 Replies
Jul 3, 2010
Using This code from an old post of mine how could i change it to label1 label2.[code]
View 10 Replies
Mar 13, 2009
Here is the:
Imports System.Data.OleDb
'Add reference to Access then
Imports Microsoft.Office.Interop
Imports Microsoft.VisualBasic
[CODE]...
I am using this to copy tables in an Access database(2003). the questions I have are:
1. How can I make this more 'obejct oriented'?
2. How can I copy just the structure of the tables and not the data?
(Currently both are occuring)
View 3 Replies
Sep 21, 2009
Just suppose that I define a structure, and an array such as
Structure Person
Dim First_Name as String
Dim Last_Name as String
[code]....
Can I fill in my list of people using a single line of code for each record? Something like this, it doesn't work, but this shows the sort of thing I mean.
My_List(0) = {'John', 'Smith', 24, '555-1234'}
My_List(1) = {'George', 'Jones', 31, '555-8123'}
My_List(2) = {'Tom', 'Green', 40, '555-3434'}
It's easy enough to fill it in line by line. I could do that without problem. But I want to be able to look at the code and see the contents of each line. Doing it as above would make it easier to read.I could make it a multidimensional array of strings, rather than a structure.If it makes any difference I'm using Visual Basic 2005 Express Edition.
View 8 Replies
May 10, 2010
i have the code bellow to write a structure to a text file, but nothing is happening,how can i get a error message if the file doen't exist?
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
Public Class Form1
[code]....
View 1 Replies
Apr 24, 2012
if its possible could i temporarily change the inner code of a program instead of using a timer or multiple buttons ex: i have a BUTTON1 set to open a webpage like [URL]how be able to do something like this
Private Sub BUTTON2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
if textbox1.text=1 then
button1.code=me.close
[code]....
View 9 Replies
Sep 18, 2010
iv been looking at this code and basically what the code does it runs a report every month, but I want to make some changed to it i.e. how its laid out within the PDF document for testing this I don�t want to run the hole report because it will take forever as you can see it starts lowerDate = "01/JAN/1900" And for testing ideally I just want to run last month so am I right in saying if I change the date from 1990 to 1/8/2010 and then change upperDate = Format(Date.Now, "dd/MMM/yyyy") TO upperDate = Format(Date.Now, "31/08/2010") would that work?
Imports MSXL = Microsoft.Office.Interop.Excel
Imports System.Configuration.ConfigurationManager
Imports System.Xml
[code]....
View 3 Replies
Mar 5, 2012
Anyway this is my code right now so I am not blank.Code removed.Not sure if it is very hard to understand but I am currently working on a project and what this code does is finds a blue ball on thewhole screen then moves the cursor position on the blue ball it just found.If it doesn't find it, will show a msgbox Quite simple.
View 12 Replies
Jun 29, 2009
I want to change the font of text in rtb using code, not thru font dialog. e-g if i want to write all lowercase letters in "Arial" and all uppercase letters in "Times New Roman" then how can i do that. i hav tried using Text1.Font = New Font("Arial", 36, FontStyle.Regular) but it changes the font of whole text.
View 3 Replies
Mar 7, 2012
i have been trying to figure out auth system and after tons of researching and asking questions, I found a tutorial that "almost" fits my needs. This is what the code does:Basically a new form is created with a textbox and a connect button on it. When the program is loaded, the textbox has your hardware ID on it (also known has HWID). Then it looks for that HWID on a text file of the link given [URL] in this case as an example. If that HWID is found on that text file, then it leads you to form2 which is an actual program and if not, form1 closes meaning you have no access to anything at all. A basic authentication system and here is the code for it:
Imports System.IO
Imports System.Management
Public Class Form1
[code]....
View 1 Replies
Aug 8, 2009
I have to turn the GetFwt function on the code into a sub procedure. Below is the original
' Project name: Harvey Industries Project
' Project purpose: The project calculates an employee's weekly net pay.
' Created/revised: <your name> on <current date>
[Code]....
View 1 Replies