• Welcome to PowerBasic Museum 2020-A.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Recent posts

#21
Brians Board / Re: Any Good news regarding PB...
Last post by Brian Alvarez - January 18, 2020, 09:35:19 AM
 After watching this thread, i thought i should try something. Please see this:

https://forum.powerbasic.com/forum/user-to-user-discussions/third-party-addons/pluribasic/788817-pluribasic-64bit-compilations

If you want to be able to compile PowerBASIC code and even mix it with some of the C++ code... please support. :)


#22
Brians Board / PluriBASIC 64bit compilations
Last post by Brian Alvarez - January 18, 2020, 09:33:26 AM
Hello Everyone.

I dont know if what im about to write makes sense or if i am losing my mind, but please bear with me.

I have a Version of PluriBASIC that already can compile some of the PowerBASIC source code to 64bit
executables, and what is missing is nothing when compared to what i already did.

I already got permission to promote it in the PowerBASIC forums, but it is incomplete and i dont seem
to be able to get the time to finish it.

Here goes the crazy thing... i was wondering if there are enough people interested in the forums (or one
patron with enough funds) to raise a pre-sale and raise 2000 to 3000 USD. I would be charging $ 50.00 for
a yearly subscription to PluriBASIC. I am willing to quit job/ask a couple months off to get it to an acceptable
state, good enough to sell licenses. But for this i would need to get an alternate way to pay bills and survive
until done.

PluriBASIC already exists and works acceptably well. It is a shame that it is in the shelf because of my day
job. It has been almost ready for months. What is missing are just fractions of the core features. While it already
supports most of the DDT statements, not all of them will be supported (although at some point the engine may
upport the syntax so that everybody can write the core code to make them work).

The ideal thing is that with the same version of PluriBASIC everyone can compile PowerBASIC, Android and PHP
code (It already does for simple projects, but portions of code are still missing).

Also the idea is that, when ready, I would like to listen to the community to expand the language and add new
features (it already has extended features too). If i get enough support and see it is viable, i will put a link to purchase
what i already got. The supporters/purchasers (any of them) will have the option to be part of a beta team and
participate in a forum specially for this purpose. Not obligatory of course.

This may be too far fetched because i would need to sell around 60 presale licenses of a product that while it is not
terribly broken, is is not complete... so, i might not pull it off. But as i said, it is a shame the PluriBASIC is in the
shelf at the advanced state it is in, i i thought i should at least try to do it.

Please email me at pluribasic@hotmail.com and let me know if you can aquire a pre-sale license or donate to
the cause, after that i will evaluate if it is viable.

With all respect to everybody.
Brian Alvarez.
#23
General Discussion / Re: PowerBASIC and third party...
Last post by José Roca - January 16, 2020, 03:48:12 PM
Sorry, but without documentation and examples I can't guess how to use this OCX.
#24
General Discussion / PowerBASIC and third party ocx...
Last post by Andreas Neumann - January 16, 2020, 08:47:21 AM
Hello,
I'm new to this forum and maybe I'm posting in the wrong folder.

I use PowerBASIC and connecting the code to measurement equipment hardware. This often comes with ocx and dot-net libraries. I attach a bit of code, the inc file was written with the PowerBASIC com browser. Since weeks I struggle with calls to interfaces which are marked by "This Interface cannot be created directly it can only...".

The AIfeauture calls work, but not the IAnalogChannel.


I googled a lot but did not find a hint.

Thanks!


----  some lines of CODE --------------------
' Generated by: PowerBASIC COM Browser v.2.00.0087
' Date & Time : 15.01.2020 at 14:54
' Options:
' Always use an Interface Prefix : Off
' Interface Prefix               : Int_
' Prefix ProgIDs, ClassIDs...    : On
' Use ANSI Strings               : Off
' Use Singular Enumerations      : Off
' Generate Dispatch Interfaces   : Off
' Include Parameter Names        : On
' Use Property Get/Set statements: On
' ------------------------------------------------
' Library Name: BDaqOcxLib
' Library File: C:\WINDOWS\SysWow64\BDaqOcx.dll
' Description : Advantech DAQNavi Device ActiveX Controls
' GUID : {1752FF26-D6C9-4BC8-BFE9-7D0CA26DED89}
' LCID : 0
' Version : 1.0

' Version Dependent ProgIDs
$PROGID_BDaqOcxLib_InstantAiCtrl1 = "BDaqOcx.InstantAiCtrl.1"

....
.........  some CODE ........


' Interface Name  : IAiFeatures
' Description     : Interface IAiFeatures
' This Interface cannot be created directly it can only
' be returned by a Method or Property in this library.
INTERFACE IAiFeatures $IID_BDaqOcxLib_IAiFeatures
    INHERIT IDISPATCH

    PROPERTY GET Resolution <1> () AS LONG
    PROPERTY GET DataSize <2> () AS LONG
    PROPERTY GET DataMask <3> () AS LONG
    PROPERTY GET ChannelCountMax <4> () AS LONG
    PROPERTY GET ChannelType <5> () AS LONG
    PROPERTY GET OverallValueRange <6> () AS INTEGER
    PROPERTY GET ValueRanges <7> () AS DWORD
    PROPERTY GET BurnoutDetectSupported <8> () AS INTEGER
    PROPERTY GET BurnoutReturnTypes <9> () AS DWORD
    PROPERTY GET ThermoSupported <10> () AS INTEGER
    PROPERTY GET CjcChannels <11> () AS DWORD
    PROPERTY GET BufferedAiSupported <12> () AS INTEGER
    PROPERTY GET SamplingMethod <13> () AS LONG
    PROPERTY GET ChannelStartBase <14> () AS LONG
    PROPERTY GET ChannelCountBase <15> () AS LONG
    PROPERTY GET ConvertClockSources <16> () AS DWORD
    PROPERTY GET ConvertClockRange <17> () AS MathInterval
    PROPERTY GET BurstScanSupported <18> () AS INTEGER
    PROPERTY GET ScanClockSources <19> () AS DWORD
    PROPERTY GET ScanClockRange <20> () AS MathInterval
    PROPERTY GET ScanCountMax <21> () AS LONG
    PROPERTY GET TriggerSupported <22> () AS INTEGER
    PROPERTY GET TriggerSources <23> () AS DWORD
    PROPERTY GET TriggerActions <24> () AS DWORD
    PROPERTY GET TriggerDelayRange <25> () AS MathInterval
    PROPERTY GET Trigger1Supported <26> () AS INTEGER
    PROPERTY GET Trigger1Sources <27> () AS DWORD
    PROPERTY GET Trigger1Actions <28> () AS DWORD
    PROPERTY GET Trigger1DelayRange <29> () AS MathInterval
END INTERFACE

' Interface Name  : IAnalogChannel
' Description     : Interface IAnalogChannel
' This Interface cannot be created directly it can only
' be returned by a Method or Property in this library.
INTERFACE IAnalogChannel $IID_BDaqOcxLib_IAnalogChannel
    INHERIT IDISPATCH

    PROPERTY GET Channel <1> () AS LONG
    PROPERTY GET ValueRange <2> () AS LONG
    PROPERTY SET ValueRange <2> (BYVAL pVal AS LONG)
END INTERFACE

' Interface Name  : IAnalogInputChannel
' Description     : Interface IAnalogInputChannel
' This Interface cannot be created directly it can only
' be returned by a Method or Property in this library.
INTERFACE IAnalogInputChannel $IID_BDaqOcxLib_IAnalogInputChannel
    INHERIT IDISPATCH

    PROPERTY GET Channel <1> () AS LONG
    PROPERTY GET ValueRange <2> () AS LONG
    PROPERTY SET ValueRange <2> (BYVAL pVal AS LONG)
    PROPERTY GET SignalType <3> () AS LONG
    PROPERTY SET SignalType <3> (BYVAL pVal AS LONG)
    PROPERTY GET BurnoutRetType <4> () AS LONG
    PROPERTY SET BurnoutRetType <4> (BYVAL pVal AS LONG)
    PROPERTY GET BurnoutRetValue <5> () AS DOUBLE
    PROPERTY SET BurnoutRetValue <5> (BYVAL pVal AS DOUBLE)
END INTERFACE


.........

.....

' calling program

' some code...


    GLOBAL myOb  AS IInstantAiCtrl
    GLOBAL AnalogChannel() AS IAnalogInputChannel


'-------------------------------------------------------------------------------------------
CALLBACK FUNCTION Test_Callback () AS LONG
    LOCAL SendText AS ASCIIZ * 1024
    LOCAL Result AS LONG
    LOCAL ic AS LONG
    LOCAL hListBox AS DWORD
    LOCAL i AS LONG

    IF CB.MSG = %WM_COMMAND AND CB.CTLMSG = %BN_CLICKED THEN

    irun=1

    DO
       CONTROL SET TEXT CB.HNDL ,%IDC_dumplabel, "Los"
    ChaNo=1
        ercode= myOb.ReadChannel(0,Datx)
        CONTROL SET TEXT CB.HNDL ,%IDC_Ch0, STR$(Datx)
    END IF
....

END FUNCTION

....

'some code .................

    LET myOb = NEWCOM  $PROGID_BDaqOcxLib_InstantAiCtrl

    devMode1= myOb.ProductId
    ? "Product ID " & STR$(devMode1)


' more code.............
#25
Brians Board / Re: Any Good news regarding PB...
Last post by Chris Chancellor - January 11, 2020, 12:35:13 AM
Hello there 2020  and nothing from PB on 64bit

QuoteThe Drakes are a big disappointment imo.

;D   this is an absolute truth  and that O2 is our only light at the tunnel end

#26
C++ programming (SDK style) / HAL 9000
Last post by Patrice Terrier - January 02, 2020, 10:03:37 PM
Here is another video showhing ObjReader64 version 2.85 playing a static animation.
video

The audio track was extracted from "2001 A Space Odyssey" movie.

#27
C++ programming (SDK style) / Spitfire MkVb animated
Last post by Patrice Terrier - December 30, 2019, 11:40:20 AM
Here is a video showhing ObjReader64 version 2.85 playing a real time animation.
Video

The audio track is the real sound of a Rolls Royce Merlin engine...

Note: The video is not as good as playing it directly with ObjReader64  ;)



#28
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 27, 2019, 08:59:04 PM
> I have one: AfxGuid (in AfxCOM.inc)

Great, thanks!
#29
General Discussion / Re: mp3 duration
Last post by José Roca - December 27, 2019, 01:23:12 PM
> would be nice to have something like GUID$ for FB too !

I have one: AfxGuid (in AfxCOM.inc)


' ========================================================================================
' Converts a string into a 16-byte (128-bit) Globally Unique Identifier (GUID)
' To be valid, the string must contain exactly 32 hexadecimal digits, delimited by hyphens
' and enclosed by curly braces. For example: {B09DE715-87C1-11D1-8BE3-0000F8754DA1}
' If pwszGuidText is omited, AfxGuid generates a new unique guid.
' Remarks: I have need to call the UuidCreate function dynamically because, at the time of
' writing, the library for the RPCRT4.DLL seems broken and the linker fails.
' ========================================================================================
PRIVATE FUNCTION AfxGuid (BYVAL pwszGuidText AS WSTRING PTR = NULL) AS GUID
   DIM rguid AS GUID
   IF pwszGuidText = NULL THEN
      ' // Generate a new guid
      DIM AS ANY PTR pLib = DyLibLoad("RPCRT4.DLL")
      IF pLib  THEN
         DIM pProc AS FUNCTION (BYVAL Uuid AS UUID PTR) AS RPC_STATUS
         pProc = DyLibSymbol(pLib, "UuidCreate")
         IF pProc THEN pProc(@rguid)
         DyLibFree(pLib)
      END IF
   ELSE
      CLSIDFromString(pwszGuidText, @rGuid)
   END IF
   RETURN rguid
END FUNCTION
' ========================================================================================

#30
General Discussion / Re: mp3 duration
Last post by Juergen Kuehlwein - December 27, 2019, 12:44:09 PM
PB code:

#COMPILE EXE 
#DIM ALL

'#utility roca3                                        'use José Roca includes

#Include "win32api.inc"
#Include "shobjidl.inc"
#Include "propkey.inc"


FUNCTION duration(file AS WSTRINGZ) AS LONG
'***********************************************************************************************
' return duration of an audio file in ms, -1 for fail
'***********************************************************************************************
LOCAL d          AS QUAD
LOCAL propVar    AS PropVariant
LOCAL hr         AS LONG
LOCAL pPropStore AS IPropertyStore


  hr = SHGetPropertyStoreFromParsingName(BYVAL VARPTR(file), NOTHING, %GPS_DEFAULT, $IID_IPropertyStore, pPropStore)
  IF hr = %S_OK THEN
    hr = pPropStore.GetValue(PKEY_Media_Duration, propVar)
    IF hr = %S_OK THEN
      d = propVar.uhVal                               'time in 100ns

    ELSE
      FUNCTION = -1
      EXIT FUNCTION
    END IF
   
    pPropStore = NOTHING

  ELSE
    FUNCTION = -1
    EXIT FUNCTION
  END IF


  FUNCTION = d/10000                                  'time in ms


END FUNCTION


FUNCTION PBMAIN () AS LONG
'***********************************************************************************************
' -> change paths ...  (must be a full path)
'***********************************************************************************************

  ? STR$(duration("C:\PBwin10\IDE\Projects\mp3\blues.mp3"))
  ? STR$(duration("C:\PBwin10\IDE\Projects\mp3\cher.mid"))
  ? STR$(duration("C:\PBwin10\IDE\Projects\mp3\ring05.wav"))
 

END FUNCTION 


FB code:

'#COMPILER FREEBASIC
'#COMPILE CONSOLE 32 '64


#INCLUDE ONCE "windows.bi"
#INCLUDE ONCE "win\shobjidl.bi"


FUNCTION duration (file AS WSTRING) AS LONG
'***********************************************************************************************
' return duration of an audio file in ms, -1 for fail
'***********************************************************************************************
DIM d                   AS ULONGINT
DIM propVar             AS PropVariant
DIM hr                  AS HRESULT
DIM pPropStore          AS IPropertyStore PTR
DIM PKEY_Media_Duration AS PROPERTYKEY

'***********************************************************************************************
' MACRO PKEY_Media_Duration = GUID$("{64440490-4C8B-11D1-8B70-080036B11A03}") & MKDWD$(3)
' would be nice to have something like GUID$ for FB too !
'***********************************************************************************************
  PKEY_Media_Duration.fmtid.data1    = &H64440490
  PKEY_Media_Duration.fmtid.data2    = &H4C8B
  PKEY_Media_Duration.fmtid.data3    = &H11D1
  PKEY_Media_Duration.fmtid.data4(0) = &H8B
  PKEY_Media_Duration.fmtid.data4(1) = &H70
  PKEY_Media_Duration.fmtid.data4(2) = &H08
  PKEY_Media_Duration.fmtid.data4(3) = &H00
  PKEY_Media_Duration.fmtid.data4(4) = &H36
  PKEY_Media_Duration.fmtid.data4(5) = &HB1
  PKEY_Media_Duration.fmtid.data4(6) = &H1A
  PKEY_Media_Duration.fmtid.data4(7) = &H03
  PKEY_Media_Duration.pid   = 3


  coinitialize(0)                                     'a must in FB

  hr = SHGetPropertyStoreFromParsingName(varptr(file), 0, GPS_DEFAULT, @IID_IPropertyStore, @pPropStore)
  IF hr = S_OK THEN
    hr = IPropertyStore_GetValue(pPropStore, @PKEY_Media_Duration, @propVar)
    IF hr = S_OK THEN
      d = propVar.uhVal.QuadPart                      'time in 100ns

    ELSE
      couninitialize
      RETURN -1
    END IF
   
    IPropertyStore_Release(pPropStore)

  ELSE
    couninitialize
    RETURN -1
  END IF


  couninitialize
  RETURN d/10000                                      'time in ms


END FUNCTION


'***********************************************************************************************
' -> change paths ...  (must be a full path)
'***********************************************************************************************

  PRINT duration("C:\PBwin10\IDE\Projects\mp3\blues.mp3")
  PRINT duration("C:\PBwin10\IDE\Projects\mp3\cher.mid")
  PRINT duration("C:\PBwin10\IDE\Projects\mp3\ring05.wav")


  SLEEP