473,732 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listbox error

Hi,

I have created a listbox called "dtlist1" on my VB.NET form. I call a
procedure as follows:

Private Sub openfile(flname As String)

dtlist1.Items.C lear()

etc..

End Sub

and I get the error message: "Exception System.IndexOut OfRangeExceptio n
was thrown in debugee: Index was outside the bounds of the array."

Why is this?

I even try adding:

dtlist1.Items.A dd("this is the first line of the listbox")

before the .Items.Clear() and it doesn't help! I then get the same
error message on the .Items.Add line.

Can anyone suggest?

Thanks,
Alex

May 17 '06 #1
3 2297

"Ali Chambers" <in**@alexchamb ers.co.uk> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
Hi,

I have created a listbox called "dtlist1" on my VB.NET form. I call a
procedure as follows:

Private Sub openfile(flname As String)

dtlist1.Items.C lear()

etc..

End Sub

and I get the error message: "Exception System.IndexOut OfRangeExceptio n
was thrown in debugee: Index was outside the bounds of the array."

Why is this?

I even try adding:

dtlist1.Items.A dd("this is the first line of the listbox")

before the .Items.Clear() and it doesn't help! I then get the same
error message on the .Items.Add line.

Can anyone suggest?

Thanks,
Alex

Several questions:
1. What version and edition of "VB.NET" are you using?
2. Is this a Windows app or a web app (use of the term "form" vs. "page"
implies a Windows app, but best to be sure)?
3. Where is your sub declared, in the form class or in a different class?
4. Are you referring to a list box added to a form in design mode, or to a
list box object created in code?

I tried scenarios similar to the one you describe on both VS 2003 and VS
2005, placing my sub in the form class in Windows apps, referencing a list
box created in the GUI designer. I'm unable to replicate your issue.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
May 17 '06 #2
Hi Peter,

I'm using SharpDevelop2.0 - a free open source IDE for VB.NET. My
project is a windows app and I'm referring to listboxes created in
design mode.

My code is as follows, if that would help:

** START **

Imports System
Imports System.Drawing
Imports System.Windows. Forms
Imports Microsoft.Visua lBasic
Imports System.IO
Imports System.Collecti ons

Namespace MA_tester

Public Class MainForm
Inherits System.Windows. Forms.Form
Private dtlist1 As System.Windows. Forms.ListBox
Private openlist1 As System.Windows. Forms.ListBox
Private lowlist1 As System.Windows. Forms.ListBox
Private groupBox3 As System.Windows. Forms.GroupBox
Private button3 As System.Windows. Forms.Button
Private groupBox1 As System.Windows. Forms.GroupBox
Private filelist1 As System.Windows. Forms.ListBox
Private textBox8 As System.Windows. Forms.TextBox
Private mult As System.Windows. Forms.ListBox
Private newhighlist As System.Windows. Forms.ListBox
Private textBox5 As System.Windows. Forms.TextBox
Private textBox4 As System.Windows. Forms.TextBox
Private newlowlist As System.Windows. Forms.ListBox
Private closelist1 As System.Windows. Forms.ListBox
Private highlist1 As System.Windows. Forms.ListBox
Private newcloselist As System.Windows. Forms.ListBox
Private newdatelist As System.Windows. Forms.ListBox
Private checkBox1 As System.Windows. Forms.CheckBox
Private label6 As System.Windows. Forms.Label
Private label5 As System.Windows. Forms.Label
Private newopenlist As System.Windows. Forms.ListBox
Private flnn As System.Windows. Forms.ListBox
Private spread As System.Windows. Forms.ListBox

Public sourcedir As String
Public destdir As String
Public fln As String
Public spreadpoint,mul tiplier As Single

' ARRAYS FOR PRICE DATA
Public high(1) As Single
Public low(1) As Single
Public open(1) As Single
Public close(1) As Single
Public pricedate(1) As String
Public priceitems as Integer

' DECLARE CONSTANTS
Public startdate As Integer
Public DMIShort As Integer = 4
Public DMILong as Integer = 14
Public Shared Sub Main
Dim fMainForm As New MainForm
fMainForm.ShowD ialog()
End Sub

Public Sub New()
MyBase.New
'
' The Me.InitializeCo mponent call is required for Windows Forms
designer support.
'
Me.InitializeCo mponent
'
' TODO : Add constructor code after InitializeCompo nents
'
End Sub

#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The
Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeCompo nent()
Me.spread = New System.Windows. Forms.ListBox
Me.flnn = New System.Windows. Forms.ListBox
Me.newopenlist = New System.Windows. Forms.ListBox
Me.label5 = New System.Windows. Forms.Label
Me.label6 = New System.Windows. Forms.Label
Me.checkBox1 = New System.Windows. Forms.CheckBox
Me.newdatelist = New System.Windows. Forms.ListBox
Me.newcloselist = New System.Windows. Forms.ListBox
Me.highlist1 = New System.Windows. Forms.ListBox
Me.closelist1 = New System.Windows. Forms.ListBox
Me.newlowlist = New System.Windows. Forms.ListBox
Me.textBox4 = New System.Windows. Forms.TextBox
Me.textBox5 = New System.Windows. Forms.TextBox
Me.newhighlist = New System.Windows. Forms.ListBox
Me.mult = New System.Windows. Forms.ListBox
Me.textBox8 = New System.Windows. Forms.TextBox
Me.filelist1 = New System.Windows. Forms.ListBox
Me.groupBox1 = New System.Windows. Forms.GroupBox
Me.button3 = New System.Windows. Forms.Button
Me.groupBox3 = New System.Windows. Forms.GroupBox
Me.openlist1 = New System.Windows. Forms.ListBox
Me.lowlist1 = New System.Windows. Forms.ListBox
Me.dtlist1 = New System.Windows. Forms.ListBox
Me.groupBox1.Su spendLayout
Me.groupBox3.Su spendLayout
Me.SuspendLayou t
'
'spread
'
Me.spread.Locat ion = New System.Drawing. Point(326, 201)
Me.spread.Name = "spread"
Me.spread.Size = New System.Drawing. Size(56, 17)
Me.spread.TabIn dex = 47
Me.spread.Visib le = false
'
'flnn
'
Me.flnn.Locatio n = New System.Drawing. Point(104, 118)
Me.flnn.Name = "flnn"
Me.flnn.Size = New System.Drawing. Size(40, 4)
Me.flnn.TabInde x = 48
Me.flnn.Visible = false
'
'newopenlist
'
Me.newopenlist. Location = New System.Drawing. Point(80, 10)
Me.newopenlist. Name = "newopenlis t"
Me.newopenlist. Size = New System.Drawing. Size(64, 4)
Me.newopenlist. TabIndex = 13
Me.newopenlist. Visible = false
'
'label5
'
Me.label5.Locat ion = New System.Drawing. Point(8, 16)
Me.label5.Name = "label5"
Me.label5.Size = New System.Drawing. Size(168, 10)
Me.label5.TabIn dex = 34
Me.label5.Text = "Start date (mmyyyy) - 0 = start"
'
'label6
'
Me.label6.Locat ion = New System.Drawing. Point(8, 31)
Me.label6.Name = "label6"
Me.label6.Size = New System.Drawing. Size(160, 10)
Me.label6.TabIn dex = 35
Me.label6.Text = "End date (mmyyyy) - 0 = end"
'
'checkBox1
'
Me.checkBox1.Lo cation = New System.Drawing. Point(16, 102)
Me.checkBox1.Na me = "checkBox1"
Me.checkBox1.Si ze = New System.Drawing. Size(168, 10)
Me.checkBox1.Ta bIndex = 49
Me.checkBox1.Te xt = "Convert data to weekly first"
'
'newdatelist
'
Me.newdatelist. Location = New System.Drawing. Point(8, 10)
Me.newdatelist. Name = "newdatelis t"
Me.newdatelist. Size = New System.Drawing. Size(64, 4)
Me.newdatelist. TabIndex = 12
Me.newdatelist. Visible = false
'
'newcloselist
'
Me.newcloselist .Location = New System.Drawing. Point(152, 10)
Me.newcloselist .Name = "newcloseli st"
Me.newcloselist .Size = New System.Drawing. Size(64, 4)
Me.newcloselist .TabIndex = 14
Me.newcloselist .Visible = false
'
'highlist1
'
Me.highlist1.Lo cation = New System.Drawing. Point(232, 26)
Me.highlist1.Na me = "highlist1"
Me.highlist1.Si ze = New System.Drawing. Size(16, 4)
Me.highlist1.Ta bIndex = 11
Me.highlist1.Vi sible = false
'
'closelist1
'
Me.closelist1.L ocation = New System.Drawing. Point(160, 26)
Me.closelist1.N ame = "closelist1 "
Me.closelist1.S ize = New System.Drawing. Size(16, 4)
Me.closelist1.T abIndex = 10
Me.closelist1.V isible = false
'
'newlowlist
'
Me.newlowlist.L ocation = New System.Drawing. Point(296, 10)
Me.newlowlist.N ame = "newlowlist "
Me.newlowlist.S ize = New System.Drawing. Size(64, 4)
Me.newlowlist.T abIndex = 16
Me.newlowlist.V isible = false
'
'textBox4
'
Me.textBox4.Loc ation = New System.Drawing. Point(168, 16)
Me.textBox4.Nam e = "textBox4"
Me.textBox4.Siz e = New System.Drawing. Size(64, 21)
Me.textBox4.Tab Index = 36
Me.textBox4.Tex t = "textBox4"
'
'textBox5
'
Me.textBox5.Loc ation = New System.Drawing. Point(168, 31)
Me.textBox5.Nam e = "textBox5"
Me.textBox5.Siz e = New System.Drawing. Size(64, 21)
Me.textBox5.Tab Index = 37
Me.textBox5.Tex t = "textBox5"
'
'newhighlist
'
Me.newhighlist. Location = New System.Drawing. Point(224, 10)
Me.newhighlist. Name = "newhighlis t"
Me.newhighlist. Size = New System.Drawing. Size(64, 4)
Me.newhighlist. TabIndex = 15
Me.newhighlist. Visible = false
'
'mult
'
Me.mult.Locatio n = New System.Drawing. Point(56, 118)
Me.mult.Name = "mult"
Me.mult.Size = New System.Drawing. Size(40, 4)
Me.mult.TabInde x = 46
Me.mult.Visible = false
'
'textBox8
'
Me.textBox8.Loc ation = New System.Drawing. Point(8, 159)
Me.textBox8.Mul tiline = true
Me.textBox8.Nam e = "textBox8"
Me.textBox8.Siz e = New System.Drawing. Size(384, 27)
Me.textBox8.Tab Index = 40
Me.textBox8.Tex t =
""&Global.Micro soft.VisualBasi c.ChrW(13)&Glob al.Microsoft.Vi sualBasic.ChrW( 10)&"destdir="" C:\Documents
and Settings\Alex
Chambers\Deskto p\F_output"""&G lobal.Microsoft .VisualBasic.Ch rW(13)&Global.M icrosoft.Visual Basic.ChrW(10)& "sourcedir= """&
_
"C:\Documen ts and Settings\Alex Chambers\Deskto p\Forex historical"""
Me.textBox8.Vis ible = false
'
'filelist1
'
Me.filelist1.Lo cation = New System.Drawing. Point(388, 201)
Me.filelist1.Na me = "filelist1"
Me.filelist1.Si ze = New System.Drawing. Size(20, 17)
Me.filelist1.Ta bIndex = 51
Me.filelist1.Vi sible = false
'
'groupBox1
'
Me.groupBox1.Co ntrols.Add(Me.d tlist1)
Me.groupBox1.Co ntrols.Add(Me.b utton3)
Me.groupBox1.Co ntrols.Add(Me.c heckBox1)
Me.groupBox1.Co ntrols.Add(Me.f lnn)
Me.groupBox1.Co ntrols.Add(Me.m ult)
Me.groupBox1.Co ntrols.Add(Me.g roupBox3)
Me.groupBox1.Co ntrols.Add(Me.n ewlowlist)
Me.groupBox1.Co ntrols.Add(Me.n ewhighlist)
Me.groupBox1.Co ntrols.Add(Me.n ewcloselist)
Me.groupBox1.Co ntrols.Add(Me.n ewopenlist)
Me.groupBox1.Co ntrols.Add(Me.n ewdatelist)
Me.groupBox1.Co ntrols.Add(Me.h ighlist1)
Me.groupBox1.Co ntrols.Add(Me.c loselist1)
Me.groupBox1.Co ntrols.Add(Me.o penlist1)
Me.groupBox1.Co ntrols.Add(Me.l owlist1)
Me.groupBox1.Lo cation = New System.Drawing. Point(8, 6)
Me.groupBox1.Na me = "groupBox1"
Me.groupBox1.Si ze = New System.Drawing. Size(400, 133)
Me.groupBox1.Ta bIndex = 0
Me.groupBox1.Ta bStop = false
'
'button3
'
Me.button3.Loca tion = New System.Drawing. Point(304, 97)
Me.button3.Name = "button3"
Me.button3.Size = New System.Drawing. Size(80, 15)
Me.button3.TabI ndex = 50
Me.button3.Text = "GO!"
AddHandler Me.button3.Clic k, AddressOf Me.Button3Click
'
'groupBox3
'
Me.groupBox3.Co ntrols.Add(Me.t extBox5)
Me.groupBox3.Co ntrols.Add(Me.t extBox4)
Me.groupBox3.Co ntrols.Add(Me.l abel6)
Me.groupBox3.Co ntrols.Add(Me.l abel5)
Me.groupBox3.Lo cation = New System.Drawing. Point(8, 41)
Me.groupBox3.Na me = "groupBox3"
Me.groupBox3.Si ze = New System.Drawing. Size(384, 51)
Me.groupBox3.Ta bIndex = 44
Me.groupBox3.Ta bStop = false
Me.groupBox3.Te xt = "Universal settings"
'
'openlist1
'
Me.openlist1.Lo cation = New System.Drawing. Point(88, 26)
Me.openlist1.Na me = "openlist1"
Me.openlist1.Si ze = New System.Drawing. Size(16, 4)
Me.openlist1.Ta bIndex = 6
Me.openlist1.Vi sible = false
'
'lowlist1
'
Me.lowlist1.Loc ation = New System.Drawing. Point(304, 26)
Me.lowlist1.Nam e = "lowlist1"
Me.lowlist1.Siz e = New System.Drawing. Size(24, 4)
Me.lowlist1.Tab Index = 4
Me.lowlist1.Vis ible = false
'
'dtlist1
'
Me.dtlist1.Loca tion = New System.Drawing. Point(254, 26)
Me.dtlist1.Name = "dtlist1"
Me.dtlist1.Size = New System.Drawing. Size(24, 17)
Me.dtlist1.TabI ndex = 52
Me.dtlist1.Visi ble = false
'
'MainForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 14)
Me.ClientSize = New System.Drawing. Size(416, 230)
Me.Controls.Add (Me.filelist1)
Me.Controls.Add (Me.groupBox1)
Me.Controls.Add (Me.textBox8)
Me.Controls.Add (Me.spread)
Me.MaximizeBox = false
Me.Name = "MainForm"
Me.StartPositio n =
System.Windows. Forms.FormStart Position.Center Screen
Me.Text = "Moving Average Tester"
AddHandler Closed, AddressOf Me.Form1OnClosi ng
AddHandler Load, AddressOf Me.Form1Load
Me.groupBox1.Re sumeLayout(fals e)
Me.groupBox3.Re sumeLayout(fals e)
Me.groupBox3.Pe rformLayout
Me.ResumeLayout (false)
Me.PerformLayou t
End Sub
#End Region

Private Sub Button3Click(se nder As System.Object, e As
System.EventArg s)

Dim sa,sb,sc,arinpu t(),a As String
dim rr as integer
filelist1.Items .clear()
destdir="C:\Doc uments and Settings\Alex Chambers\Deskto p\F_output"
sourcedir="C:\D ocuments and Settings\Alex Chambers\Deskto p\Forex
historical"
flnn.Items.clea r()
mult.Items.clea r()
spread.Items.cl ear()
Dim oFile as System.IO.File
Dim oRead As System.IO.Strea mReader
oRead = oFile.OpenText( sourcedir+"\MA_ config.txt")
a = oRead.ReadLine( )

a = oRead.ReadLine( )
a = oRead.ReadLine( )
a = oRead.ReadLine( )
a = oRead.ReadLine( )

While oRead.Peek <> -1

a = oRead.ReadLine( )
arinput = a.Split(",")

' Convert weird date to recognised

flnn.Items.Add( arinput(0))
mult.Items.Add( arinput(1))
spread.Items.Ad d(arinput(2))
End While
oRead.Close()
' Now read in files

Dim fso
fso = CreateObject("S cripting.FileSy stemObject")

If fso.FolderExist s(destdir) = True then

' Delete all files in destination folder, then create it

fso.DeleteFolde r(destdir)
fso.CreateFolde r(destdir)

' Now get a list of all files in the folder

If fso.FolderExist s(sourcedir) = True then

Dim d() As String
d = System.IO.Direc tory.GetFiles(a ddslashtoend(so urcedir))
Dim en As System.Collecti ons.IEnumerator
en = d.GetEnumerator
While en.MoveNext
filelist1.Items .Add(CStr(en.Cu rrent))
End While

' Now loop for each file in directory found

If filelist1.Items .Count = 0 Then
MsgBox ("No files found!", vbExclamation, "NOT PROCEEDED")
Else

For rr = 0 To filelist1.Items .Count - 1

sb = filelist1.Items (rr)
sc = instrrev(sb,"." )
sa = instrrev(sb,"\" )
fln = mid(sb,sa+1,(sc-(sa+1)))

if fln<>"MA_config " then openfile (sb)

Next rr

End If
End If
End If
End Sub

Function addslashtoend (a As String)
If mid(a, len(a),1)<> "\" Then
addslashtoend=a +"\"
Else
addslashtoend=a
End If
End Function
Private Sub openfile(flname As String)

Dim i,ed,sd,j As Integer
Dim a, arinput() As String

dtlist1.Items.C lear
closelist1.Item s.clear()
openlist1.Items .clear()
highlist1.Items .clear()
lowlist1.Items. clear()

' Open the file for reading

'************** *************** *************** *************** ******
' Note FOREX ASCII data file format: "Date","Time"," O","H","L"," C"
' And date is wierd format, so need so convert
'************** *************** *************** *************** ******

Dim oFile as System.IO.File
Dim oRead As System.IO.Strea mReader
oRead = oFile.OpenText( flname)
a = oRead.ReadLine( )

While oRead.Peek <> -1
a = oRead.ReadLine( )
arinput = a.Split(",")

If a <> "" Then

' Date should be in YYYYMMDD format

dtlist1.Items.A dd(arinput(0))

' Then O,H,L,C

' MA formula from FXCHARTS for Forex is calculated as follows:
' Close price for each day
' Count current day then back - 1
' ie. for MA(2), do sum(today and yesterday close prices) / 2

openlist1.Items .Add(arinput(1) ) ' Add OPENING price
highlist1.Items .Add(arinput(2) )
lowlist1.Items. Add(arinput(3))
closelist1.Item s.Add(arinput(4 )) ' Add CLOSING price

End If

End While
oRead.Close()

' Finished reading in file - now closed

spreadpoint = 0
multiplier = 0

For i = 0 To flnn.Items.coun t -1
If fln = flnn.items(i) Then
spreadpoint = val(spread.item s(i))
multiplier = val(mult.items( i))
End If
Next

' NOW OPTIMISE FOR SPEED - READ PRICES INTO AN ARRAY

startdate = DMILong

If trim(textbox4.T ext) = "0" Then
sd = 0
Else
sd = 0
End If

If trim(textbox5.T ext) = "0" Then
ed = closelist1.Item s.Count-1
Else
ed = 0
End If

priceitems = (ed - sd)-1

ReDim high(priceitems )
ReDim low(priceitems)
ReDim open(priceitems )
ReDim close(priceitem s)
ReDim pricedate(price items)

j=0
For i = sd To ed
high(j) = highlist1.Items (i)
low(j) = lowlist1.Items( i)
open(j) = openlist1.Items (i)
close(j) = closelist1.Item s(i)
pricedate(j) = dtlist1.Items(i )
j = j + 1
Next i

dtlist1.Items.c lear()
closelist1.Item s.clear()
openlist1.Items .clear()
highlist1.Items .clear()
lowlist1.Items. clear()

End Sub
Private Sub Form1OnClosing( sender As System.Object, e As
System.EventArg s)
End Sub

Private Sub Form1Load(sende r As System.Object, e As System.EventArg s)
End Sub

End Class
End Namespace

May 18 '06 #3
Alex,

I looked through the code you submitted but don't see a line for
dtList.Items.Cl ear. Where is it? I didn't see it in the constructor.
I know from experience if you try to reference a control in a
constructor before the InitializeCompo nent sub is called you'll get an
error because the component doesn't exist yet.

Dave, MCAD

May 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2417
by: Alex Stevens | last post by:
I'd already posted this in microsoft.public.dotnet.framework.windowsforms and microsoft.public.dotnet.framework.windowsforms.controls to no avail so apologies for the cross-posting. Hi, I'm writing a usercontrol which displays the typical two listboxes and the ability to move items from one to the other. The listboxes are populated with my custom objects (SwapItem), which simply
2
3621
by: JoeHenrich | last post by:
I am using VS.NET 2003 and am having an interesting issue with a Listbox control. Essentially, I have a form with a listbox on it. In the listbox doubleclick event I would like to do some processing and then close the form. However, I receive an error (Cannot access a disposed object named "ListBox".) after my doubleclick code has processed. /* *************************** private void listBox1_DoubleClick(object sender, System.EventArgs...
10
2250
by: yop | last post by:
All When I try to get the text from my listbox I am get an error which is listed below. Any ideas? Thanks Object reference not set to an instance of an object.
2
1355
by: Allan Horwitz | last post by:
When I try to reference the lstproducts.selecteditem.value using autopostback from the lstproducts listbox I get an error? How can I fix my code to get the selected value from the lstproducts listbox? Any help will be appreciated. Sincerely, Allan
4
2458
by: Moe Sizlak | last post by:
Hi There, I am trying to return the value of a listbox control that is included as a user control, I can return the name of the control but I can't access the integer value of the selected item, what do I need to do in order to return the "option value" of the control? Moe !--- returned value of the control
3
4791
by: Joey | last post by:
Hi, I'm trying to add a default item to my listbox but when I do it tells me that it's not defined, could someone tell me the syntax I need to use to get the listbox control to display a default item? I have tried the following: lstStates.Items.Insert(0, new ListItem("By State","0"))
8
2353
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the event. I do have EnableViewState = True for the listbox. I'm imagining (wanting) to populate the listbox named: lstNames by using the DataValueField from lstDepartments. It's quite apparent though that the event is not triggering as I can misname...
7
4531
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but ASP.Net stuff when I need a Windows Form control. I've seen dual listbox populators in countless Windows applications, and have seen them run very fast, so I figured this would be extremely popular. Here's how it should work:
1
4029
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.