Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdRuntimeJS #80

Open
sancarn opened this issue Oct 11, 2023 · 0 comments
Open

stdRuntimeJS #80

sancarn opened this issue Oct 11, 2023 · 0 comments
Labels
enhancement New feature or request lib-stdRuntimeJS megathread Many bundled feature requests for an individual class

Comments

@sancarn
Copy link
Owner

sancarn commented Oct 11, 2023

Honestly this whole class needs a total rewrite. It was made when I was younger and more naive.



Chakracore.dll can't support JsValueToVariant ,so change to this:

'Run = helperJS2VB(R)
Run = JsValueToSTR(R)

Private Declare Function JsConvertValueToString Lib "Chakra.dll" (ByVal m_JsValue As Long, ByVal VARPTR_RESULstr As Long) As Long
Private Declare Function JsStringToPointer Lib "Chakra.dll" (ByVal m_JsValue As Long, stringValue As Long, stringLength As Long) As Long
Public Declare Function SysReAllocString Lib "oleaut32.dll" (ByVal pBSTR As Long, Optional ByVal pszStrPtr As Long) As Long

Public Function GetStrFromPtrw(ByVal Ptr As Long) As String
  'GOOD(ptr前面是4个字节的长度)
  SysReAllocString VarPtr(GetStrFromPtrw), Ptr
End Function

Function JsValueToSTR(m_JsValue As Long) As String
  Dim JsStringPtr As Long
  Dim VbStringPtr As Long
  Dim StringLen As Long
  Dim ret As Long
  ret = JsConvertValueToString(m_JsValue, VarPtr(JsStringPtr))
  ret = JsStringToPointer(JsStringPtr, VbStringPtr, StringLen)
  JsValueToSTR = GetStrFromPtrw(VbStringPtr)
End Function
```vb
@sancarn sancarn added enhancement New feature or request lib-stdRuntimeJS labels Oct 28, 2023
@sancarn sancarn added this to Roadmap Jun 3, 2024
@sancarn sancarn added the megathread Many bundled feature requests for an individual class label Jun 3, 2024
@sancarn sancarn moved this to Feature Request/Unknown requirement in Roadmap Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib-stdRuntimeJS megathread Many bundled feature requests for an individual class
Projects
Status: Feature Request/Unknown requirement
Development

No branches or pull requests

1 participant