|
I've come across it when painting to picture boxes containing a bitmap. I was attempting to write colour to a segment of the box but I forgot to convert the bmp back from monochrome after some processing I did, also attempting to point at a segment outside of the bounds of the bmp caused this (but that was more obvious to spot). Other than that, I haven't come across it before.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
i do no painting in this particular program...
im getting data from an external device and writing it to my database, the weird thing is that it works most of the time. i wish it gave me more info on whats going wrong...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Unfortunately I can't help then, that's the extent of my experience with this exception, hopefully someone else will be along shortly to help you out
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
i hope so too,
thanx tho
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Exceptions often get thrown in Application.Run . I *think* its just the exception bubbling up to the top level handler. You could try putting methods further up the call stack in exception blocks and make sure you've got first chance exception throwing switched on in the debugger to narrow it down a bit.
You must be using some sort of interop or 3rd party component no?
Regards,
Rob Philpott.
|
|
|
|
|
i am, im using an SDK provided by the manufacturer of the external device im getting data from. its a fingerprint scanner by the way.
without it i cant communicate with the device...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Ah, what form does this SDK take and how do you call it?
Regards,
Rob Philpott.
|
|
|
|
|
its a class, first i add a reference to the project, then a using zkemkeeper; , then i make an instance of the class and the call methods from that instance in this fassion.
private void button1_Click(object sender, EventArgs e)
{
CZKEMClass zkSDK = new CZKEMClass();
if (zkSDK.Connect_Com(1, 1, 115200))
{
if (zkSDK.ReadAllGLogData(1))
{
int badgeNo = 0;
int verifyMode = 0;
int inOutMode = 0;
string dateTime = "";
while (zkSDK.GetGeneralLogDataStr(1, ref badgeNo, ref verifyMode, ref inOutMode, ref dateTime))
{
MessageBox.Show(badgeNo + "\r\n" + verifyMode + "\r\n" +inOutMode + "\r\n" + dateTime);
}
}
zkSDK.Disconnect();
}
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hmm. Is that a normal .NET class or a COM wrapper?
If you've defined some COM/unmanaged interop and you haven't got it quite right things like this can happen. Memory can get corrupted and your application can leak. Usually horrid things like calling conventions and the like.
If you're just using this 3rd party stuff without defining any interop yourself I think you can probably assume that is a problem with that and not you. Managed code just can't raise exceptions like the one you're getting.
Regards,
Rob Philpott.
|
|
|
|
|
that is literaly all i do hey...
the reference i add is a dll and while hovering over it it says "active x control for zk embedded fingerprint T7A system"
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Harvey,
When using classes from interop assemblies (like CSKEMClass) you, as a developer, are responsible for cleaning up any resources you use in your program. Not doing so might cause AccessViolationExceptions and will leak memory because the memory isn't freeed properly.
Try using the following pattern:
CZKEMClass zkSDK = new CZKEMClass();<br />
zkSDK.Disconnect();
<br />
Mashal.ReleaseComObject(zkSDK);
Hope it helps.
|
|
|
|
|
Hey there
thanx for the the suggestion, which namespace mast i reference to get Marshal? All i see in intellisence is MarshalByRefObj
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Harvey,
It's found in the namespace System.Runtime.InteropServices
Update on the pattern:
SomeInteropClass sic = null;
try
{
sic = new SomeInteropClass();
}
finally
{
if (sic != null) Marshal.ReleaseComObject(sic);
}
Good luck!
|
|
|
|
|
i am working with a crystal report and i have got a problem. IN the given below code i'm mapping formulafield ["HOTEL_SRV_TEXT"] WITH sParaFormula[10] which is an array and its value comes from the particular array. for example when the value of sParaFormula[10] is something like "balligo" it works but if the its value is "balli's" then it does not work...
if there is character like " ' " then it does not work.....
could any body help
RptSrvName.DataDefinition.FormulaFields["HOTEL_SRV_TEXT"].Text = "'" + sParaFormula[10].ToString().Trim() + "'";
|
|
|
|
|
I'm working on an application wich recieves an fax and will display the fax as an .TIFF in an image component.
But the problem is i cannot get it to work . The idea is to when an fax arrives it appearse in an grid and can be selected then either removed, opened or re-send to an email. I'm looking for someone who can help me complete this task. the programe it self is alomst finished except for that part.
Any help suggestions or code is greatly appriciated
|
|
|
|
|
Try www.rentacoder.com or advertise this position on the jobs forum.
|
|
|
|
|
Gebruik je TAPI 3.0?
en een TIFF sla je op een locatie op een shcijf op. Als je van die locatie een URI maakt en je het webbrowser component gebruikt, dan toon je de tiff als webpage.
via SMTP class kun je een mail met HTML opmaak sturen!
|
|
|
|
|
De .TIFF wordt geopent in ImageEn van HiComponent dat werkt.
Alleen ik krijg het niet voor elkaar om de DataGridView de directory te laten zien. Waar uit de Files geselecteerd kunnen worden en geopend worden in de IeMulti (waar de tiff als ut meerdere afbeeldingen zijn te zien zijn)
Het probleem zit me bij de DataGridView die moet de directory lezen en de lijst met files laten zien + het soort file bijv. .jpg datum van waneer het is binnengekomen of gemaakt bestands groote enz.
Meest van het programma is er al alleen de DataGridView niet
|
|
|
|
|
I need to know what is Hashtables? and how it is used. Plz give me some examples
Regards,
LEE
|
|
|
|
|
|
A hashtable is a glorified array
Instead of having an index and value you have a key and a value, so you can specify the index as "myKey" for example and get the value for it like so... myHashTable["myKey"]
The other advantage is that a hashtable can grow indefinitely (until ram runs out)
To iterate Though each entry in a hash table do this foreach (DictionaryEntry de in myHash)
Hope it helps
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi friends..
I am using bitmap to draw graphics object...How can i perform cut ,delete function ...
currently i done cut, Delete, zoom operation by the following way
for cut and delete
1)Delete the particular graphics object in storage and redraw the remaining graphics object
for zoom
2)Creating new bitmap based on zoom level and redraw all the graphics object..
|
|
|
|
|
Hi,
Can anyone please tell me the difference between virtual function Equals(), static function Equals() and Static function ReferenceEquals() defined in Object class. I searched a lot, but didnt get a clear idea about their differences. Am confused with these three. Can anyone give a small example with the output in these 3 cases.
Regards
modified on Wednesday, April 2, 2008 2:10 AM
|
|
|
|
|
Darmi wrote: difference between virtual function Equals(), static function Equals()
Virtual function Equals(object) checks the current instance with the supplied instance. Consider the following code
MyClass obj1 = new MyClass();
MyClass obj2 = new MyClass();
bool b = obj1.Equals(obj2); here obj2 will be compared with obj1 .
Static Equals(object1,object2) checks the supplied instances (object1 and object2 here).
MyClass obj1 = new MyClass();
MyClass obj2 = new MyClass();
bool b = MyClass.Equals(obj1,obj2);
Darmi wrote: Static function ReferenceEquals()
This checks the the supplied object instances are having same reference.
|
|
|
|
|
When you call Object.Equals(o1, o2) the static version, internally that function first checks to see if the references are not null, and then calls the virtual method o1.Equals(o2). I just checked that using Reflector so that's accurate. Now here's where it can get tricky, if you do not override the Equals method, when o1.Equals(o2) is called in the static function, it just checks object references. I'm going to repost the code that I previously posted.
namespace PersonTest {
class Program {
static void Main(string[] args) {
Person p1 = new Person { Member = "ABC", OtherMember = 1 };
Person p2 = new Person { Member = "ABC", OtherMember = 1 };
Console.WriteLine(Object.Equals(p1, p2).ToString());
Console.WriteLine(Object.ReferenceEquals(p1, p2).ToString());
Console.ReadLine();
}
}
public class Person {
public String Member { get; set; }
public Int32 OtherMember { get; set; }
public override Boolean Equals(Object obj) {
return obj is Person ? Equals(obj as Person) : false;
}
private Boolean Equals(Person obj) {
if (Object.ReferenceEquals(this, obj)) return true;
if ((obj == null) || (this == null)) return false;
return obj.Member == this.Member && obj.OtherMember == this.OtherMember;
}
public override int GetHashCode() {
return base.GetHashCode();
}
}
}
Put this into a project and the output will be True False. Then comment out both of the Equals methods in the Person class and the output will be False False. The reason is that you have 2 different references to Person classes. Regardless of the EQUALITY of the classes the IDENTITY will always be different. Object.ReferenceEquals is always IDENTITY. Object.Equals starts by checking EQUALITY, but then defaults to IDENTITY in the absence of an overridden Equals() method in your class. That's why when you comment out the Equals methods in the Person class, the Object.Equals(p1, p2) the method goes to IDENTITY and not EQUALITY. You have to supply the EQUALITY.
I hope this rather thorough explanation helps.
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|