This time it's about C# and MBNCSUtil:
I just decided to switch over to C# so I'm trying to re-write my code from VB. My question is, how come in C# it's only letting me declare a "new" BncsPacket variable once? The first BncsPacket that the code runs through will work, all the following ones won't the code stops executing when I insert a value to the BncsPacket.
For example:
BncsPacket WorkingPacket = new BncsPacket(WhateverByte);
WorkingPacket.Insert(WhateverValue);
BncsPacket NotWorkingPacket = new BncsPacket(WhateverByte);
//code fom this line and below will not execute
NotWorkingPacket.Insert(WhateverValue);
NotWorkingPacket.Insert(WhateverValue);
Sort of unclear example but if any answers would be greatly appreciated.. im unfamiliar with C#
So the code stops executing.... Is there an exception raised?
Nope. I get no warnings, no errors. It's the bncspacket because when I was debugging it I tested it in multiple ways, and it's always the second BncsPacket i create where it stops
Does execution return from creating the second BncsPacket? What happens when the program fails? Does it go into a CPU spinning loop, exit the process, or something else?
Quote from: Godzilla on April 23, 2007, 09:22 AM
Nope. I get no warnings, no errors. It's the bncspacket because when I was debugging it I tested it in multiple ways, and it's always the second BncsPacket i create where it stops
Have you tried using the MBNCSUtil source code and stepping into it?
I mean, there's not really anything in BncsPacket(byte) (http://www.jinxbot.net/CodeBrowse/MBNCSUtil_2_0_0_10/BncsPacket.cs.aspx) doesn't do anything blocking
My guessing is that you've got a cross-thread call that affects the GUI somewhere and it just so happens that the problem is coming up right here.
Do you have a GUI?
Quote from: Kp on April 23, 2007, 09:47 AM
Does execution return from creating the second BncsPacket?
Yes, the second packet is created (only the 4 byte header), then the moment I .Insert() a value the code stops, but I do not get failures. Just nothing happens when im debugging it as if nothing has happened.
Would you guys like me to post some of my code?btw MyndFyre i used your PacketId enum.
Yeah, .zip your project and let me see it.
wow omg.. I'm such an idiot. If i looked more closely to my debugging and variable values I could have easily found the problem:
Files[0] = "C:/Program Files/Warcraft III/war3.exe"
Files[1] = "C:/Program Files/Warcraft III/storm.dll"
Files[2] = "C:/Program Files/Warcraft III/game.gll"
funny.
This caused my code to stop executing because my Files for the CheckRevision were wrong :P
Ahh. I was wondering what was up - I never got your project.