PureDispHelper UserLib - Update with Includefile for Unicode
The optional parameter hWnd doesn't exist in original Disphelper This
addition works only for some ocx, that embeddeble in browser.
addition works only for some ocx, that embeddeble in browser.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

The Image Edit control is a visual control; if I don't supply an hWnd it doesn't attach itself to the window. If I comment out the dhPutValue line, it works - meaning that I can see the control in the window - but trying to set any of its properties or call any of its functions results in a memory access error.The optional parameter hWnd doesn't exist in original Disphelper This
addition works only for some ocx, that embeddeble in browser.
There must be a way to get this control working in PB, though. I have tried aXend Interface Generator, Stefan Moebius' OLE/COM Interface Generator, and both of these tools fail to expose the object's properties (only its methods are exposed). I thought PureDispHelper would finally be the solution.
BTW, I mean no offense to ts-soft or the creator of Disphelper, I think PureDispHelper is awesome! It's only frustrating that nothing seems to work for the one control I really want to use.
Thanks again!
For the ADO interface alone this is worth heaps to me!
@srod: You going to make a requests/wishlist post for an interfaces/com/activex type board?
Aside:
Anyone using agents like Merlin, etc, do you guys hear anything with the "speak" or do you just see the balloon and the words typed out real slow?
And do you just get Merlin?
For the ADO interface alone this is worth heaps to me!
@srod: You going to make a requests/wishlist post for an interfaces/com/activex type board?
Aside:
Anyone using agents like Merlin, etc, do you guys hear anything with the "speak" or do you just see the balloon and the words typed out real slow?
And do you just get Merlin?
Dare2 cut down to size
Agents speaks only with some extra stuff from MS.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

ts-soft,
This will do absolute wonders for stuff I'm doing at work.
One thing - I can't seem to get any of the examples to work when it uses dhGetValue("%s"....) with a string.
Here's an example...
I get a "The Parameter Is Incorrect" every time on the...
... line. Any thoughts? Thanks again - this is a tremendous piece of work.
This will do absolute wonders for stuff I'm doing at work.
One thing - I can't seem to get any of the examples to work when it uses dhGetValue("%s"....) with a string.
Here's an example...
Code: Select all
; example by Kiffi
EnableExplicit
Define.l ExcelApp, Workbook
dhToggleExceptions(#True)
ExcelApp = dhCreateObject("Excel.Application")
If ExcelApp
dhPutValue(ExcelApp, ".Visible = %b", #True)
dhGetValue("%o", @Workbook, ExcelApp, ".Workbooks.Add")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 1, @"Feel")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 2, 1, @"the")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 3, 1, @"pure")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 4, 1, @"Power")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 2, @"the")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 3, @"pure")
dhPutValue(ExcelApp, "Cells(%d, %d).Value = %s", 1, 4, @"Power")
dhPutValue(ExcelApp, "Cells(%d, %d).Formula = %s", 10, 10, @"=1+1")
Define.l iCount
Define.s HoldString
dhGetValue("%s", @HoldString, ExcelApp, ".Workbooks(1).Name")
dhGetValue("%d", @iCount, ExcelApp, ".Workbooks.Count")
MessageRequester(Trim(HoldString), Str(iCount))
dhFreeString(@HoldString)
dhReleaseObject(Workbook) : Workbook = 0
dhReleaseObject(ExcelApp) : ExcelApp = 0
Else
MessageRequester("PureDispHelper-ExcelDemo", "Couldn't create Excel-Object")
EndIf
Code: Select all
dhGetValue("%s", @HoldString, ExcelApp, ".Workbooks(1).Name")
Sorry, but i can't help you, i haven't ms-office installed.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Hello Xombie,
this one works for me:
Greetings ... Kiffi
this one works for me:
Code: Select all
Define.l HoldString
dhGetValue("%s", @HoldString, ExcelApp, ".Workbooks(%d).Name", 1)
If HoldString
MessageRequester(".Workbooks(1).Name", PeekS(HoldString))
dhFreeString(HoldString) : HoldString = 0
EndIf
Code: Select all
Define.l iCount
Define.s HoldString
Define.l adr
dhGetValue("%s", @adr, ExcelApp, @".Workbooks(1).Name")
HoldString=PeekS(adr)
@adr and peeking
@"Workbooks(1).Name"
EDIT:
Kiffi was too fast.
AND freed the string "adr"
AND got the workbooks string right.

Scrub my answer.

Dare2 cut down to size
@Dare
for stringresults, you give a pointer to a long and peeks the string. after this
you should always free the long, that's hold the string, with dhFreeString() to
avoid memoryleaks.
for stringresults, you give a pointer to a long and peeks the string. after this
you should always free the long, that's hold the string, with dhFreeString() to
avoid memoryleaks.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Thanks, kiffi. That worked.
I can understand passing a long variable to get the string but why would it need...
... to work? Why doesn't it like me to ...... ohhh... is it because the Workbooks() property expects a variable and the %d fakes it out by passing the "1" as a variable to the Workbooks() property?
Maybe the help file could be updated a little bit to add this clarification if so?
Thanks again!
I can understand passing a long variable to get the string but why would it need...
Code: Select all
...ExcelApp, ".Workbooks(%d).Name", 1)
Maybe the help file could be updated a little bit to add this clarification if so?
Thanks again!
>> I can understand passing a long variable to get the string but why would it need...
Strings intern converted to OleString (bstr). OleStrings will always freed!
There is a memory allocated with SysAllocString_(). This memory a
automatic converted to ANSI-String, but not freed by the lib.
I don't parse the parameters, so no automatic available.
Sorry for the small-helpfile, but i doesn't speak good english. I can write a
better one in german, if required
Strings intern converted to OleString (bstr). OleStrings will always freed!
There is a memory allocated with SysAllocString_(). This memory a
automatic converted to ANSI-String, but not freed by the lib.
I don't parse the parameters, so no automatic available.
Sorry for the small-helpfile, but i doesn't speak good english. I can write a
better one in german, if required

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Next example
GetBiosVersion, using wmi in vbscript

GetBiosVersion, using wmi in vbscript
Code: Select all
EnableExplicit
Procedure.s GetBiosVersion()
Protected Script$
Script$ = "Set objWMIService = GetObject(" + #DQUOTE$ + "winmgmts:\\.\root\CIMV2" + #DQUOTE$ + ")" + #CRLF$
Script$ + "Set colItems = objWMIService.ExecQuery(" + #DQUOTE$ + "SELECT * FROM Win32_BIOS" + #DQUOTE$ + ",,48)" + #CRLF$
Script$ + "For Each objItem in colItems" + #CRLF$
Script$ + "If isNull(objItem.BIOSVersion) Then" + #CRLF$
Script$ + "myBios = I'm sure, I don't know" + #CRLF$
Script$ + "Else" + #CRLF$
Script$ + "myBios = Join(objItem.BIOSVersion, " + #DQUOTE$ + "," + #DQUOTE$ + ")" + #CRLF$
Script$ + "End If" + #CRLF$
Script$ + "Next"
ProcedureReturn Script$
EndProcedure
dhToggleExceptions(#True)
Define.l Result, obj = dhCreateObject("MSScriptControl.ScriptControl")
Define.s Script
If obj
dhPutValue(obj, "Language = %s", @"VBScript")
Script = GetBiosVersion()
dhCallMethod(obj, "AddCode(%s)", @Script)
dhGetValue("%s", @Result, obj, "Eval(%s)", @"myBios")
If Result
MessageRequester("BIOSVersion:", PeekS(Result), #MB_ICONINFORMATION)
dhFreeString(Result) : Result = 0
EndIf
dhReleaseObject(obj) : obj = 0
EndIf
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
