OBJECT Codeunit 90050 SmartCard { OBJECT-PROPERTIES { Date=04.03.09; Time=13:47:17; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN ReadData(); END; } CODE { VAR SmartCard@1000000000 : Automation "{82C38704-19F1-11D3-A11F-00C04F79F800} 1.0:{1461AAC7-6810-11D0-918F-00AA00C18068}:'scardssp 1.0 Type Library'.CSCard"; CardHandle@1000000001 : Integer; result@1000000002 : Integer; PROCEDURE ReadData@1000000000(); BEGIN CREATE(SmartCard); SmartCard.AttachByHandle(CardHandle); MESSAGE(FORMAT(CardHandle)); END; BEGIN END. } }Unfortunately this doesn't do much, the message shows '0' and nothing else happens. If I try to do anything more complicated, I get error messages.
Comments
Are you using pre-built automations, or are you building your own / creating wrappers for them?
My Blog - nav.education
I'm using 'scardssp 1.0 Type Library'.CSCard", which was available in the automation server list.
// VAR CardTest Automation 'scardssp 1.0 Type Library'.CSCardISO7816
// VAR W_byte1 Text
// VAR W_byte2 Text
// VAR W_long Integer
// VAR W_text Text
CREATE(CardTest);
W_byte1 := ' ';
W_byte2 := ' ';
W_long := 8;
CardTest.GetData(W_byte1,W_byte2,W_long,W_text);
{ ERROR MESSAGE:
This message is for C/AL programmers:
Could not invoke the member GetData. The OLE control or Automation server returner the following message:
One or more of the arguments could not be coerced.
}
As you can see, I really haven't made any progress. Can you help me to get started?