MoveMemory, CopyMemory, Fixed Stucture Conversion?
Apr 22, 2010
i use .NET 08 for programming; i have old vb6 application to porting and the only think that i can't convert is moving fixed structure in string using movememory and copymemory.The request is: read a line of sequenzial file, this line is a fixed string concatenation; in vb6 i use movememory to move this string to a tructure with fixed lengh. Then i need the contrary, modify a structure and then move it to a string for writing to a file, in vb6 i use copymemory.
Here a litte example:
Public Type GenType
TmpMsg As String * 1000
End Type
Public Type RxMsgVAL
[code]....
View 1 Replies
ADVERTISEMENT
Apr 9, 2009
I'm trying to access my public structure in a separate module in other forms other then frmMain.
The problem I am running into when I try doing accessing the structure on another question form to update the score, I get a myPlayer not declared.[code]...
View 22 Replies
Apr 12, 2009
i have a problem when I draw a rectangle the sides of the rectangle aren't the same width
I don't know what's wrong this a picture about the problem[URL].. and here is the code
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
[Code]...
View 9 Replies
Sep 25, 2010
I would like a listbox to display a directory structure of a predefined directory in My.Settings.Directory and then be able to select a folder in that list box and click delete to delete the folder.
View 29 Replies
Apr 8, 2009
a user will enter a number, n, which ranges from 1 to 30. they will also enter a "P" or an "S" (sum or product). depending on which was selected, it will calculate the sum or product of the numbers from 1 to n.i'm having a conversion error on line 5 stating "Conversion from string "S" to type 'Double' is not valid." [code]
View 2 Replies
May 11, 2012
I'm creating a program in VB.net that does the following:At a high level I receive a file in email, put the attachment in a monitored folder, import the text file to excel, format the excel, and then email the excel file to a list of recipients.
Here is my plan:
Completed: Outlook VBA to monitor all incoming email for specific message. Once message is received drop attached .txt file in a specific network folder.
Completed: (VB.net) Monitor folder, when text file is added begin processing
Not Complete: (VB.net) Import text file to Excel
Not Complete: (VB.net) Format Excel Text file.(add in a row of data,format column headers with color/size, add some blank columns, add data validation to some of the blank columns that allow drop down selections)
Completed: (VB.net) Save file.
Completed: (VB.net) Send file to list of recipients.
Obviously the items above that are not complete are the bulk of the work, but I wanted to get some advice on what some of you think would be the best way to approach something like this. The import and formatting of the file are causing me some problems because I just can't decide what would be the most efficient way to do this.
The way stated above. Import to excel -> format Having a template excel that contains all of the formatting already done for me and attempting to transition the data to this document (no clue if/how I can do this). Is it even feasible? Have the template already created and then import the text file to a new excel file, then transition that data to the excel template?
Something I thought about, in terms of formatting the document, was to record a macro of me doing all of the formatting that I'm going to need and then attempt to convert that macro into my vb.net code, but I'm not sure if that will work. I will need to verify that the text file comes in the EXACT format every time correct?
View 5 Replies
Aug 31, 2009
Here's 2 questions that I hope someone can help me on. This is in VB.net. I keep on getting this error 'java.io.bufferedInputstream.count is not accessible in this context because it is 'Protected Friend'. Does anyone know how to fix this error?
The other errors i get are "Overload resolution failed because no accessible 'Val' accepts this number of arguments". I have listed below the code that I have coverted from Java. Where is my mistake?'the underlined areas are where it is giving me errors.
[Code]...i
View 7 Replies
Aug 31, 2011
Private Sub XamMenuItem_DeleteClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim selectedRowCount As Integer = Grid.SelectionSettings.SelectedRows.Count
If (Grid.Rows.Count >= selectedRowCount) Then
While Grid.SelectionSettings.SelectedRows.Count > 0
[Code]...
above code throws me a "Collection was of a fixed size".
View 1 Replies
Jul 14, 2010
If I dim an array to say, 5 elements, should it not fail if I go to add a 6th? I thought this used to require a redim. In .NET 2.0, I have a character array of length = 3. When I populate it from the db, one record had 4 characters in it and it successfully added all 4 characters to the array?
View 2 Replies
Apr 15, 2012
i want to set the default value of a combobox in my edit account module based on the levelofaccesstextbox in my login module but my codes doesn't work here's my code:
Private Sub editaccount_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If login.LevelofAccessTextBox.Text = "Student" Then
With Me.ComboBox1.Items
[code]....
View 4 Replies
Apr 22, 2009
trying to convert phonenumber to a fixed lenght of bytes.Example: 30172985 phonenumber is 8 byte. But my hardware wants 32 byte size.How do I automaticly insert 0x00 from 8 byte and upwards to 32? [code]
View 2 Replies
Mar 18, 2010
I have subclassed a control that would be vastly better if it was a certain size. At first, I thought I could simply set the height and width in the constructor. That would annoy people, as the control would be placed on the form at some size, and the size would then shift when the program starts, but it doesn't work anyways because the control constructor is called before the size properties are applied to it. Is there a way to fix the size of a control at design time? The only controls that I can think of that don't have the ability to be sized are pretty highly specialized.
View 3 Replies
Jan 9, 2010
Is it possible for a richtextbox to have a fixed size? For example, 5 would mean that the richtextbox would only show 5 lines at a time.
View 3 Replies
Apr 19, 2010
I have a class file which contains a structure like this.
<StructLayout(LayoutKind.Explicit)> _
Public Structure SampleStructure
<FieldOffset(0)> Public field1 As Int16
[Code]......
View 2 Replies
Oct 29, 2009
I need to check page for an url with a fixed length
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AxWindowsMediaPlayer1.uiMode = "none"
[Code]....
View 9 Replies
Nov 8, 2009
I've make a UserControl and want only buttons can be added to its ControlCollection, if others controls are added, it will throw an exception.
View 4 Replies
May 17, 2012
I am having some problems declaring a fixed lenght string in vb.net. I am studying code for using webcam in vb.net, although the code is from vb6 but I am told it works in dot net. Everyting else seems to be working except this line[url]...
View 3 Replies
May 5, 2009
suppose i am using 1024X768 old resolution but i want to use that form in 600x400resolution,task is that when any part of form goes outside of that specified 600x400 resolution
View 2 Replies
Jul 2, 2011
I have a windows forms project in VS2010 with a simple line chart.The data is dynamic and always ranging between 1.4000 and 1.5000.I want the Y axis's gridlines/labels to always be displayed on every #.##20 data point, as in: [code] So I tried the Interval property for the axis gridlines/ labels, setting it to 0.002, and the result was that the gridlines/labels were displayed every 0.0020 points, like for example this: [code]
but not on 0.0020 points too as shown previously.
View 1 Replies
May 6, 2009
I am aware that this is a visual basic dot net post. However It was extremely simple for me to write out a file in VB6 using lines such as the following snippet
[Code]...
I want basically to export an array A (I used zero based array here) with three columns and a particular value B in fixed widths, hence the @@@@@ which means 5 spaces in to a text file defined by the FreeFNum (FreeFileNumber).
I would like to use CSV and all the other formats but some scientific programs written in FORTRAN may not support them. Anyway my file output here needs to be in this fixed width format because it will be used by proprietary software that I have no access to the source code.
[Code]...
View 3 Replies
Aug 5, 2011
I have files that are one long line of text but are made up of individual segments. I have managed to parse the segments into a string array but now need to parse each segment into its individual fields, based upon a field structure defined by the first 2 characters of the segment.For example:
CA12345ABC999999XXPPPPPPPP55
CA segment (CA is first 2 characters of segment) has fields defined as:
Field Name,Start,Length
[code]....
View 5 Replies
Jun 22, 2010
I am trying to create a function that will take a fixed value, and increment another cell. It does this until another cell using a formula equals the fixed value. You can see what I have below, but this is my first VBA programming ever so I dont know exactly how to declare everything.
Function meetMargin(Margin, calcM, nrc)
Dim x0 As Double, x1 As Double, x2 As Double, t1 As Double
t1 = 0.05
Do While t1 >= 0.01
x0 = Range("Margin").Value
x1 = Range("calcM").Value
[Code] .....
View 1 Replies
Jun 17, 2010
I don't know if I can do this here...but here goes. I want to generate a unique ID of fixed length The trouble is, the code example I found on the web is in C# (or C maybe) which I know nothing about. I tried a web-based C# to VB.net converter but the result doesn't work so its hard to understand what's going on (especially since I have not worked with bytes either this makes it more difficult).
[Code]...
View 5 Replies
Jan 27, 2010
I need to write an application that does the following, and I figured it was a good opportunity to write my first VB.Net application:
1. Get the list of fixed disks in the computer
2. For each disk, recurse through all its directories and sub-directories looking for filenames that match a given regex (eg. MyFile.d{3})
3. If found, hash this file to get a unique ID, eg. MD5 (just to check if this file already exists elsewhere)
4. If this file hasn't already been seen elsewhere on the disk, copy it to a central directory
View 2 Replies
Jan 27, 2010
I need to write an application that does the following, and I figured it was a good opportunity to write my first VB.Net application:
1. Get the list of fixed disks in the computer
2. For each disk, recurse through all its directories and sub-directories looking for filenames that match a given regex (eg.MyFile.d{3})
3. If found, hash this file to get a unique ID, eg. MD5 (just to check if this file already exists elsewhere)
4. If this file hasn't already been seen elsewhere on the disk, copy it to a central directory.
View 2 Replies
Dec 4, 2009
How can I create a fixed row in my DataGridView. I am populating the grid in code row by row.
View 1 Replies
Dec 7, 2005
I've a text file which has some data written. Records have Starting character as "#2" and Ending character as "#3" in ASCII respectively and the file includes series of records, but not written as Line by Line. The difficulty I'm having is, to how to transfer those data's into a database. The File comes a 7mb file and looping character by character then noting down the Record Starting Character and Record ending Character, and finally substring them is not feasible as it take more time and makes the computer slower. I would like to know is there any easy way to transfer them?
View 3 Replies
Nov 28, 2011
I have been a VB user for quite a long time starting from dos-basic types. But only now I encountered with a quite a newb problem :) I tried to search MSDN for it for about a few days and at the end I have to ask this question here because I could not find anything about it.
From time to time I use functions or subs where one parameter is a word from a defined list.
E.g.
private function my_function(byval THE_PARAM as string) as ..........
where THE_PARAM could be "work", "home", "bus", etc. 5 words all together.
How can I define a function so that when I use it on the text of the program I had a hint not just like "THE_PARAM is a string", but I had a choice of those pre-defined words, so I could choose a word from that list.
View 3 Replies
Jun 18, 2010
I'm using vb6 to read lines of txt files, using the code posted in ream.In.Code "Reading a Text file Line by Line". My question is how can I real a line with fixed column width, for example:
qwerty 12345 asdfg
asd 455 hfgdf
qhjkrty 1235 asdfg
The objective is to read each part of the row. In Visual Studio 2010 Beta version the code I present below that is actually working but it doesn't work in VB6.
Using Reader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\teste.txt")Reader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.FixedWidthReader.SetFieldWidths(8, 30, 25, 45, 57)
[code].....
View 2 Replies
Apr 14, 2010
From part of the code below where it say`s "Dim
startDate As DateTime =
New DateTime(2010, 4, 9)"
How can I insert a DateTimePicker, So I can choose a date instead of inserting date (2010, 4, 9)I have done a lot of seaching on this problem with no result.Basicaly I want to use a dateTimePicker instead of a fixed date on my startDate (fisrt date of year).
Private
Sub Timer4_Tick(ByVal sender
As System.Object, ByVal e
As System.EventArgs) Handles Timer4.Tick[code].....
View 4 Replies