Ich habe es auch mal getestet und alles heruntergeladen und Teile deines Codes in meinen Beispielcode übernommen. Bei mir funktioniert es. Sowohl x86 als auch x64.
Code: Alles auswählen
;Version: 1.0.8.0
EnableExplicit
Global PBEx_WebGadget
#PBEx_WebGadgetEx_Version$ = "1.0.8.0"
#PB_Web_Zoom = 100
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x86.dll")
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x64.dll")
CompilerEndIf
If PBEx_WebGadget
Prototype WebGadgetEx(ID, X, Y, Width, Height, URL.p-Unicode, ParentWindowID, ErrorOutput)
Global WebGadgetEx.WebGadgetEx = GetFunction(PBEx_WebGadget, "WebGadgetEx")
Prototype SetWebGadgetExText(ID, URL.p-Unicode, ErrorOutput)
Global SetWebGadgetExText.SetWebGadgetExText = GetFunction(PBEx_WebGadget, "SetWebGadgetExText")
Prototype GetWebGadgetExText(ID, Output, ErrorOutput)
Global GetWebGadgetExText.GetWebGadgetExText = GetFunction(PBEx_WebGadget, "GetWebGadgetExText")
Prototype SetWebGadgetExState(ID, State, ErrorOutput)
Global SetWebGadgetExState.SetWebGadgetExState = GetFunction(PBEx_WebGadget, "SetWebGadgetExState")
Prototype SetWebGadgetExItemText(ID, Entry, Text.p-Unicode, ErrorOutput)
Global SetWebGadgetExItemText.SetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "SetWebGadgetExItemText")
Prototype GetWebGadgetExItemText(ID, Entry, Output, ErrorOutput)
Global GetWebGadgetExItemText.GetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "GetWebGadgetExItemText")
Prototype FreeWebGadgetEx(ID, ErrorOutput)
Global FreeWebGadgetEx.FreeWebGadgetEx = GetFunction(PBEx_WebGadget, "FreeWebGadgetEx")
Prototype IsWebGadgetEx(ID, ErrorOutput)
Global IsWebGadgetEx.IsWebGadgetEx = GetFunction(PBEx_WebGadget, "IsWebGadgetEx")
Prototype WebGadgetExWidth(ID, ErrorOutput)
Global WebGadgetExWidth.WebGadgetExWidth = GetFunction(PBEx_WebGadget, "WebGadgetExWidth")
Prototype WebGadgetExHeight(ID, ErrorOutput)
Global WebGadgetExHeight.WebGadgetExHeight = GetFunction(PBEx_WebGadget, "WebGadgetExHeight")
Prototype WebGadgetExX(ID, ErrorOutput)
Global WebGadgetExX.WebGadgetExX = GetFunction(PBEx_WebGadget, "WebGadgetExX")
Prototype WebGadgetExY(ID, ErrorOutput)
Global WebGadgetExY.WebGadgetExY = GetFunction(PBEx_WebGadget, "WebGadgetExY")
Prototype WebGadgetExID(ID, ErrorOutput)
Global WebGadgetExID.WebGadgetExID = GetFunction(PBEx_WebGadget, "WebGadgetExID")
Prototype HideWebGadgetEx(ID, State, ErrorOutput)
Global HideWebGadgetEx.HideWebGadgetEx = GetFunction(PBEx_WebGadget, "HideWebGadgetEx")
Prototype ResizeWebGadgetEx(ID, X, Y, Width, Height, ErrorOutput)
Global ResizeWebGadgetEx.ResizeWebGadgetEx = GetFunction(PBEx_WebGadget, "ResizeWebGadgetEx")
Prototype HideWebGadgetExDevTools(ID, State, ErrorOutput)
Global HideWebGadgetExDevTools.HideWebGadgetExDevTools = GetFunction(PBEx_WebGadget, "HideWebGadgetExDevTools")
Prototype ExecuteWebGadgetExJavaScript(ID, Code.p-Unicode, Output, ErrorOutput)
Global ExecuteWebGadgetExJavaScript.ExecuteWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "ExecuteWebGadgetExJavaScript")
Prototype BindWebGadgetExJavaScript(ID, PBProcedureName.p-Unicode, PBProcedureHandle, PID, ErrorOutput)
Global BindWebGadgetExJavaScript.BindWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "BindWebGadgetExJavaScript")
Prototype GetWebGadgetExAttribute(ID, Attribute, ErrorOutput)
Global GetWebGadgetExAttribute.GetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "GetWebGadgetExAttribute")
Prototype SetWebGadgetExAttribute(ID, Attribute, Value, ErrorOutput)
Global SetWebGadgetExAttribute.SetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "SetWebGadgetExAttribute")
Prototype EnableRemoteDebugger(Port, ErrorOutput)
Global EnableRemoteDebugger.EnableRemoteDebugger = GetFunction(PBEx_WebGadget, "EnableRemoteDebugger")
Prototype SetWebGadgetExSetUserAgent(UserAgent.p-Unicode, ErrorOutput)
Global SetWebGadgetExSetUserAgent.SetWebGadgetExSetUserAgent = GetFunction(PBEx_WebGadget, "SetWebGadgetExSetUserAgent")
EndIf
Define Output$ = Space(1000000)
Define ErrorOutput$ = Space(128)
#WebGadgetEx = 1
#Timer = 1
If OpenWindow(0, 0, 0, 1200, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
WebGadgetEx(#WebGadgetEx, 0, 0, 1200, 768, GetPathPart(ProgramFilename()) + "gauge.html", WindowID(0), @ErrorOutput$)
AddWindowTimer(0, #Timer, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case #WebGadgetEx
EndSelect
Case #PB_Event_Timer
Select EventTimer()
Case #Timer
If ExecuteWebGadgetExJavaScript(#WebGadgetEx, "gauge1.value=" + Random(100) + ";", @Output$, @ErrorOutput$) = 1
Debug "ExecuteWebGadgetExJavaScript OK"
Else
Debug "ExecuteWebGadgetExJavaScript Fehler"
Debug Output$
Debug ErrorOutput$
EndIf
If ExecuteWebGadgetExJavaScript(#WebGadgetEx, "gauge2.value=" + Random(100) + ";", @Output$, @ErrorOutput$) = 1
Debug "ExecuteWebGadgetExJavaScript OK"
Else
Debug "ExecuteWebGadgetExJavaScript Fehler"
Debug Output$
Debug ErrorOutput$
EndIf
EndSelect
Case #PB_Event_CloseWindow
CloseLibrary(PBEx_WebGadget)
End
EndSelect
ForEver
EndIf