Click here to Skip to main content
16,008,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: windows TO vista!! Pin
Colin Angus Mackay24-Feb-08 22:50
Colin Angus Mackay24-Feb-08 22:50 
QuestionHi friends.. please help me waiting or loading pages problem Pin
G Nathan24-Feb-08 17:50
G Nathan24-Feb-08 17:50 
GeneralRe: Hi friends.. please help me waiting or loading pages problem Pin
Christian Graus24-Feb-08 18:13
protectorChristian Graus24-Feb-08 18:13 
GeneralXmlSerialize and nullable types Pin
QzRz24-Feb-08 9:54
QzRz24-Feb-08 9:54 
QuestionPlay AVI streams in Vista/Longhorn Pin
quiensabe24-Feb-08 9:12
quiensabe24-Feb-08 9:12 
GeneralRe: Play AVI streams in Vista/Longhorn Pin
Christoph Menge24-Feb-08 9:44
Christoph Menge24-Feb-08 9:44 
GeneralRe: Play AVI streams in Vista/Longhorn Pin
quiensabe24-Feb-08 10:22
quiensabe24-Feb-08 10:22 
GeneralBeginRecive() - Showing a Window in data recieved event handler Pin
gunner_uk200024-Feb-08 8:41
gunner_uk200024-Feb-08 8:41 
I want to show a dialog box, that I've created in visual studio when data has arrived from a socket.

I'm using Socket.BeginRecive and passing it a callback method OnDataRecieved.

When I try to show a dialog to get user input upon data received it. The dialog works fine when it's opened via a button on the main form.

This is the code I'm using to get the form.
<br />
RestoreDeleteDialog form = new RestoreDeleteDialog();<br />
form.ShowDialog();<br />


After I've called BeginReceive() and the event method has ended (ie it's stopped executing the code I've written and is sitting their waiting for an event such as button click or an incomming packet) it will crash with this error:

InvalidOperationException
"The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone)."

If I change the above code to form.Show(), ie so the form is not modal, (which is what I want the, as I don't want the netcode blocking for user input) form will not load and will just be a white window. I've put break points in the code that I've written and there are no infinite loops or anything like that. This happens after the constructor and the form load events have run, when my code has exited.

I'm thinking this problem is being caused by a problem threading, as BeginRecieve() is presumably going to be running in another thread, but I'm not really sure about the inner workings of the non-blocking socket methods, or about how I might spawn the dialog off in another thread with out it causing this error.

Anyone got any ideas?
GeneralUsing two graphics and GraphicsState Pin
baranils24-Feb-08 8:40
baranils24-Feb-08 8:40 
Generalenumeration linking to objects Pin
Eli Nurman24-Feb-08 5:08
Eli Nurman24-Feb-08 5:08 
GeneralHelp using listbox with access database... Pin
Jacob Dixon24-Feb-08 4:58
Jacob Dixon24-Feb-08 4:58 
QuestionHow to set a files date modified property? Pin
gunner_uk200024-Feb-08 4:09
gunner_uk200024-Feb-08 4:09 
AnswerRe: How to set a files date modified property? Pin
Luc Pattyn24-Feb-08 4:47
sitebuilderLuc Pattyn24-Feb-08 4:47 
GeneralGDI+ Problem GUI Graphics Pin
aa1124-Feb-08 3:50
aa1124-Feb-08 3:50 
GeneralRe: GDI+ Problem GUI Graphics Pin
Ed.Poore24-Feb-08 7:14
Ed.Poore24-Feb-08 7:14 
GeneralRe: GDI+ Problem GUI Graphics Pin
Roger Alsing24-Feb-08 10:05
Roger Alsing24-Feb-08 10:05 
GeneralRe: GDI+ Problem GUI Graphics Pin
Ed.Poore24-Feb-08 15:22
Ed.Poore24-Feb-08 15:22 
GeneralRe: GDI+ Problem GUI Graphics Pin
aa2224-Feb-08 22:51
aa2224-Feb-08 22:51 
General"There is no such object on the server" Error after Active Directory SetPasword call Pin
Hesham Amin24-Feb-08 2:53
Hesham Amin24-Feb-08 2:53 
GeneralRe: "There is no such object on the server" Error after Active Directory SetPasword call Pin
foluis29-Mar-10 6:52
foluis29-Mar-10 6:52 
GeneralRe: "There is no such object on the server" Error after Active Directory SetPasword call Pin
Hesham Amin3-Apr-10 23:55
Hesham Amin3-Apr-10 23:55 
Questionhow to attach picture to database ? Pin
E_Gold24-Feb-08 0:39
E_Gold24-Feb-08 0:39 
AnswerRe: how to attach picture to database ? Pin
Giorgi Dalakishvili24-Feb-08 1:04
mentorGiorgi Dalakishvili24-Feb-08 1:04 
QuestionVS2003 projects will not open ? Pin
Christian Graus23-Feb-08 23:57
protectorChristian Graus23-Feb-08 23:57 
AnswerRe: VS2003 projects will not open ? Pin
Ed.Poore24-Feb-08 7:15
Ed.Poore24-Feb-08 7:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.