06-14-2022, 03:16 PM
(This post was last modified: 06-14-2022, 03:43 PM by [email protected].)
Hi, Gintaras et al.! My institution is using QM v2.4.2.2 under Windows (mostly Win10 at this time); and, because IE is going away, I need to change some code that is trying to open a URL w/ POST data (the institution just forced all IE-opening URLs to open Edge, and POSTing won't work when a blank IE window opens Edge...). Here's the code that I've been unsuccessful at changing:
---
Request a Call Back :web2 "NWRadWeb/criticalresultscallback.php" _s.from("username=",ps_get_user,"&accession=",ps_get_acc(0)) 8 1000 1000
and web2 is
===function str'url str'args int'flags int'x int'y
int w
VARIANT postdata
VARIANT headers = "Content-Type: application/x-www-form-urlencoded[]"
if args.len>0
ARRAY(byte) a.create(args.len)
memcpy(&a[0] args a.len)
postdata.attach(a)
SHDocVw.IWebBrowser2 b=web("" flags "" "" 0 w)
b.Navigate(url @ @ postdata headers)
siz x y w
===
---
What can I do in order to open the passed url with its postdata within the user's default browser? Thanks!
The author of the code noted above is the user who many years ago asked the Q noted here: open web page with POST variables (quickmacros.com) . I tried writing a web3 function to which I passed two POST arguments and values, but it's not opening a default-browser page w/ the POST data -- here's that function's current code after the calling line:
---
Request a Call Back :web3 "NWRadWeb/criticalresultscallback.php" "username" ps_get_user "accession" ps_get_acc(0) 8 1000 1000
===
function str'url str'args1a str'args1b str'args2a str'args2b int'flags int'x int'y
int w
VARIANT headers = "Content-Type: application/x-www-form-urlencoded[]"
Http Tomer.Connect("NWRadWeb")
SHDocVw.IWebBrowser2 b=web("" flags "" "" 0 w)
Tomer.PostAdd(args1a args1b)
Tomer.PostAdd(args2a args2b)
Tomer.PostFormData(url 0 0 headers)
siz x y w
===
---
---
Request a Call Back :web2 "NWRadWeb/criticalresultscallback.php" _s.from("username=",ps_get_user,"&accession=",ps_get_acc(0)) 8 1000 1000
and web2 is
===function str'url str'args int'flags int'x int'y
int w
VARIANT postdata
VARIANT headers = "Content-Type: application/x-www-form-urlencoded[]"
if args.len>0
ARRAY(byte) a.create(args.len)
memcpy(&a[0] args a.len)
postdata.attach(a)
SHDocVw.IWebBrowser2 b=web("" flags "" "" 0 w)
b.Navigate(url @ @ postdata headers)
siz x y w
===
---
What can I do in order to open the passed url with its postdata within the user's default browser? Thanks!
The author of the code noted above is the user who many years ago asked the Q noted here: open web page with POST variables (quickmacros.com) . I tried writing a web3 function to which I passed two POST arguments and values, but it's not opening a default-browser page w/ the POST data -- here's that function's current code after the calling line:
---
Request a Call Back :web3 "NWRadWeb/criticalresultscallback.php" "username" ps_get_user "accession" ps_get_acc(0) 8 1000 1000
===
function str'url str'args1a str'args1b str'args2a str'args2b int'flags int'x int'y
int w
VARIANT headers = "Content-Type: application/x-www-form-urlencoded[]"
Http Tomer.Connect("NWRadWeb")
SHDocVw.IWebBrowser2 b=web("" flags "" "" 0 w)
Tomer.PostAdd(args1a args1b)
Tomer.PostAdd(args2a args2b)
Tomer.PostFormData(url 0 0 headers)
siz x y w
===
---