|
The C++ function name will be mangled, see here[^].
Alternatively you could wrap the DLL in a inprocess COM object and use COM Interop to use it.
If you want to avoid issues with the Name Mangling (which is non-standard accross compilers) then you need to write a C DLL, rather than a C one.
regards,
|
|
|
|
|
Hey Guys,
I just got the scariest Exception I've ever seen!
It reads... AccessViolationException Was Unhanded, Attempted To Read Or Write Protected Memory. This is often an indication that other memory is corrupt.
In Visual Studio It points out Application.Run(new frmMain()); As the culprit
I have no idea why this happens, it seems random because i call only one method and it works most of the time. Even when i do get the Exception the program got around to logging data in my database (thhis is the 2nd last step of the process I'm coding) So im thinking it might be where i call These methods...
cmd.Dispose();
newSqlConn.Close();
newSqlConn.Dispose();
But i might be wrong, i still need a way to replicate the damn error so that i can step though the code and see exactly where it breaks.
So my question is this, have any of you ever come across this error? Why does it happen and where do u think i should start looking to fix it?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
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
|
|
|
|