PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10
 81 
 on: March 25, 2021, 07:33:13 AM 
Started by Paul Squires - Last post by Paul Squires
Thanks, Paul! Only one minor detail when attempting to run WinFBE32 or WinFBE64 on my Windows 10 Pro machine...
That's odd. I've never seen that occur with WinFBE exe's before. Maybe because of the download fromt he internet, but then again, even the full WinFBE package contains exe's that are downloaded from the internet.

 82 
 on: March 24, 2021, 01:42:42 PM 
Started by Paul Squires - Last post by SeaVipe
Thanks, Paul! Only one minor detail when attempting to run WinFBE32 or WinFBE64 on my Windows 10 Pro machine...

 83 
 on: March 24, 2021, 08:04:20 AM 
Started by Eigil Dingsor - Last post by Eigil Dingsor
Paul,
I was a bit too triggerhappy with copy paste.

If you replace the *json_object_to_json_string_ext(jBody,JSON_C_TO_STRING_PRETTY ) line with

Code: [Select]
print *json_object_to_json_string_ext(jOuter,JSON_C_TO_STRING_PRETTY )
you'll see the nested structure better.
\E

 84 
 on: March 24, 2021, 07:48:21 AM 
Started by Eigil Dingsor - Last post by Paul Squires
Here is the code that I am using thanks to Eigil's example:

Code: [Select]
' json-c test

#include once "json-c/json.bi"
#include once "json-c/printbuf.bi"

' Copy the libJsonWin32.a file to either same folder as your source code/exe or
' to the \lib folder of your GCC toolchain.
#inclib "JsonWin32"


dim jOuter as json_object ptr  = json_object_new_object()
dim jBody as json_object ptr  = json_object_new_object()

json_object_object_add(jOuter,"argument", jbody)


''  'Creating json strings*/
dim jstring1 as  json_object ptr = json_object_new_string("#XXXX.IMS.Compliance.ValidateSimulatedOrdersArgument")
dim jstring2 as  json_object ptr = json_object_new_string("#Collection(String)")

''  'Form the json object*/
''  'Each of these is like a key value pair*/
json_object_object_add(jBody,"@odata.type", jstring1)
 
json_object_object_add(jBody,"OrderIds@odata.type", jstring2)
 
'create an json object array with containg OrderIDS
dim jOrdersID as json_object ptr = json_object_new_array()
   
json_object_array_add(jOrdersID, json_object_new_string("Order_1"))
json_object_array_add(jOrdersID, json_object_new_string("Order_2"))
 
dim jOrderarr as json_object ptr = jOrdersID

'add the array to the body
json_object_object_add(jBody,"OrderIds",jOrderarr )

'print the object
print *json_object_to_json_string_ext(jBody,JSON_C_TO_STRING_PRETTY )

sleep
end


 85 
 on: March 24, 2021, 07:44:38 AM 
Started by Eigil Dingsor - Last post by Paul Squires
Thanks Eigil !!!

I really appreciate you taking the time to help me out with this one. I now have it working correctly on my end.  :-)


 86 
 on: March 24, 2021, 05:16:18 AM 
Started by Eigil Dingsor - Last post by Eigil Dingsor
Hi Paul,
Haven't looked at JSON since last February so I had to refresh a bit. Here's a small code sample. I have my static library libjsonwin32.a  in ... \inc\json-c folder.
Code compiles and works on my pc.
Eigil

Code: [Select]
#include once "windows.bi"
#Include once "file.bi"
#include ONCE "string.bi"
'json
#include "C:\FreeBasic\FreeBASIC-1.07.0\inc\json-c\json.bi"
#include "C:\FreeBasic\FreeBASIC-1.07.0\inc\json-c\printbuf.bi"
#inclib   "jsonwin32"

dim jOuter as json_object ptr  = json_object_new_object()
dim jBody as json_object ptr  = json_object_new_object()

    json_object_object_add(jOuter,"argument", jbody)



''  'Creating json strings*/
dim jstring1 as  json_object ptr = json_object_new_string("#XXXX.IMS.Compliance.ValidateSimulatedOrdersArgument")

dim jstring2 as  json_object ptr = json_object_new_string("#Collection(String)")

''  'Form the json object*/
''  'Each of these is like a key value pair*/
  json_object_object_add(jBody,"@odata.type", jstring1)
 
  json_object_object_add(jBody,"OrderIds@odata.type", jstring2)
 
   'create an json object array with containg OrderIDS
 dim jOrdersID as json_object ptr = json_object_new_array()
   
      json_object_array_add(jOrdersID, json_object_new_string("Order_1"))
      json_object_array_add(jOrdersID, json_object_new_string("Order_2"))
 
 dim jOrderarr as json_object ptr = jOrdersID
 'add the array to the body
  json_object_object_add(jBody,"OrderIds",jOrderarr )
   'print the object
  print *json_object_to_json_string_ext(jBody,JSON_C_TO_STRING_PRETTY )
sleep
end




 87 
 on: March 23, 2021, 04:35:14 PM 
Started by Eigil Dingsor - Last post by Paul Squires
Hi Eigil,

I am looking at json libraries and see that you have provided a static interface to the json-c. I simply copied your file to the same folder as my sample source code and added this to the top of the file:

#include once "json-c/json.bi"
#inclib "JsonWin32"

The exe appears to compile but that is where I seem to get stuck. I am not confident that the static code is added to the exe because when I try to output the results of the following get version function I get a compile error saying that the function could not be found.

? json_c_version_num

Maybe I'm missing something simple? I have not used static libraries with FB so I could use a little help. Maybe a simple example of how you are using this code?






 88 
 on: March 21, 2021, 05:51:33 PM 
Started by jermy - Last post by Paul Squires
After having programmed in DOS for many years, my first exposure to Windows programming was also through Visual Basic 3, 4, 5 & 6. Like you, I ended up resorted to a lot of tricks and hacks. When I finally took the full plunge into PowerBasic and Win32 api programming, that's when everything started to get easier (easier in the sense that the lower level gave you a lot more flexibility. Harder in the sense that the visual design freedom was lacking).

 89 
 on: March 21, 2021, 01:48:21 PM 
Started by jermy - Last post by jermy
I programmed vb5 & 6 for many years, until the programmer language slowly became obsolete.
As vb6 got older, we increasingly turned to weird tricks to keep up with the further developed programmer languages.
In the end it was more than usual to have many API calls and object definition language files to get a program look nice and working.
Probably this is my luck now.

 90 
 on: March 21, 2021, 09:52:01 AM 
Started by jermy - Last post by Paul Squires
Awesome, nice to see that you figured it out and I bet you've learned a lot along the way. Nice to see that you are attempting this in somewhat traditional approach with a mixture of Win32 api and Jose's AFX. Using WinFBE visual designer would be easier but of course you would lose a bit of hardcore low level control from the extra level of abstraction.

Pages: 1 ... 7 8 [9] 10