473,785 Members | 2,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threaded Bindings don't update

In the following example, the Bindings don't update the UI if the property
change is triggered from the non-UI thread - see the async button - from the
listbox contents (and observation) the change to the object has occurred
correctly; have I got a foobar somewhere, or is this the expected behaviour?
I can "fix" it by adding an additional few lines (follows main code), but
this is ugly; any ideas? And can I get a robust MVP-style UI in a threaded
environment using this binding approach?

Marc

===

using System;
using System.Windows. Forms;
using System.Componen tModel;
using System.Collecti ons.Generic;
using System.Reflecti on;
using System.Threadin g;
using System.Diagnost ics;
namespace TestApp {
static class Program {
[STAThread]
static void Main() {
SomeClass obj = new SomeClass();
using (Form f = new Form())
using(TextBox tb1 = new TextBox())
using (TextBox tb2 = new TextBox())
using (TextBox tb3 = new TextBox())
using (BindingSource bs = new BindingSource() )
using (Button cycleSyncButton = new Button())
using (ListBox lb = new ListBox())
using (Button cycleAsyncButto n = new Button()) {
// debug ougput:
obj.PropertyCha nged += delegate(object sender,
PropertyChanged EventArgs args) {
lb.BeginInvoke( (ThreadStart)de legate { // list property
changes
string message =
string.Format(" {0}={1}",args.P ropertyName,sen der.GetType().G etProperty(args .PropertyName). GetValue(sender ,null));
lb.Items.Insert (0, message);
});
}; // end debug ougput:

cycleSyncButton .Click += delegate { obj.Cycle(); };
cycleAsyncButto n.Click += delegate {
ThreadPool.Queu eUserWorkItem(d elegate { obj.Cycle(); }); };
tb1.Dock = tb2.Dock = tb3.Dock = cycleSyncButton .Dock =
cycleAsyncButto n.Dock = DockStyle.Top;
lb.Dock = DockStyle.Fill;
cycleAsyncButto n.Text = "Cycle Async";
cycleSyncButton .Text = "Cycle Sync";
bs.DataSource = typeof(SomeClas s);
tb1.DataBinding s.Add(new Binding("Text", bs, "Prop1",
true));
tb2.DataBinding s.Add(new Binding("Text", bs, "Prop2",
true));
tb3.DataBinding s.Add(new Binding("Text", bs, "Prop3",
true));
f.Controls.AddR ange(new Control[] {lb, cycleAsyncButto n,
cycleSyncButton , tb3, tb2, tb1 });
List<SomeClassd ata = new List<SomeClass> ();
data.Add(obj);
bs.DataSource = data;
f.ShowDialog();
}
}
}
sealed class SomeClass : INotifyProperty Changed {
public event PropertyChanged EventHandler PropertyChanged ;
private void OnPropertyChang ed(string propertyName) {
PropertyChanged EventHandler handler = PropertyChanged ;
if (handler != null) handler(this, new
PropertyChanged EventArgs(prope rtyName));
}
private string _prop1 = "val1", _prop2 = "val2", _prop3 = "val3";
public string Prop1 {
get { return _prop1; }
set { if (_prop1 != value) { _prop1 = value;
OnPropertyChang ed("Prop1"); } }
}
public string Prop2 {
get { return _prop2; }
set { if (_prop2 != value) { _prop2 = value;
OnPropertyChang ed("Prop2"); } }
}
public string Prop3 {
get { return _prop3; }
set { if (_prop3 != value) { _prop3 = value;
OnPropertyChang ed("Prop3"); } }
}
public void Cycle() {
string temp = Prop1;
Prop1 = Prop2;
Prop2 = Prop3;
Prop3 = temp;
}
}
}

===

additional fixup lines (just after existing PropertyChanged +=):
obj.PropertyCha nged += delegate(object sender, PropertyChanged EventArgs
args) {
if (ReferenceEqual s(sender, bs.Current) && f.InvokeRequire d) {
f.BeginInvoke(( ThreadStart)del egate {
bs.ResetCurrent Item();
});
};
};
Jul 24 '06 #1
5 3852
Hi

If you are updating the UI from another thread you need to use
Control.Invoke, there is no way around it
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Marc Gravell" <ma**********@g mail.comwrote in message
news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
In the following example, the Bindings don't update the UI if the property
change is triggered from the non-UI thread - see the async button - from
the listbox contents (and observation) the change to the object has
occurred correctly; have I got a foobar somewhere, or is this the expected
behaviour? I can "fix" it by adding an additional few lines (follows main
code), but this is ugly; any ideas? And can I get a robust MVP-style UI in
a threaded environment using this binding approach?

Marc

===

using System;
using System.Windows. Forms;
using System.Componen tModel;
using System.Collecti ons.Generic;
using System.Reflecti on;
using System.Threadin g;
using System.Diagnost ics;
namespace TestApp {
static class Program {
[STAThread]
static void Main() {
SomeClass obj = new SomeClass();
using (Form f = new Form())
using(TextBox tb1 = new TextBox())
using (TextBox tb2 = new TextBox())
using (TextBox tb3 = new TextBox())
using (BindingSource bs = new BindingSource() )
using (Button cycleSyncButton = new Button())
using (ListBox lb = new ListBox())
using (Button cycleAsyncButto n = new Button()) {
// debug ougput:
obj.PropertyCha nged += delegate(object sender,
PropertyChanged EventArgs args) {
lb.BeginInvoke( (ThreadStart)de legate { // list
property changes
string message =
string.Format(" {0}={1}",args.P ropertyName,sen der.GetType().G etProperty(args .PropertyName). GetValue(sender ,null));
lb.Items.Insert (0, message);
});
}; // end debug ougput:

cycleSyncButton .Click += delegate { obj.Cycle(); };
cycleAsyncButto n.Click += delegate {
ThreadPool.Queu eUserWorkItem(d elegate { obj.Cycle(); }); };
tb1.Dock = tb2.Dock = tb3.Dock = cycleSyncButton .Dock =
cycleAsyncButto n.Dock = DockStyle.Top;
lb.Dock = DockStyle.Fill;
cycleAsyncButto n.Text = "Cycle Async";
cycleSyncButton .Text = "Cycle Sync";
bs.DataSource = typeof(SomeClas s);
tb1.DataBinding s.Add(new Binding("Text", bs, "Prop1",
true));
tb2.DataBinding s.Add(new Binding("Text", bs, "Prop2",
true));
tb3.DataBinding s.Add(new Binding("Text", bs, "Prop3",
true));
f.Controls.AddR ange(new Control[] {lb, cycleAsyncButto n,
cycleSyncButton , tb3, tb2, tb1 });
List<SomeClassd ata = new List<SomeClass> ();
data.Add(obj);
bs.DataSource = data;
f.ShowDialog();
}
}
}
sealed class SomeClass : INotifyProperty Changed {
public event PropertyChanged EventHandler PropertyChanged ;
private void OnPropertyChang ed(string propertyName) {
PropertyChanged EventHandler handler = PropertyChanged ;
if (handler != null) handler(this, new
PropertyChanged EventArgs(prope rtyName));
}
private string _prop1 = "val1", _prop2 = "val2", _prop3 = "val3";
public string Prop1 {
get { return _prop1; }
set { if (_prop1 != value) { _prop1 = value;
OnPropertyChang ed("Prop1"); } }
}
public string Prop2 {
get { return _prop2; }
set { if (_prop2 != value) { _prop2 = value;
OnPropertyChang ed("Prop2"); } }
}
public string Prop3 {
get { return _prop3; }
set { if (_prop3 != value) { _prop3 = value;
OnPropertyChang ed("Prop3"); } }
}
public void Cycle() {
string temp = Prop1;
Prop1 = Prop2;
Prop2 = Prop3;
Prop3 = temp;
}
}
}

===

additional fixup lines (just after existing PropertyChanged +=):
obj.PropertyCha nged += delegate(object sender, PropertyChanged EventArgs
args) {
if (ReferenceEqual s(sender, bs.Current) && f.InvokeRequire d) {
f.BeginInvoke(( ThreadStart)del egate {
bs.ResetCurrent Item();
});
};
};

Jul 24 '06 #2
No; **I'm** not updating the UI **at all**; I am updating the object model;
the point is that I would quite like my UI to update itself. In a disparate
application with multiple forms and threads, at the point of doing the
object model I have no business knowing what views in the UI are based on my
object model - I just want them to update themselves in response to the
property change notification. Does that make sense?

Marc

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us wrote
in message news:OW******** *****@TK2MSFTNG P02.phx.gbl...
Hi

If you are updating the UI from another thread you need to use
Control.Invoke, there is no way around it
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Marc Gravell" <ma**********@g mail.comwrote in message
news:%2******** *******@TK2MSFT NGP05.phx.gbl.. .
>In the following example, the Bindings don't update the UI if the
property change is triggered from the non-UI thread - see the async
button - from the listbox contents (and observation) the change to the
object has occurred correctly; have I got a foobar somewhere, or is this
the expected behaviour? I can "fix" it by adding an additional few lines
(follows main code), but this is ugly; any ideas? And can I get a robust
MVP-style UI in a threaded environment using this binding approach?

Marc

===

using System;
using System.Windows. Forms;
using System.Componen tModel;
using System.Collecti ons.Generic;
using System.Reflecti on;
using System.Threadin g;
using System.Diagnost ics;
namespace TestApp {
static class Program {
[STAThread]
static void Main() {
SomeClass obj = new SomeClass();
using (Form f = new Form())
using(TextBox tb1 = new TextBox())
using (TextBox tb2 = new TextBox())
using (TextBox tb3 = new TextBox())
using (BindingSource bs = new BindingSource() )
using (Button cycleSyncButton = new Button())
using (ListBox lb = new ListBox())
using (Button cycleAsyncButto n = new Button()) {
// debug ougput:
obj.PropertyCha nged += delegate(object sender,
PropertyChange dEventArgs args) {
lb.BeginInvoke( (ThreadStart)de legate { // list
property changes
string message =
string.Format( "{0}={1}",args. PropertyName,se nder.GetType(). GetProperty(arg s.PropertyName) .GetValue(sende r,null));
lb.Items.Insert (0, message);
});
}; // end debug ougput:

cycleSyncButton .Click += delegate { obj.Cycle(); };
cycleAsyncButto n.Click += delegate {
ThreadPool.Que ueUserWorkItem( delegate { obj.Cycle(); }); };
tb1.Dock = tb2.Dock = tb3.Dock = cycleSyncButton .Dock =
cycleAsyncButt on.Dock = DockStyle.Top;
lb.Dock = DockStyle.Fill;
cycleAsyncButto n.Text = "Cycle Async";
cycleSyncButton .Text = "Cycle Sync";
bs.DataSource = typeof(SomeClas s);
tb1.DataBinding s.Add(new Binding("Text", bs, "Prop1",
true));
tb2.DataBinding s.Add(new Binding("Text", bs, "Prop2",
true));
tb3.DataBinding s.Add(new Binding("Text", bs, "Prop3",
true));
f.Controls.AddR ange(new Control[] {lb, cycleAsyncButto n,
cycleSyncButto n, tb3, tb2, tb1 });
List<SomeClassd ata = new List<SomeClass> ();
data.Add(obj);
bs.DataSource = data;
f.ShowDialog();
}
}
}
sealed class SomeClass : INotifyProperty Changed {
public event PropertyChanged EventHandler PropertyChanged ;
private void OnPropertyChang ed(string propertyName) {
PropertyChanged EventHandler handler = PropertyChanged ;
if (handler != null) handler(this, new
PropertyChange dEventArgs(prop ertyName));
}
private string _prop1 = "val1", _prop2 = "val2", _prop3 = "val3";
public string Prop1 {
get { return _prop1; }
set { if (_prop1 != value) { _prop1 = value;
OnPropertyChan ged("Prop1"); } }
}
public string Prop2 {
get { return _prop2; }
set { if (_prop2 != value) { _prop2 = value;
OnPropertyChan ged("Prop2"); } }
}
public string Prop3 {
get { return _prop3; }
set { if (_prop3 != value) { _prop3 = value;
OnPropertyChan ged("Prop3"); } }
}
public void Cycle() {
string temp = Prop1;
Prop1 = Prop2;
Prop2 = Prop3;
Prop3 = temp;
}
}
}

===

additional fixup lines (just after existing PropertyChanged +=):
obj.PropertyCh anged += delegate(object sender, PropertyChanged EventArgs
args) {
if (ReferenceEqual s(sender, bs.Current) && f.InvokeRequire d) {
f.BeginInvoke(( ThreadStart)del egate {
bs.ResetCurrent Item();
});
};
};


Jul 24 '06 #3
Marc,

It does make sense, however, you have a coupling between the change that
occurs in your object, and the UI. Since that change happens on another
thread, you have to marshal that call to the proper thread to update the UI.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Marc Gravell" <ma**********@g mail.comwrote in message
news:O9******** *****@TK2MSFTNG P05.phx.gbl...
No; **I'm** not updating the UI **at all**; I am updating the object
model; the point is that I would quite like my UI to update itself. In a
disparate application with multiple forms and threads, at the point of
doing the object model I have no business knowing what views in the UI are
based on my object model - I just want them to update themselves in
response to the property change notification. Does that make sense?

Marc

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
wrote in message news:OW******** *****@TK2MSFTNG P02.phx.gbl...
>Hi

If you are updating the UI from another thread you need to use
Control.Invoke , there is no way around it
--
--
Ignacio Machin,
ignacio.mach in AT dot.state.fl.us
Florida Department Of Transportation

"Marc Gravell" <ma**********@g mail.comwrote in message
news:%2******* ********@TK2MSF TNGP05.phx.gbl. ..
>>In the following example, the Bindings don't update the UI if the
property change is triggered from the non-UI thread - see the async
button - from the listbox contents (and observation) the change to the
object has occurred correctly; have I got a foobar somewhere, or is this
the expected behaviour? I can "fix" it by adding an additional few lines
(follows main code), but this is ugly; any ideas? And can I get a robust
MVP-style UI in a threaded environment using this binding approach?

Marc

===

using System;
using System.Windows. Forms;
using System.Componen tModel;
using System.Collecti ons.Generic;
using System.Reflecti on;
using System.Threadin g;
using System.Diagnost ics;
namespace TestApp {
static class Program {
[STAThread]
static void Main() {
SomeClass obj = new SomeClass();
using (Form f = new Form())
using(TextBox tb1 = new TextBox())
using (TextBox tb2 = new TextBox())
using (TextBox tb3 = new TextBox())
using (BindingSource bs = new BindingSource() )
using (Button cycleSyncButton = new Button())
using (ListBox lb = new ListBox())
using (Button cycleAsyncButto n = new Button()) {
// debug ougput:
obj.PropertyCha nged += delegate(object sender,
PropertyChang edEventArgs args) {
lb.BeginInvoke( (ThreadStart)de legate { // list
property changes
string message =
string.Format ("{0}={1}",args .PropertyName,s ender.GetType() .GetProperty(ar gs.PropertyName ).GetValue(send er,null));
lb.Items.Insert (0, message);
});
}; // end debug ougput:

cycleSyncButton .Click += delegate { obj.Cycle(); };
cycleAsyncButto n.Click += delegate {
ThreadPool.Qu eueUserWorkItem (delegate { obj.Cycle(); }); };
tb1.Dock = tb2.Dock = tb3.Dock = cycleSyncButton .Dock =
cycleAsyncBut ton.Dock = DockStyle.Top;
lb.Dock = DockStyle.Fill;
cycleAsyncButto n.Text = "Cycle Async";
cycleSyncButton .Text = "Cycle Sync";
bs.DataSource = typeof(SomeClas s);
tb1.DataBinding s.Add(new Binding("Text", bs, "Prop1",
true));
tb2.DataBinding s.Add(new Binding("Text", bs, "Prop2",
true));
tb3.DataBinding s.Add(new Binding("Text", bs, "Prop3",
true));
f.Controls.AddR ange(new Control[] {lb, cycleAsyncButto n,
cycleSyncButt on, tb3, tb2, tb1 });
List<SomeClassd ata = new List<SomeClass> ();
data.Add(obj);
bs.DataSource = data;
f.ShowDialog();
}
}
}
sealed class SomeClass : INotifyProperty Changed {
public event PropertyChanged EventHandler PropertyChanged ;
private void OnPropertyChang ed(string propertyName) {
PropertyChanged EventHandler handler = PropertyChanged ;
if (handler != null) handler(this, new
PropertyChang edEventArgs(pro pertyName));
}
private string _prop1 = "val1", _prop2 = "val2", _prop3 = "val3";
public string Prop1 {
get { return _prop1; }
set { if (_prop1 != value) { _prop1 = value;
OnPropertyCha nged("Prop1"); } }
}
public string Prop2 {
get { return _prop2; }
set { if (_prop2 != value) { _prop2 = value;
OnPropertyCha nged("Prop2"); } }
}
public string Prop3 {
get { return _prop3; }
set { if (_prop3 != value) { _prop3 = value;
OnPropertyCha nged("Prop3"); } }
}
public void Cycle() {
string temp = Prop1;
Prop1 = Prop2;
Prop2 = Prop3;
Prop3 = temp;
}
}
}

===

additional fixup lines (just after existing PropertyChanged +=):
obj.PropertyC hanged += delegate(object sender, PropertyChanged EventArgs
args) {
if (ReferenceEqual s(sender, bs.Current) && f.InvokeRequire d) {
f.BeginInvoke(( ThreadStart)del egate {
bs.ResetCurrent Item();
});
};
};



Jul 24 '06 #4
OK; allow me to clarify. I'm trying to implement an MVP-style UI, where any
part of the system has no real knowledge about what other aspects may be
monitoring [&V] the data [&M]. Particularly for intensive operations,
processing may occur on backgound threads (i.e. a pool thread) - however,
this has no clue whatsoever about what UI thread(s) are displaying what
form(s) etc, so cannot proactively marshal. I just want the data-model to
notify the UI "I've changed", and the UI to update itself accordingly
(marshalling itself). This *feels* a common enough pattern - am I being
obscure? I kinda expected that Bindings would deal with this themselves -
after all, what's the point of them only responding to changes on their own
thread in a runtime that supports full-blooded threading? Surely the Binding
class could (should?) internally spot that it is talking to a UI control and
use Invoke to marshal? Otherwise it is missing updates...
I guess I can either or roll my own, either by additional handling of the
event (as example) or, by providing access to an ISynchronizeInv oke handle.
But does anything that would handle this already exist?

Marc
Jul 25 '06 #5
Et voila; one x-thread compatible Binding implementation. ..

Hope this helps somebody out there; feel free to tear it apart if I'm "off
on one"... Actually, most of this code is just ctor-forwarding! Shame MS
didn't build it in by default...

Marc

public class ThreadedBinding : Binding {
// ctors to match Binding
public ThreadedBinding (string propertyName, object dataSource,
string dataMember)
: base(propertyNa me, dataSource, dataMember) {
}
public ThreadedBinding (string propertyName, object dataSource,
string dataMember, bool formattingEnabl ed)
: base(propertyNa me, dataSource, dataMember, formattingEnabl ed)
{
}
public ThreadedBinding (string propertyName, object dataSource,
string dataMember, bool formattingEnabl ed, DataSourceUpdat eMode
dataSourceUpdat eMode)
: base(propertyNa me, dataSource, dataMember, formattingEnabl ed,
dataSourceUpdat eMode) {
}
public ThreadedBinding (string propertyName, object dataSource,
string dataMember, bool formattingEnabl ed, DataSourceUpdat eMode
dataSourceUpdat eMode, object nullValue)
: base(propertyNa me, dataSource, dataMember, formattingEnabl ed,
dataSourceUpdat eMode, nullValue) {
}
public ThreadedBinding (string propertyName, object dataSource,
string dataMember, bool formattingEnabl ed, DataSourceUpdat eMode
dataSourceUpdat eMode, object nullValue, string formatString)
: base(propertyNa me, dataSource, dataMember, formattingEnabl ed,
dataSourceUpdat eMode, nullValue, formatString) {
}
public ThreadedBinding (string propertyName, object dataSource,
string dataMember, bool formattingEnabl ed, DataSourceUpdat eMode
dataSourceUpdat eMode, object nullValue, string formatString, IFormatProvider
formatInfo)
: base(propertyNa me, dataSource, dataMember, formattingEnabl ed,
dataSourceUpdat eMode, nullValue, formatString, formatInfo) {
}
// main purpose; detect x-thread operations and compensate
protected override void OnBindingComple te(BindingCompl eteEventArgs
e) {
base.OnBindingC omplete(e);
if (e.BindingCompl eteContext ==
BindingComplete Context.Control Update
&& e.BindingComple teState == BindingComplete State.Exception
&& e.Exception is InvalidOperatio nException) {
if (Control != null && Control.InvokeR equired) {
Control.BeginIn voke(new MethodInvoker(R eadValue));
}
}
}
}
Jul 25 '06 #6

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

Similar topics

2
1673
by: Mike Rovner | last post by:
Hello, Please advise on multi-threaded list *append*: import time, random, thread aList = def main(): for i in range(10):
1
2932
by: Arthur Chereau | last post by:
Hi, I'm trying to setup viewcvs to work with subversion 1.2.0 on Linux with Python 2.4.1. The last viewcvs (from CVS) needs subversion python bindings. I installed swig and built subversion from source with it. Everything works fine until I try to build the Python bindings. When I try "make swig-py" I get the following, Python related, error: # make swig-py
0
1793
by: Neo | last post by:
I was wondering what is the "right" way to deal with datasets is. Particularly sharing DataSets between forms. Here is my situation. I have a simple Customer Database, that holds some information about Customers including thier address. Lets call this Table "Customers". The Customers Table references another Table for Address information, for instance I have a table of "Zipcodes", Now I want an app with two forms, one form to browse my...
0
1814
by: Stuart Norris | last post by:
Dear Group, I am attempting to write a "splash" and "status" Form using a second thread. I wish to use this Form to display status information to the user when I do CPU intensive work in my GUI during startup. I wish to also use the same Form after startup as well if I do something CPU intensive. I have developed a multi-threaded application however the very first
2
1829
by: Steve Stover | last post by:
I want to use the caching API in .net to store data. The data would be stored in a data table class that has approx. 10 columns and 71 rows. What I need to know is this: According to Microsoft's MSDN the data table class is multi-threaded. I trust that it is but I am still leery about its performance under heavy use. In the scenario above can the data table handle 100 - 600 users at one time accessing it? Let me know if I need...
14
1754
by: Ron L | last post by:
All I am working with a DataGrid and a form consisting of a number of text, checkbox, combobox controls, all bound to the same datatable. When I click on my "New" button, I create a new row, make it the current row, and allow the user to make changes in the form. If the user desires to cancel, they can click the "Cancel Changes" button. Here is where my problems start. Once the Cancel Changes button is clicked, the bindings on the...
12
2833
by: Thomas Bartkus | last post by:
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs for Python editing but I'm having (2) problems. 1) When I load a .py file, emacs automatically overrides my wordstar-mode with python-mode, forcing all the keybindings back to emacs native keys. Why?
1
1822
by: Jason Yamada-Hanff | last post by:
Hi all, I'm working on a project that would benefit very much from Python Freetype2 bindings (the Fonty Python project). I don't want to duplicate efforts and wrap the library again if we don't have to. Interestingly, it seems like there have been lots of attempts at doing this. Generally, there are: ft2 - http://www.satzbau-gmbh.de/staff/abel/ft2/index.html
6
13713
by: Leon | last post by:
Hi there, I am trying to use the WebBrowser Control in a form which is being started in an own thread by the main form of my application. Unfortunately I am always getting an error in InitializeComponents stating that the ActiveX-Control 8856f961-340a-11d0-a96b-00c04fd705a2 cannot be initiated because the current thread isn't a single-thread apartment. Is there way of using the webbrowser control in multi threaded applications in .Net...
0
10325
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...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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.