1

i have c# com interop that deserialize json string into variant of array of variants object(10,1)

i am using the following code:

 var res =  (vbobj.ObjValue as JArray).ToObject<dynamic[,]>();

the problem is that all my numeric values from json getting VT_I8 upon return to VB6 calling module instead of VT_I4 and VB6 understandably throws an automation error.

as a work around I loop through each element i got from json deserializer and recreate array while converting every numeric value to Int32

How can i control the type of variants in more elegant way?

thank you mark

h8tow8
  • 143
  • 9
  • Do [How do I change the default Type for Numeric deserialization?](https://stackoverflow.com/q/8297541/344280) and/or [How can I deserialize integer number to int, not to long?](https://stackoverflow.com/q/17918686/344280) answer your question? – dbc Aug 20 '18 at 09:21

0 Answers0