|
Richard Andrew x64 wrote: Does this look like a problem with the CLR How to tell? The first message is a fairly common one seen when debugging and is raised when a DLL is needed and is not currently loaded. You can usually ignore such messages. The second one indicates that an access violation occurred somewhere within the program, which usually means that you have a reference somewhere that is going out of bounds. The only answer is a few minutes, or hours, with the debugger.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Quote: The first message is a fairly common one seen when debugging and is raised when a DLL is needed and is not currently loaded.
That's not the case. A first chance exception is the first phase in exception handling and is intended to support debugging. When an exception occurs the debugger (if one is attached) is given first chance at handling it (this first chance mechanism is part of the exception handling process and occurs for all exceptions). The debugger can take any number of measures including stopping it proceeding any further. If the debugger allows the exception to proceed normally or one isn't present it advances to the "second chance". This is the normal application level exception processing. There is no specific DLL not loaded exception in Windows that I am aware of.
Quote: First-chance exception at 0x791659f0 (clr.dll) in MyProg.exe: 0xC0000005: Access violation reading location 0x30383043.
Unhandled exception at 0x30383043 in MyProg.exe: 0xC0000005: Access violation.
Both these messages are caused by the same exception (note that both are access violations at the same address). The first line is the first chance and the second occurs after the second chance if it doesn't handle it.
Steve
modified 12-Oct-12 8:21am.
|
|
|
|
|
Quite right, I was confused and misinformed.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard Andrew x64 wrote: Does this look like a problem with the CLR, rather than with my code?
No, it looks like an exception, and without anything to reproduce it'll be hard to place 'blame'. What version of the framework are you using? Did you install all the service-packs?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I need to disable my button because when the user presses it twice, I get an InvalidOperationException (backgroundWorker is busy and cannot run multiple tasks concurrently) in my form's code that is calling the form where I disable the button. In my btn_Program_Click method, I have
btn_Program.Enabled = false , so it should be disabled, but the user can still click on it for some reason. Perhaps I'm misunderstanding what Enabled = false should be doing??
Thanks,
Mich
|
|
|
|
|
An easier fix would be just to unhook the click eventhandler before you create your event and just enable your click again in the threading complete handler.
|
|
|
|
|
How is the click eventhandler disabled?
|
|
|
|
|
Suppose you add the event handler like this:
myButton.Click += MyButton_Click; Well, to remove the reference, all you need do is
myButton.Click -= MyButton_Click;
|
|
|
|
|
That should work. Are you sure you're not enabling it again -or- inadvertently trying to start another instrance of your background task?
/ravi
|
|
|
|
|
Hi,
i need your help. i search "how to check toner level in printer using c# and SNMP protocol.
Please give me your ideas.
thanks a lot.
|
|
|
|
|
Check the SNMP-documentation; not all printers will provide the functionality, and I doubt that there will be much copy/pastable solutions out there.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
alexalexalex1907 wrote: check toner level in printer
Read the documentation for the printer (whatever it is) and/or check with whomever the manufacturer is.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
SNMP is a protocol just like http (just http) is.
Knowing SNMP however tells you absolutely nothing about solving your problem. Just as knowing nothing but http would not allow you to interact with a web site.
So you must learn more about the specific printer, and driver software and version.
|
|
|
|
|
now i wont be able to code this with examples on the internet, right?
String snmpAgent = "ipAddressOfPrinter";
String snmpCommunity = "public";
SimpleSnmp snmp = new SimpleSnmp(snmpAgent, snmpCommunity);
Dictionary<SnmpSharpNet.Oid, AsnType> result = snmp.Get(SnmpSharpNet.SnmpVersion.Ver1, new string[] { "OidOfPrinter" });
if (result == null)
{
MessageBox.Show("Request Failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
foreach (KeyValuePair<SnmpSharpNet.Oid, AsnType> entry in result)
{
textBox1.Text = entry.Key.ToString() + " = " + SnmpConstants.GetTypeName(entry.Value.Type) + " (SysDesc.): " + entry.Value.ToString() + "->" + SnmpConstants.SMI_APPSTRING;
textBox1.Text += "SysName: "+entry.Key;
}
}
Here is the connection to the printer. I can get the name, software, oid of the printer but i cant check its status(if it is online, paper jam, offline, toner low, etc.) how can i get theese properties?
Thanks a lot
|
|
|
|
|
|
Hi
i want to store and retrieve objects of any kind to SQL server database, i did the following, inside the database table, i had created a field of type varbinary(MAX),
and in the code, i had made the following to store the object
object treatment = dataGridViewDrugList.Rows;
MemoryStream memStream = new MemoryStream();
StreamWriter sw = new StreamWriter(memStream);
sw.Write(treatment);
dataRow[0] = memStream.GetBuffer();
and it was successful,
now i am not able to retrieve the object back
any ideas?
modified 11-Oct-12 10:32am.
|
|
|
|
|
Try to 'serialize' the object, as opposed to simply trying to wildly dump it's contents. There's an example using the XmlSerializer on MSDN; once it works, you replace the XmlSerializer with a BinaryFormatter and you're done.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Here[^] it is. Serialization may take some getting-used-to, but it's more versatile than dumping memory.
I'd recommend building it in two separate steps; First, create a small console-app to serialize a random object. Once that works, you should be able to switch between Xml-serialization and binary with ease.
Second part would be to store that "information" in a database. That will work the same way for any information; if you get stuck once you're there, simply come back and we'll look at it again
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, i solved the issue,
my error was that i was trying to serialize an object of type DataGridViewRowCollection
which is not marked as a Serializable object, i made my custom class which marked as Serializable, i had stored all the data in the DataGridViewRowCollection in that class,
now everything is OK
thanks again,
|
|
|
|
|
i want to create 3 tier architecture in asp.net and c# using stored procedure
tannu
|
|
|
|
|
tannu dwivedi wrote: i want to create
Okay so go ahead and do that. Did you maybe have some sort of a question that you wanted to ask?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
modified 11-Oct-12 10:48am.
|
|
|
|
|
..and you're looking for a tutorial? Did not find anything on Google? Perhaps you'd like to start with Tier 1[^] and work your way up from there?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi Developers
How We Can Stop SQL Injection With Delegate ?
Please Help ME Thanx
|
|
|
|