thqby / ahk2_lib Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
So WebView2.ahk gives me these errors:
Error: Parameter #1 of ObjAddRef is invalid.
▶ 060: DllCall('user32\GetClientRect', 'ptr', hwnd, 'ptr', RECT := Buffer(16)), ObjAddRef(createdController)
Error: Parameter #2 of ComCall is invalid.
▶ 169: Return A_PtrSize = 8 ? ComCall(6, this, 'ptr', Value) : ComCall(6, this, 'int64', NumGet(Value, 'int64'), 'int64', NumGet(Value, 8, 'int64'))
This version:
/************************************************************************
The code:
#Requires AutoHotKey v2.0-
#Include lib\WebView2.ahk
main := Gui()
main.Show(Format('w{} h{}', A_ScreenWidth * 0.6, A_ScreenHeight * 0.6))
main.Show()
wvc := WebView2.create(main.hwnd)
wv := wvc.CoreWebView2
wv.Navigate("https://www.vg.no")
In the usage example of ws-min.ahk, there is Message: (self,event)=>MsgBox(event.data)
, but event
is actually a JSON string and therefore has no data
property.
I don't know why you would bother to stringify the Event object.
将一个Object 转换为Yaml格式的字符串时, yaml格式错误。
This is strange because I was unable to reproduce it with other command line outputs, only that of adb, and it seems to occur randomly.
For example, when I call ls
for a folder through adb shell
, the directory names are wrapped to the next line randomly.
#Requires AutoHotkey v2.0
#SingleInstance Force
Proc := child_process("adb shell ls /sdcard/Android/media", , true)
Proc.Call()
Result := RTrim(Proc.GetLastStdout(), "`r`n")
Msgbox Result
The results below are all produced with the same code above:
1.
br.com.escolhatecnologia.vozdonarrador
ch.blinkenlights.android.vanilla
com.cxinventor.file.explorer
com.foxdebug.acode
com.google.android.gms
com.kiriengine.app
com.lyonbros.turtl
com.nextcloud.client
com.vson.lexie
dk.tacit.android.foldersync.lite
is.xyz.mpv
org.telegram.messenger
br.com.escolha
tecnologia.vozdonarrador
ch.blinkenlights.android.vanilla
com.cxinventor.file.explorer
com.foxdebug.acode
com.google.android.gms
com.kiriengine.app
com.lyonbros.turtl
com.nextcloud.client
com.vson.lexie
dk.tacit.android.foldersync.lite
is.xyz.mpv
org.telegram.messenger
br.com.escolha
tecnologia.vozdonarrador
ch.blinkenlights.android.va
nilla
com.cxinventor.file.explorer
com.foxdebug.acode
com.google.android.gms
com.kiriengine.app
com.lyonbros.turtl
com.nextcloud.client
com.vson.lexie
dk.tacit.android.foldersync.lite
is.xyz.mpv
org.telegram.messenger
Regarding this line: https://github.com/thqby/ahk2_lib/blob/b72b2d06aa6ee0b55965227f68e97e9170128ee5/Chrome.ahk#L228C28-L228C28
response := this.Call('Runtime.evaluate', ...)
?response := this('Runtime.evaluate', ...)
work as is?Not actually an issue: I want to give thanks to your amazing work on the extension
It's absolutely godlike compared to what I used to use before
And for that reason, I made a video on it
With that, more people will be interested in switching to v2, and potentially help you out in making this project even better!
Have a good day :)
#Requires AutoHotkey v2.0-a
#Include <JSON>
str1:=JSON.stringify(Map("k1","v1","k2","v2"))
str2:=JSON.stringify({m1:"v1",m2:"v2"})
obj1:=JSON.Parse(str2,0,0)
msgbox type(obj1)
obj2:=JSON.Parse(str2)
msgbox type(obj2)
Debug:
Error: This value of type "Object" has no property named "__Item".
---- C:\Program Files\Autohotkey\v2\Lib\JSON.ahk
077: Else
077: If V
▶ 078: LF := P A_LoopField, C[K] := InStr(LF, "\") ? UC(LF) : LF, K := V := P := ""
079: Else
080: LF := P A_LoopField, K := InStr(LF, "\") ? UC(LF) : LF, P := ""
Using Chrome.ahk only when I enable network events like this:
PageInst.Call("Network.enable")
During page load I'm experiencing the following error:
Specifically: 1 in :1.706409825377379e+12,
▶ 478: Throw Error("Malformed _JSON - unrecognized character-", 0, A_LoopField " in " t)
The current thread will exit.
So far I only can reproduce this when enabling network events as shown above.
first thanks for your effort on this,
i was using this lines to save image on Tariq Porter's gdip for v1
pToken:=Gdip_Startup(),
,Clip:=Gdip_BitmapFromScreen(wX "|" wY "|" wW "|" wH)
FileNm=Screenshot-%A_Now%.png
Gdip_SaveBitmapToFile(Clip,A_WorkingDir "\" FileNm,100)
,Gdip_DisposeImage(Clip)
,Gdip_Shutdown(pToken)
started to upgrade my scripts for v2 and im trying to save image using cgdip with this lines
FileNm:="Screenshot-" A_Now ".png"
,CGdip.Startup()
,CGdip.Bitmap.FromScreen(wX "|" wY "|" wW "|" wH)
,CGdip.Bitmap.Save(A_WorkingDir "\" FileNm,100)
,CGdip.Bitmap.Delete()
,CGdip.Shutdown()
and i get this error
Error: This value of type "Class" has no property named "Ptr".
618: E := DllCall("gdiplus\GdipSaveImageToFile", "Ptr", this, "Ptr", StrPtr(sOutput), "Ptr", pCodec, "Uint", p)
for the comparison you can find whats different from Tariq's
if (!A_IsUnicode)
{
nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sOutput, "int", -1, Ptr, 0, "int", 0)
VarSetCapacity(wOutput, nSize*2)
DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sOutput, "int", -1, Ptr, &wOutput, "int", nSize)
VarSetCapacity(wOutput, -1)
if !VarSetCapacity(wOutput)
return -4
E := DllCall("gdiplus\GdipSaveImageToFile", Ptr, pBitmap, Ptr, &wOutput, Ptr, pCodec, "uint", p ? p : 0)
}
else
E := DllCall("gdiplus\GdipSaveImageToFile", Ptr, pBitmap, Ptr, &sOutput, Ptr, pCodec, "uint", p ? p : 0)
return E ? -5 : 0
have a nice day
Hi thqby,
Is your cpp JSON parser officially part of this repo? If not, do you plan on including it at some point?
https://www.autohotkey.com/boards/viewtopic.php?style=1&f=83&t=100602
I've been using it for a year and it has been very reliable and fast!
Just wondering why it's not included. JSON.ahk is also great, but as your testing shows, is almost 10 times slower on stringifying operations.
Thanks,
Occasionally, running
Chrome().GetPage().Evaluate("window.location.href")['value']
throws an error at the line:
if ws.readyState != 1
Error object below. This may be hard to reproduce though. If I figure out how to reliably reproduce I will post the steps over here.
{
"Mode": "Return",
"Thrown": {
"Extra": "",
"File": "C:\\ahk\\Lib\\WebSocket.ahk",
"Line": 112,
"Message": "This value of type \"Chrome.Page\" has no property named \"readyState\".",
"Stack": [
"C:\\ahk\\Lib\\WebSocket.ahk (112) : [WEBSOCKET_READ_WRITE_COMPLETE] If ws.readyState != 1",
"> OnMessage",
""
],
"What": ""
},
"Type": "PropertyError"
}
I tried upgrading Native.ahk from 344f2fe (committed on Sep 9, 2023) to the latest version b2c3d10 (committed on Sep 23, 2023, although the date on line 5 is still shown as @date 2023/09/09
) and I'm running into the following error:
Error: Parameter #2 of Object.Prototype.DefineProp is invalid.
Specifically: Native
---- C:\@CS\ahk\Lib\Native\Native.ahk
227: Else
227: t := mems.%name%
▶ 228: t.DefineProp(sub, me := this.Method(pbase, method, mit, minparams, maxparams, id))
229: NumPut('ptr', pname, ObjPtr(me), 3 * A_PtrSize + 8)
230: pmem += A_PtrSize - 3
Call stack:
C:\@CS\ahk\Lib\Native\Native.ahk (228) : [Object.Prototype.DefineProp] t.DefineProp(sub, me := this.Method(pbase, method, mit, minparams, maxparams, id))
C:\@CS\ahk\Lib\Native\Native.ahk (228) : [default_loader] t.DefineProp(sub, me := this.Method(pbase, method, mit, minparams, maxparams, id))
C:\@CS\ahk\Lib\Native\Native.ahk (178) : [DllCall] If !p := DllCall(module_load_addr, 'ptr', ObjPtr(loader || default_loader), 'ptr', ObjPtr(provider || Native), 'cdecl ptr')
The part of my code which includes Native.ahk is this:
#Include <Native\Native>
class JSON {
static __New() {
Native.LoadModule('.\' (A_PtrSize * 8) 'bit\ahk-json.dll', ['JSON'])
this.DefineProp('true', {value: 1})
this.DefineProp('false', {value: 0})
this.DefineProp('null', {value: ''})
}
static parse(str) => Map() | Array()
static stringify(obj, space := 0) => ''
}
I'm running the alpha, though (2.1 alpha 9), so maybe that might have been the reason.
老版没问题,2023/01/12那一版的,没任何问题,最新版的,在不编译的情况下,直接跑脚本是没问题的,能正常用,但是,一旦编译成exe,就没法正常使用了,有时候它又可以用,然后多调用几次就不行了,直接导致exe崩溃退出了,请修复一下哈,感谢!
老版的地方调用:RapidOcr.__cbobj,新版的被你改了,不知道是不是这里出问题了。
https://www.autohotkey.com/boards/viewtopic.php?f=27&t=117615&hilit=RapidOcr
RapidOcr在新装的Win10企业版上不能加载dll,后来我发现是没有安装“微软VC++运行库合集”,安装完后,就没报错了,因此,我想,可否静态打包成dll呢?不要过多依赖第三方c++库,比如用tdm64-gcc编译器就很不错,这个是静态编译的,打包出来的dll全是静态的,不依赖任何第三方库,可以试一下,我windows平台基本都是用的这个tdm64-gcc,基于MinGw-64的,IDE我用的Clion。
感谢!
感谢大佬修复了我上次提的问题,好像是可以了,我再测试测试是不稳定了!
While trying to use the AutoZip()
function of the 7zip lib it pops up with this error
Hitting continue still allows the function to continue, seemingly as if nothing has happened. I may be doing something wrong as I'm ultimately just guessing how this works so feel free to let me know.
Hey,
Im building a little tool that will use your webview2 class. I got it to where i need it but im wondering if it is possible to have an example of how to fetch a given cookie or at least get a list of the current cookies which i could then loop over.
The problem is that i dont seem to use any of the cookie objects/methods because they all have errors like this:
I've tried many different variations like this:
cookielist := WebView2.CookieList()
loop 10
OutputDebug cookielist.GetValueAtIndex(A_Index)
cookiemanager := WebView2.CookieManager()
t := cookiemanager.GetCookies('https://www.site.com', WebView2.Handler(cookies))
cookiemanager := WebView2.CookieManager()
t := cookiemanager.GetCookies('https://www.site.com', p := ObjPtr(cookieshandler))
class cookieshandler
{
QueryInterface(iid, ppv) {
; Implement this method based on your needs
}
AddRef() {
; Implement this method based on your needs
}
Release() {
; Implement this method based on your needs
}
invoke(errCode, cookies)
{
return
}
}
cookiemanager := WebView2.CookieManager()
t := cookiemanager.GetCookies('https://www.site.com', CallbackCreate(cookies))
All end up saying that ComCall
parameter #2
is invalid. :(
解析 yaml 字符串的时候,Map层级出现错误。
key2/key3 变成了 key1(Map) 的键了。
初步排查原因:
69行中 "else L := I[LL] + (D[LL] is Map)" 修改为 "else L := I[LL]" 就没问题了。
附:
查看 HotKeyIt 原版的"Yaml.ahk"中,也是 "else L := I[LL]" 。
https://github.com/HotKeyIt/Yaml/blob/ahkV2/Yaml.ahk
JSON库无法正确解析四个连续的反斜杠,具体如下:
a := '["\\\\"]'
b := JSON.parse(a) ;Array(1) ["\\`"]"]
This crashes when SysFreeString
is called in BSTR
DeviceList := IMMDeviceEnumerator().EnumAudioEndpoints()
loop DeviceList.GetCount() {
OutputDebug DeviceList.Item(A_Index-1).GetId()
}
There is a certain site (can't share as it's a premium and you need subscription to view page) where if I use the console in chrome, I get the desired text when I querySelectorAll item [8].
However, in Chrome when I debug I get stuck at these lines
; Wait for the response this._responses[ID] := false while (this.readyState = 1 && !this._responses[ID]) Sleep(20)
I've ensured I'm using the right page and everything else is working by checking this
url := page.evaluate("window.location.href")["value"] msgbox url
As illustrated in https://www.autohotkey.com/boards/viewtopic.php?f=82&t=116783&p=520585#p520585
Here's my question
utcString:="20230509T060000"
AddCountries:="&p1=tz_jst&p2=tz_aet&p3=236"
url := "https://www.timeanddate.com/worldclock/converter.html?iso=" utcString AddCountries
run("Chrome.exe " url)
xCh:=Chrome()
Page := xCh.GetPageBy("url", pageurl, "contains")
Page.WaitForLoad()
The above doesn't really wait for page to load because if I launch a new page too fast then Page becomes an empty string instead of an object
I tested some v2 Chrome.ahk code, and It seems to be working great, thanks a lot for your amazing and usefull work :D
Currently the JSON is returning a map, but would it not be more logically to return an object?
I found it strange to get maps back.
I know V1 mixed Maps and Objects.
This would make it easier to change some old scripts to v2.
Working example v2:
ChromeInst := Chrome()
ChromeTab := ChromeInst.GetPage()
result := ChromeTab.Evaluate("window.location.href")
msgbox(result["value"])
Normally I would think that result.value should be the correct syntax.
YAML.parse('{"text":"\u041f\u0440\u0438\u0432\u0435\u0442"}')
Returns:
text: �1fривет
But should be:
text:Привет
Hi thqby,
I am using your WebView2 library to great effect in a script of mine that has a tabbed interface. Each tab has its own WebView.
I create a new WebView like this and insert it into the "WebBrowsers"-array:
placeholder := PopupGUI.Add("Text", "x0 y+0 +Border w" winW)
placeholder.GetPos(, &sizeOfTabControl)
placeholder.Move(,,, winH - sizeOfTabControl +1)
WebBrowsers.InsertAt(index, { plHold : placeholder, view : WebView2.create(placeholder.Hwnd) } )
In some rare cases WebView2.create(placeholder.Hwnd)
returns 0 instead of the desired WebView object. Thus whenever I try this:
wb := WebBrowsers[tabCtrl.Value].view.CoreWebView2
I get the error:
This value of type "Integer" has no property named "CoreWebView2".
I can't reproduce the error on my machine, but it has occured multiple times on other people's machines. They run Windows 10.0.19045 (x64). The AutoHotkey version didn't make a difference, it occured with quite a few different versions. I currently use v2.0.11.
What could cause the .create() routine to return 0 instead of the WebView object? Can I prevent that? Or should I just try to create the object again if this happens?
Help from your side would be greatly appreciated.
Warm regards and thank you for publishing this and many other useful libraries!
Thomas
AHK 2.0.4 Error in WebView2.ahk line 458
Lib\Webview2\WebView2.ahk (458) : ==> Too many parameters passed to function.
Specifically: ComVar(object)
AHK Code:
#Requires AutoHotKey v2.0+
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include <Webview2\WebView2>
main := Gui()
main.Show("w1200 h1500")
wv:= WebView2.create(main.Hwnd)
wv.CoreWebView2.Navigate("https://www.google.com")
Return
It seems that the NewTab method is failing
Url := "https://www.google.com/"
ChromeInst.NewTab(Url)
I currently use ChromePage.Call("Target.createTarget", {url : Url }), but I would prefer a method that would directly return the pageInstance.
I'm using thqby's Winhttp class with my pull request. (My changes shouldn't have any impact on this problem.)
I am trying to set an Accept-Encoding
header but it's being... difficult. Not throwing any errors, and not failing, just not returning the expected headers/data.
Code used:
#requires Autohotkey v2.0
#Include <Winhttp>
url := "https://titsandasses.org/"
web := Winhttp()
req := web.openRequest("GET",url,"UTF-8")
req.setRequestHeader("Accept-Encoding","gzip")
req.send()
msgbox req.getAllResponseHeaders()
ahk gives me:
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sun, 11 Feb 2024 19:46:51 GMT
Keep-Alive: timeout=5, max=100
Content-Length: 196
Content-Type: text/html
Last-Modified: Mon, 25 Apr 2005 13:39:47 GMT
Accept-Ranges: bytes
ETag: "c4-3f592f0f8cec0"
Server: Apache/2.4.38 (Debian)
Vary: Accept-Encoding
There is no Content-Encoding
response header.
Meanwhile, using this command:
curl -v -s -o nul -H "Accept-Encoding: gzip" --output - https://titsandasses.org/
curl gives me:
HTTP/1.1 200 OK
Date: Sun, 11 Feb 2024 19:38:31 GMT
Server: Apache/2.4.38 (Debian)
Last-Modified: Mon, 25 Apr 2005 13:39:47 GMT
ETag: "c4-3f592f0f8cec0-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 121
Content-Type: text/html
Note the presence of the Content-Encoding
header and the smaller Content-Length
value.
Any ideas?
When calling Chrome().GetPage().Evaluate(...), error is thrown about failing to deserialize parameter awaitPromise
. The reason is that the json string sent in Call(..) has awaitPromise set as 0 rather than false.
Had to modify the code to this as a temporary expedient:
Call(DomainAndMethod, Params?, WaitForResponse := true) {
if (this.readyState != 1)
throw Error('Not connected to tab')
; Use a temporary variable for ID in case more calls are made
; before we receive a response.
if !ID := this._index += 1
ID := this._index += 1
json_str := JSON.stringify(Map('id', ID, 'params', Params ?? {}, 'method', DomainAndMethod), 0)
json_str := StrReplace(json_str, "12391239", "false")
json_str := StrReplace(json_str, "8312319", "true")
this.sendText(json_str)
if (!WaitForResponse)
return
; Wait for the response
this._responses[ID] := false
while (this.readyState = 1 && !this._responses[ID])
Sleep(20)
; Get the response, check if it's an error
if !response := this._responses.Delete(ID)
throw Error('Not connected to tab')
if !(response is Map)
return response
if (response.Has('error'))
throw Error('Chrome indicated error in response', , JSON.stringify(response['error']))
try return response['result']
}
Evaluate(JS) {
response := this('Runtime.evaluate', {
expression: JS,
objectGroup: 'console',
includeCommandLineAPI: 8312319,
silent: 12391239,
returnByValue: 12391239,
userGesture: 8312319,
awaitPromise: 12391239
})
if (response is Map) {
if (response.Has('ErrorDetails'))
throw Error(response['result']['description'], , JSON.stringify(response['ErrorDetails']))
return response['result']
}
}
VarSetStrCapacity(&variable, 5120000) Page := xCh.GetPageBy("url", "someurl","contains") variable:=Page.Evaluate("document.querySelectorAll('#someid')[0].innerText")["value"]
Variable seems to be truncated. If I open developer tools and run in console
document.querySelectorAll('#someid')[0].innerText
I get the full string which is about 100KB of text.
Here is a simple example I took from somewhere on the forum.
The code works fine as long as you just run the .ahk file directly.
After compiling the .ahk file into an .exe I get this error:
It also works fine if you use an older version of your library (1.0.26 from 2022/01/16 as opposed to 1.0.31 from 2023/11/20). I put the older one for comparison into the lib_old folder as well.
I'm using AHK v.2.0.11 U64.
I stumbled across this issue when compiling a bigger project of mine that uses your library. In this case the WebView library doesn't produce an error but simply never loads any website. The older version of the library works fine.
I cant seem to get the postmessage function to work right.
Thanks
Can you add an example of using local file and bypassing CORS in the examples? I found this line but don't know where to supply it.
HOST_RESOURCE_ACCESS_KIND := { DENY: 0, ALLOW: 1, DENY_CORS: 2 }
I'm trying to use WinSetTransColor to make the background color (#000111) of a web page transparent.
Using WinSetTransColor "000111", "ahk_id " win.hWnd
doesn't work.
Thanks for sharing this library.
I've been using RapidOcr() which was recently upgraded to version V4 which greatly improves the recognition rate, can you update this function to V4? Thanks.
Currently this library only handles maps and objects but would be good to handle arrays too
AutoHotkey.exe 正常,dll 报错。
code:="
(
#UseStdLib
p := DllCall('GetProcAddress', 'ptr', DllCall('GetModuleHandle', 'str', 'user32', 'ptr'), 'astr', 'SetWindowTextW', 'ptr')
f := Native.mdfunc(p, ["int32", "uint64", "string"])
f(A_ScriptHwnd, "测试")
MsgBox WinGetTitle(A_ScriptHwnd)
)"
DllCall("LoadLibraryW", "str", "D:\AutoHotkey.dll","UPtr")
DllCall('AutoHotkey.dll\NewThread', "Str", code, "Str", '', "Str", '', "UInt")
MsgBox
报错:
Error: Expected a ? but got an Integer.
Specifically: 983082
▶ 004: f(A_ScriptHwnd, "测试")
+++
顺便请教大佬 int* intP 有对应的 mdfunc 类型吗?
str := JSON.stringify({ a: { m1: "v1", m2: "v2" } })
obj1 := JSON.Parse(str, 0, 0)
MsgBox type(obj1)
Debug:
Error: This value of type "Object" has no property named "__Item".
---- T:\Programming\AutoHotkey\ahk-v2\Lib\Extensions\JSON.ahk
036: If !A && !V
037: Throw Error("Malformed JSON - missing key.", 0, t)
▶ 038: C := A_LoopField = "[" ? [] : maptype(), A ? D[L].Push(C) : D[L][K] := C, D.Has(++L) ? D[L] := C : D.Push(C), V := "", A := Type(C) = "Array"
039: Continue
040: }
when set '#Warn', the variable local arr_data appears to never be assigned a value.
014: Static ComObjParam := A_AhkVersion < "2" ? "ComObjParameter" : "ComObject"
017: arr := ComObjArray(0xC, 1)
▶ 019: DllCall("oleaut32\SafeArrayAccessData", "ptr", ComObjValue(arr), "ptr*", arr_data)
021: Return {ref: %ComObjParam%(0x400C, arr_data), _: arr, base: base}
022: }
Using AHK 2.04 an latest version of WebView2
Hi, it seems that the recent versions of the WebView2 installer will install the runtime in AppData\local instead of Program Files (x86), which breaks the search for the edge runtime on systems where the runtime is not pre-installed (Windows 8.1 and earlier).
Suggested fix, after line 35 in WebView2.ahk, add:
loop files A_AppData '\..\local\Microsoft\EdgeWebView\Application\*', 'D'
if RegExMatch(A_LoopFilePath, '\\([\d.]+)$', &m) && VerCompare(m[1], ver) > 0
edgeruntime := A_LoopFileFullPath, ver := m[1]
PS: thanks for this lib
I'm attempting to add AdditionalBrowserArguments but it keeps generating an error.
The error it gives is Error: This value of type "Integer" has no property named "TargetCompatibleBrowserVersion"
and is occurring on line #857 of the WebView2.ahk file.
I haven't assigned a value to TargetCompatibleBrowserVersion myself, it looks like that's being force assigned at line #39. I tried enumerating over all the properties for the options at the get_xxx_str(prop, this, pvalue)
function at line #855, and I can see where the options are being properly passed to this function but the this
item doesn't have any properties. I even tried to manually pull the property name and value during this function and assign it but received this error: Error: This value of type "Integer" has no method named "DefineProp"
. I seem unable to figure out how to fix the issue in the library.
Hi, I'm trying to work with Socket.ahk via named pipes for existing compatibility with my existing codebase but I have trouble setting it up. I'm unfamiliar with socket technology so there's that as well.
From my limited understanding of the source code. I have set up something like this
class TestServer extends Socket.Server {
onREAD(wp){
MsgBox "On Read"
}
onCONNECT(wp){
MsgBox "On Connect"
}
}
server := TestServer(,"\\.\pipe\testPipe")
class TestClient extends Socket.Client {
onREAD(data) {
MsgBox("Client Read")
}
onWRITE(data){
MsgBox "Client Write"
}
}
tClient := TestClient("\\.\pipe\testPipe")
tClient.SendText("hi")
I assume that the server opens up the socket for listening via TestServer(,"\\.\pipe\testPipe")
while the client connects to this listening port via TestClient("\\.\pipe\testPipe")
. I'm definitely missing something here as this clearly doesn't work. It would be great if you could provide a minimal working example for both Server and Client classes so I know what the initial setup looks like.
I also happen to stumble across this AHK forum post but the code looks to be tailored towards communicating with LSP server which isn't my use case. I also notice the method static Call(path?, port := 1219)
and the implementation doesn't seem to align with what I understood as it creates a server socket rather than a client socket.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.