Help with dhCreateObject dhGetValue from disphelper.bi

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

Help with dhCreateObject dhGetValue from disphelper.bi

Post by Tolo68 »

Hello everyone, I have the following OCX that you can download here

https://www.softpedia.com/get/Programmi ... l#download

The default property of Digits is 5 and it is a string, but I cannot read this value with the following code, the value gives me 1595CC in hexadecimal or 1414604 in decimal, when the value I have to obtain is 5

'*******************************
dim as string ptr Value

DISPATCH_OBJ(Display)
dhInitialize(TRUE)
dhToggleExceptions(TRUE)

dhCreateObject("WDDisplayHEX.DisplayHEX", NULL, @Display)

dhGetValue("%s",@Value, Display, ".digits")

print Value
print hex(Value)

SAFE_RELEASE(Display)
dhUninitialize(TRUE)

'*******************************

Thank you very much in advance
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Help with dhCreateObject dhGetValue from disphelper.bi

Post by badidea »

I think that dhGetValue wants a pointer to a LPSTR thing for the value. Try with a zstring pointer.

From http://disphelper.sourceforge.net/readme.htm:

Code: Select all

07      LPSTR szResponse;
16      dhGetValue(L"%s", &szResponse, objHTTP, L".ResponseText");
18      printf("Response:\n%s\n", szResponse);
Or search for "dhGetValue" on this forum. Or this old example on the wiki: https://freebasic.net/wiki/ExtLibdisphelper

Note: I have zero knowledge of OCX, COM, etc.
Post Reply