I have a C# source compiled as DLL. Now this dll occasionally does some downloading, long story short, it can respond to clarion call in a second or in 10 seconds. When it’s a second, my app works fine, when it should be 10, it just crashes (closes down).
This is the C# code I’m calling from clarion:
[DllExport("QRVerify", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.BStr)] public static string StringVerify([MarshalAs(UnmanagedType.BStr)] string QrCode, [MarshalAs(UnmanagedType.BStr)] string TrustListUri, [MarshalAs(UnmanagedType.BStr)] string ValueSetUri, [MarshalAs(UnmanagedType.BStr)] string RuleSetUri) { var VR = Verify(QrCode, TrustListUri, ValueSetUri, RuleSetUri); return Newtonsoft.Json.JsonConvert.SerializeObject(VR); }
So, it’s a bunch of async code behind in this c# project.
My prototype:
> module('eudcc-verifier.dll') > QRVerify(bstring,bstring,bstring,bstring), bstring, name('QRVerify'), pascal,raw,dll(true) > end
My code:
qrcode='123' qrcodebstr=clip(qrcode) trustlistbstr='some https' ValueSetBstr='some https' RuleSetbstr='some https' retstr=QRVerify(qrcodebstr,trustlistbstr,ValueSetBstr,RuleSetbstr)
So, how do I solve this? If needed I can modify c#, I have full source, but I’m not a c# programmer. I’m not sure why CW can’t just wait (ok, it would appear hanged for those 10 secs, I know). Or what could be the problem?
Thank you.