Help with DispHelper to load an OCX

Windows specific questions.
Post Reply
Tolo68
Posts: 105
Joined: Mar 30, 2020 18:18
Location: Spain

Help with DispHelper to load an OCX

Post by Tolo68 »

Hi everyone, I have this OCX control...

https://www.softpedia.com/get/Programmi ... -OCX.shtml

But I do not know how to load it and show it in a window with DispHelper, and access its properties, I have looked at the help but I do not get it. I did the control with VB6.

Thanks a lot
Tolo68
Posts: 105
Joined: Mar 30, 2020 18:18
Location: Spain

Re: Help with DispHelper to load an OCX

Post by Tolo68 »

This is the code I have, but it doesn't work...

Code: Select all

#define UNICODE
#include "disphelper/disphelper.bi"
#Include Once "windows.bi"

DISPATCH_OBJ(control)

dim SzResponse as integer

dhInitialize(TRUE)
dhToggleExceptions(TRUE)

If (SUCCEEDED(dhCreateObject("Project1.DisplayHEX", NULL, @control))) Then
  ' ' '  -- I'm not quite sure if the control I linked to has this object name Project1.DisplayHEX
    
    print "dhCreateObject"
    
    dhGetValue("%d",@SzResponse,control,".Digits")
    ' ' ' --- The Digits property, is an Integer in VB6
    
    print "--" & SzResponse
    
End If

SAFE_RELEASE(control)

dhUninitialize(TRUE)

Print "Press any key to exit..."
Sleep
Post Reply