Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Register OCX components in the exe file
#1
I want to, in the exe file, only register the OCX component when loading fails.

The Mac01 code always works, but it registers the OCX every time it runs.

The Mac02 code, which I modified according to the QM help file, does not work

Macro Mac01
Code:
Copy      Help
RegisterComComponent "$qm$\GdPicture.NET.14.tlb" 2|4
typelib GdPicture_NET_14 "$qm$\GdPicture.NET.14.tlb"

Macro Mac02
Code:
Copy      Help
typelib GdPicture_NET_14 "$qm$\GdPicture.NET.14.tlb"

#err 1
if(RegisterComComponent("$qm$\GdPicture.NET.14.tlb" 2|4)!=1) out "Registration failed"; ret
#2
Maybe a better way exists, I don't remember. I would try code like this:

Macro Macro3406
Code:
Copy      Help
typelib GdPicture_NET_14 "$qm$\GdPicture.NET.14.tlb"
SomeTypeFromTheTypelib x._create
err
,RegisterComComponent "$qm$\GdPicture.NET.14.tlb" 2|4
,x._create
#3
When executed in QM, the following warning appears:

Warning in <open ":1030: /571">TX Text32_T2: This COM component was not registered: D:\RPA\QM\GdPicture.NET.14.tlb
    QM now registered it automatically. Automatic registration will not always work. Use it only when testing new components. 


---------------------------------------------------------------------------------------------------------------------------------------
After generating the .exe file, the library cannot be loaded. The error occurs in the sub-function sub.DlgProc
Error info:
 ActiveX control is not created. 

function# hDlg message wParam lParam

sel message
    case WM_INITDIALOG
    
    tx3._getcontrol(id(3 hDlg))
#4
I don't remember all QM COM stuff, and cannot help. All info is in the help file.
#5
Anyway, thanks for your help!
Place the following code at the beginning of the code.
When executed in QM: no warnings or error messages, it runs fine.
When executed in EXE, "NO" will be displayed in the output bar of QM, which seems to bring success closer.


#opt err 1
if(RegisterComComponent("$qm$\GdPicture.NET.14.tlb" 2|4)!=1) out "NO"; ret 
#opt err 0


Forum Jump:


Users browsing this thread: 1 Guest(s)