Thanks for your reply, looking at your code snippet, I think I need the definition of the ASI_SN structure.
It's not in the document I have.
Can you post the ASI_SN structure definition for me? Thanks.
Dan.
P.S.
For your information, here's my code snippets as trying now, after seeing your example, I see why it crashes.
here's my DLL import Section, one for 32 bit, and the other for 64 bit:
private static extern string ASIGetSerialNumber32(int iCameraID);
private static extern string ASIGetSerialNumber64(int iCameraID);
Here' the calling code:
internal static string ASIGetSerialNumber(int iCameraID)
{
if (IntPtr.Size == 8) //If 32 bit
return ASIGetSerialNumber64(iCameraID);
return ASIGetSerialNumber32(iCameraID);
}
And finally, here's how I call it in the main program.
string camSerNum = ASICameraDll2.ASIGetSerialNumber(camID);
Dan Gray