Recent Posts

Pages: [1] 2 3 ... 10
Development / Re: PB / FB Include Converter
« Last post by John on August 19, 2018, 07:56:31 AM »
That's great news Charles.

Instead of converting PowerBASIC code to O2, create PB DLLs and call the code using PB includes from O2. Makes sense to me. It doesn't solve the 64 bit problem but does give the PB programmer a future with a BASIC compiler that is open source and developed by a brilliant author. It doesn't get much better.

If O2 could create OCX controls as easy as it does DLLs, Oxygen Basic would be hard to beat.

Using IUP as a DDT alternative could get a PB programmer running on O2 with minimal effort.
Development / Re: PB / FB Include Converter
« Last post by Charles Pegge on August 19, 2018, 05:42:33 AM »
Hi John,

o2 can read PB/FreeBasic/VBasic equates, types and declares. It does not support object declarations in PB9.. or Freebasic, however.

There are some differences which are quite easy to resolve. For instance PowerBasic INT is a 16 bit signed integer (a legacy from pre-Prentium times).

In o2 we could solve this by redefining int before using PB headers:

undef int
typedef short int
Development / PB / FB Include Converter
« Last post by John on August 18, 2018, 08:21:13 PM »

How compatible is Oxygen Basic include file syntax compared to PowerBasic and FreeBasic? Could one create a translator to do most of the work?

Since O2 can read C header files, would it make sense to extend that functionality and allow them to be converted into O2 include files BASIC programmers would be more comfortable with?
Reference / Re: COM 64
« Last post by John on August 17, 2018, 01:58:27 PM »
o2 can use the header classes directly. You just need to know what you want.

That is what makes O2 one of the friendliest C BASIC compilers around. Even FreeBasic (basic to C translator) can't read C header files.

I agree with Charles, COM is just around the corner with O2. It would be great if Josť Roca would mentor in this effort.

@Charles - How is O2 going to handle variants?
Reference / Re: COM 64
« Last post by Aurel on August 17, 2018, 12:38:08 PM »
well i am not sure that cwebcontrol looks like a very complex beast
Reference / Re: COM 64
« Last post by Charles Pegge on August 17, 2018, 12:06:30 PM »
o2 can use the header classes directly. You just need to know what you want. Here are the ones I used for Text to speech (in SAPI5), with a slight cleanup:

Code: [Select]
  extern virtual

  class IUnknown

    HRESULT QueryInterface(refiid id, pvObject* ppv)
    ULONG   AddRef()
    ULONG   Release()

  end class

  'from sapi.h

  'ISpNotifySource : public IUnknown
  extern virtual
  class ISpNotifySource


    extends IUnknown

        HRESULT SetNotifySink(
            /* [in] */ __RPC__in_opt ISpNotifySink *pNotifySink)
        HRESULT SetNotifyWindowMessage(
            /* [in] */ HWND hWnd,
            /* [in] */ UINT Msg,
            /* [in] */ WPARAM wParam,
            /* [in] */ LPARAM lParam)
        HRESULT SetNotifyCallbackFunction(
            /* [in] */ SPNOTIFYCALLBACK *pfnCallback,
            /* [in] */ WPARAM wParam,
            /* [in] */ LPARAM lParam)
        HRESULT SetNotifyCallbackInterface(
            /* [in] */ ISpNotifyCallback *pSpCallback,
            /* [in] */ WPARAM wParam,
            /* [in] */ LPARAM lParam)
        HRESULT SetNotifyWin32Event( void)
        HRESULT WaitForNotifyEvent(
            /* [in] */ DWORD dwMilliseconds)
        HANDLE GetNotifyEventHandle( void)

  end class

  'ISpEventSource : public ISpNotifySource

  class ISpEventSource


    extends ISpNotifySource

        HRESULT SetInterest(
            /* [in] */ ULONGLONG ullEventInterest,
            /* [in] */ ULONGLONG ullQueuedInterest)
        HRESULT GetEvents(
            /* [in] */ ULONG ulCount,
            /* [size_is][out] */ SPEVENT *pEventArray,
            /* [out] */ ULONG *pulFetched)
        HRESULT GetInfo(
            /* [out] */ SPEVENTSOURCEINFO *pInfo)
  end class

    'ISpVoice : public ISpEventSource

    class ISpVoice

    extends ISpEventSource

        HRESULT SetOutput(
            /* [in] */ IUnknown *pUnkOutput,
            /* [in] */ BOOL fAllowFormatChanges)
        HRESULT GetOutputObjectToken(
            /* [out] */ ISpObjectToken **ppObjectToken)
        HRESULT GetOutputStream(
            /* [out] */ ISpStreamFormat **ppStream)
        HRESULT Pause( void)
        HRESULT Resume( void)
        HRESULT SetVoice(
            /* [in] */ ISpObjectToken *pToken)
        HRESULT GetVoice(
            /* [out] */ ISpObjectToken **ppToken)
        HRESULT Speak(
            /* [string][in] */
            __in_opt  LPCWSTR pwcs,
            /* [in] */ DWORD dwFlags,
            /* [out] */
            __out_opt  ULONG *pulStreamNumber)

        HRESULT SpeakStream(
            /* [in] */ IStream *pStream,
            /* [in] */ DWORD dwFlags,
            /* [out] */
            __out_opt  ULONG *pulStreamNumber)
        HRESULT GetStatus(
            /* [out] */ SPVOICESTATUS *pStatus,
            /* [out] */ LPWSTR *ppszLastBookmark)
        HRESULT Skip(
            /* [string][in] */ LPCWSTR pItemType,
            /* [in] */ long lNumItems,
            /* [out] */ ULONG *pulNumSkipped)
        HRESULT SetPriority(
            /* [in] */ SPVPRIORITY ePriority)
        HRESULT GetPriority(
            /* [out] */ SPVPRIORITY *pePriority)
        HRESULT SetAlertBoundary(
            /* [in] */ SPEVENTENUM eBoundary)
        HRESULT GetAlertBoundary(
            /* [out] */ SPEVENTENUM *peBoundary)
        HRESULT SetRate(
            /* [in] */ long RateAdjust)
        HRESULT GetRate(
            /* [out] */ long *pRateAdjust)
        HRESULT SetVolume(
            /* [in] */ USHORT usVolume)
        HRESULT GetVolume(
            /* [out] */ USHORT *pusVolume)
        HRESULT WaitUntilDone(
            /* [in] */ ULONG msTimeout)
        HRESULT SetSyncSpeakTimeout(
            /* [in] */ ULONG msTimeout)
        HRESULT GetSyncSpeakTimeout(
            /* [out] */ ULONG *pmsTimeout)
        /* [local] */ HANDLE SpeakCompleteEvent( void)
        /* [local] */ HRESULT IsUISupported(
            /* [in] */ LPCWSTR pszTypeOfUI,
            /* [in] */ void *pvExtraData,
            /* [in] */ ULONG cbExtraData,
            /* [out] */ BOOL *pfSupported)
        /* [local] */ HRESULT DisplayUI(
            /* [in] */ HWND hwndParent,
            /* [in] */ LPCWSTR pszTitle,
            /* [in] */ LPCWSTR pszTypeOfUI,
            /* [in] */ void *pvExtraData,
            /* [in] */ ULONG cbExtraData)
    end class

    end extern

The full code can be found in inc\com  and examples\com. We could produce something that looks a bit simpler - (C baggage!)
Reference / Re: COM 64
« Last post by Aurel on August 17, 2018, 11:38:49 AM »
Hmm crap..
It looks that this dll is full of bugs and strange problems
according to comments on code project.  >:(
Reference / Re: COM 64
« Last post by Aurel on August 17, 2018, 11:30:29 AM »
Yes Jose  have a right that just show how attach atl control in window
and don't have any other functions...
I found it some time ago on Jose forum.

But i found something interesting on code project
it is web browser control written in pure C and WOW looks very complex.
There is a source code for webcontrol dll probably require compiling with C compiler
because translate whole code to oxgen should be huge task ...ufff
anyone know with what compile this C code?
Reference / Re: COM 64
« Last post by Josť Roca on August 17, 2018, 09:53:45 AM »
Thanks Aurel for creating this example. It shows COM is a viable option in O2.

Sorry, but that example only shows how to use ATL.DLL to host the WebBrowser Control. The program itself doesn't use COM in any way.
Reference / Re: COM 64
« Last post by Josť Roca on August 17, 2018, 09:45:12 AM »
The only requirements for a language to work with COM is being able to create structures of pointers (for example, an array of pointers to the methods/procedures, know as virtual table) and, either explicitly or implicitly, call functions through pointers.
Pages: [1] 2 3 ... 10