Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ActiveX control uses global variables
#1
Hi,
In the following code, I used a global variable in the ActiveX control, but there is always a prompt in the output bar, How improved?

var:
WebKitXCEF3Lib.WebKitXCEF3+ we3
tip:
Warning in <open ":1865: /453">Macro4Big GrinlgProc: Most COM objects cannot be global (+). Or may need <help>lock. Need to release explicitly.    <help #IDP_DIR_OPT>?

Thanks in advance for any advice and help
david



Macro Macro4
Code:
Copy      Help
typelib WebKitXCEF3Lib {FF2C3A99-34D0-4C82-9545-6A1588574233} 4.0

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 584 332 "Dialog" "4"
;3 ActiveX 0x54030000 0x0 0 0 584 332 "WebKitXCEF3Lib.WebKitXCEF3 {FFF36428-F7BC-4B9B-81D5-FB0957A2EB1C}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,WebKitXCEF3Lib.WebKitXCEF3+ we3
,we3._getcontrol(id(3 hDlg))
,DT_SetAutoSizeControls hDlg "3s"
,we3._setevents("sub.we3")
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


#sub we3_OnBrowserReady
function ;;WebKitXCEF3Lib.IWebKitX'we3
we3.Open("www.quickmacros.com")
#2
Move WebKitXCEF3Lib.WebKitXCEF3 to the top. With #sub use v.

...
WebKitXCEF3Lib.WebKitXCEF3 we3
...
#sub DlgProc v
...
#sub we3_OnBrowserReady v
...
#3
In QM3 can use WebView2 (Chromium) in dialogs easily and for free. Install NuGet package Microsoft.Web.WebView2. On Win7 also need to install Microsoft Edge Canary.

https://docs.microsoft.com/en-us/microso.../webview2/

C# code:
// script ""
/*/ nuget -\Microsoft.Web.WebView2; /*/

using Microsoft.Web.WebView2.Wpf;
using System.Windows;
using System.Windows.Controls;

var b = new wpfBuilder("Window").WinSize(700, 600);

b.Row(-1).Add(out WebView2 k);
k.Source = new("https://www.quickmacros.com");

b.R.AddSeparator();

b.AddButton("Navigate", _=> {
    k.CoreWebView2.Navigate("https://www.quickmacros.com/forum");
}).Align("L");

b.R.AddOkCancel();
b.End();
if (!b.ShowDialog()) return;
#4
@Gintaras 

Thanks for your help,
Nice case


Forum Jump:


Users browsing this thread: 1 Guest(s)