PureDispHelper UserLib - Update with Includefile for Unicode

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

But in your vbs.pb example supplied with your lib:

Code: Select all

dhCallMethod(obj, "AddCode(%T)", @Script)
AddCode(%T) works fine here in Vista.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

I become a error on vista ultimate 64, don't know
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.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I'm using Vista Ultimate 32 bit and AddCode(%T) works fine here.

OK got it working now - sort of, returns the Local Link IPv6 address with a single adapter installed but i don't know if it will return the info for multiple adapters. The return is supposed to return as an array. How do I get an array into the script?

Code: Select all

Procedure.s AdapterConfig() ; Returns AdapterConfig 

   Protected Script$ 
      
       Script$ = "Set objWMIService = GetObject(" + Chr(34) + "winmgmts:" + Chr(34) + " _" + #CRLF$ 
       Script$ + "    & " + Chr(34) + "{impersonationLevel=impersonate}!\\.\root\cimv2" + Chr(34) + ")" + #CRLF$ 
       Script$ + "Set IPConfigSet = objWMIService.ExecQuery _" + #CRLF$ 
       Script$ + "    (" + Chr(34) + "Select IPAddress from Win32_NetworkAdapterConfiguration" + Chr(34) + ")" + #CRLF$ 
       Script$ + "For Each IPConfig in IPConfigSet" + #CRLF$ 
       Script$ + "    If Not IsNull(IPConfig.IPAddress) Then " + #CRLF$ 
       Script$ + "        For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)" + #CRLF$ 
       Script$ + "            name = IPConfig.IPAddress(i)" + #CRLF$ 
       Script$ + "        Next" + #CRLF$ 
       Script$ + "    End If" + #CRLF$ 
       Script$ + "Next" + #CRLF$ 
      
   ProcedureReturn Script$ 
EndProcedure


dhToggleExceptions(#True)

Define.l Result, obj = dhCreateObject("MSScriptControl.ScriptControl")
Define.s Script

If obj

  dhPutValue(obj, "Language = %T", @"VBScript")
  dhGetValue("%T", @Result, obj, "Language")

  If Result

    dhFreeString(Result) : Result = 0

  EndIf

  Script = AdapterConfig()
  dhCallMethod(obj, "AddCode(%T)", @Script)
  dhGetValue("%T", @Result, obj, "Eval(%T)", @"name")

  If Result

    Debug "Adapter:  " + PeekS(Result)
    dhFreeString(Result) : Result = 0

  EndIf

  dhReleaseObject(obj) : obj = 0

EndIf
Last edited by SFSxOI on Wed Aug 27, 2008 10:37 pm, edited 2 times in total.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

With the working code, no error on vista, so it's only a false error-report in
vista.

:wink:
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.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

The return is supposed to return as an array. How do I get an array into the darn thing now?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

In the examples folder, DispHelper_Include\VariantHelper_Include.pb should
help you. Some examples included
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.
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

You mean for safe array? I looked at that, trying to get it shoe horned in. Seems like a lot of work for such a small script :) Is there a way to just include a .vbs and use the lib to run the script directly?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

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.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

For those having problems getting dhgetobject() to work when using ts-soft's 'DispHelper_Include.pb' file, it is because the DispHelper library expects the first parameter to equal zero in the case that a file path is not being supplied. As it is a non-zero pointer to a null string (bstr) is being passed which is fooling DispHelper into thinking a valid file has been passed. In these cases DispHelper defaults (if a progID is given) to creating a new instance of a pre-registered component.

Here is an adjusted version of the 'DispHelper_Include.pb' file which works around the problem : (tested with Excel and it works fine with existing instances of Excel etc.)

Code: Select all

REMOVED - see ts-soft's post below.
Last edited by srod on Fri Aug 29, 2008 2:43 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

thanks stephen :D

download on www.realsource.de updated
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.
Image
John-G
User
User
Posts: 52
Joined: Wed Oct 03, 2007 5:13 pm
Location: Pittsburgh,Pa.
Contact:

First try with active X needs Big help

Post by John-G »

Hello,

I did not know that we could do ActiveX. :? Here is my work

i downloaded TAPEx.com @ and here is want it shows That i need to add to get it working with out a lot of program time it I am a little lost ':shock:'
OnToneDetected
The OnToneDetected event will be fired when a tone detected.

Event OnToneDetected(
AppSpecific As Long,
Position As Long)
Parameters
AppSpecific
Used by the application for tagging the tone.
Position
the referenced position.

See Also
MonitorTones_Add

Code: Select all

;this is VB Code 
        ' Decode the '0'-'#'  DTMF keys
        .MonitorTones_Add 1, 80, 0, 697, 1209         ' "1"
        .MonitorTones_Add 2, 80, 0, 697, 1336         ' "2"
        .MonitorTones_Add 3, 80, 0, 697, 1477         ' "3"
        .MonitorTones_Add 4, 80, 0, 770, 1209         ' "4"
        .MonitorTones_Add 5, 80, 0, 770, 1336         ' "5"
        .MonitorTones_Add 6, 80, 0, 770, 1477         ' "6"
        .MonitorTones_Add 7, 80, 0, 852, 1209         ' "7"
        .MonitorTones_Add 8, 80, 0, 852, 1336         ' "8"
        .MonitorTones_Add 9, 80, 0, 852, 1477         ' "9"
        .MonitorTones_Add 10, 80, 0, 941, 1209        ' "*"
        .MonitorTones_Add 0,  80, 0, 941, 1336        ' "0"
        .MonitorTones_Add 12, 80, 0, 941, 1477        ' "#"



  .MonitorTones_Add  1, 500, 0, 480, 620, 0,  0,  0 , -20      '  Monitor the 480Hz, 620Hz dual tone and it amplitude must >-20dB
  .MonitorTones_Add  1, 500, 0, 350, 440, 0,  0, -12, -40      '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  in range  -12dB to -40dB
  .MonitorTones_Add  1, 500, 0, 350, 440, 0,  0, -20, 0        '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  < -20dB 
  
' use feature of negation gate : 
  .MonitorTones_Add  1, 50, 0, -450			      		' Monitor the non 450Hz signal (OnToneDetected will be fired if the signal neither in 450Hz nor silence for 50ms.)
  .MonitorTones_Add  1, 50, 0, 480, -620		            ' Monitor the 480Hz and non 620Hz signal 

;
;Here it says 
I am trying to use there FTT to read the Sound Card and am Lost of to where to go here is the DOC that comes withit

MonitorTones_Add
The MonitorTones_Add method enables the detection of inband tones. Each time a specified tone is detected, OnToneDetected will be fired.

Function MonitorTones_Add(
AppSpecific As Long,
MinPeriodOn As Long,
MinPeriodOff As Long,
[Frequency1 As Long],[Frequency2 As Long], [Frequency3 As Long], [Frequency4 As Long],
[MinAmpdB As Single],
[MaxAmpdB As Single]
) As Boolean
Parameters
AppSpecific
Used by the application for tagging the tone. When this tone is detected, Event OnToneDetected() fires with the value of the AppSpecific as parameter.
MinPeriodOn
The minimal duration of the period on in milliseconds, during which the tone should be present before a detection is made.
MinPeriodOff
The minimal duration of the period off in milliseconds, during which the tone should be present before a detection is made. Leave it zero to ignore this parameter.
Frequency1, Frequency2, Frequency3, Frequency4
The frequency, in hertz, of a component of the tone. If fewer than three frequencies are needed in the tone, a value of 0 should be used for the unused frequencies. A tone with all frequencies set to zero is interpreted as silence and can be used for silence detection. If FrequencyX is negative, it works as negation gate. For more info, read the example below.
MinAmpdB
The minimal amplitude in decibel of the those frequencies above. Range from -1dB to -60dB . if it is zero, MinAmpdB will be ignored. Otherwise the tones which amplitude of those frequencies smaller than the MinAmpdB will be filtered.
MaxAmpdB
The maximal amplitude in decibel of the those frequencies above. Range from -1dB to -60dB . if it is zero, MaxAmpdB will be ignored. Otherwise the tones which amplitude of those frequencies bigger than the MinAmpdB will be filtered.
Return Values
If the method succeeds, return TRUE. If the function fails, the return value is FALSE.
I dont know what i need to do to get this in my code I have the [/quote]
:?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PureDispHelper UserLib - Update with Includefile for Uni

Post by PB »

> PureDisphelper v.1.5

The link above needs English text. :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureDispHelper UserLib - Update with Includefile for Uni

Post by ts-soft »

PB wrote:> PureDisphelper v.1.5

The link above needs English text. :(
Sorry, is a german side
Image
greetings
Thomas
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.
Image
User avatar
Alireza
Enthusiast
Enthusiast
Posts: 143
Joined: Sat Aug 16, 2008 2:02 pm
Location: Iran

Re: PureDispHelper UserLib - Update with Includefile for Uni

Post by Alireza »

Hello
is there a x64 (win7) + pb 4.51 version of PureDisphelper?

i get this msg:

Image
PB v 5.6 :D
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: PureDispHelper UserLib - Update with Includefile for Uni

Post by netmaestro »

iirc this comes with a .PBI include which can be used as an alternative to the compiled lib. If so, that should work without problems.
BERESHEIT
Post Reply