Recent Posts

Pages: 1 ... 8 9 [10]
91
Programming / Re: Qt6 Application Testing
« Last post by KO Myung-Hun on January 09, 2025, 10:22:17 am »
Hi/2.

Code: [Select]
bool QFSFileEngine::isRelativePath() const
{
    Q_D(const QFSFileEngine);
    const QString fp = d->fileEntry.filePath();
#ifndef Q_OS_OS2
    return fp.isEmpty() || fp.at(0) != u'/';
#else
    return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/');
#endif
}

Code: [Select]
fp.at(1) != u'/'
 should be

Code: [Select]
fp.at(0) != u'/'
right?
92
Programming / Re: Qt6 Application Testing
« Last post by Paul Smedley on January 09, 2025, 10:12:32 am »
I wonder how Windows avoids such a fate with QT6.7+? Since it uses drives too...

OK found 1st problem.

For OS/2, we use qfsfileengine_unix.cpp

In 6.2.x - https://github.com/psmedley/qt6-base-os2/blob/main/src/corelib/io/qfsfileengine_unix.cpp#L528
In 6.8.1 - https://github.com/psmedley/qt6-base-os2/blob/6.8.x/src/corelib/io/qfsfileengine_unix.cpp#L504

So I think in 6.8.1 we need this to be something more like:
Code: [Select]
bool QFSFileEngine::isRelativePath() const
{
    Q_D(const QFSFileEngine);
    const QString fp = d->fileEntry.filePath();
#ifndef Q_OS_OS2
    return fp.isEmpty() || fp.at(0) != u'/';
#else
    return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/');
#endif
}
93
Article Discussions / Re: Asking OS/2 things to OpenAI - Fun and maybe Insightful.
« Last post by Mentore on January 09, 2025, 08:15:29 am »
Thought I'd ask Gemini a similar question. Larger example, includes where the example came from, missing #define INCL_WIN.
Actually, looking at the source, it is old MS Programming library v1.3, 16 bit API?
Code: [Select]
#include <os2.h>

/* Window class structure */
static HAB hab;
static HWND hwndFrame;

/* Window procedure */
MRESULT EXPENTRY ClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
    switch (msg) {
        case WM_PAINT: {
            HPS hps;
            RECTL rc;

            WinQueryWindowRect(hwnd, &rc);
            hps = WinGetPS(hwnd);
            GpiSetColor(hps, SYSCLR_BLUE);
            GpiFillRect(hps, &rc);
            WinReleasePS(hps);
            break;
        }
        case WM_DESTROY:
            WinPostMsg(hwndFrame, WM_QUIT, 0, 0);
            break;
        default:
            return WinDefWindowProc(hwnd, msg, mp1, mp2);
    }
    return 0;
}

/* Frame window procedure */
MRESULT EXPENTRY FrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
    switch (msg) {
        case WM_COMMAND:
            switch (SHORT1FROMMP(mp1)) {
                case IDM_QUIT:
                    WinPostMsg(hwnd, WM_CLOSE, 0, 0);
                    break;
            }
            break;
        case WM_CLOSE:
            WinDestroyWindow(hwnd);
            break;
        default:
            return WinDefWindowProc(hwnd, msg, mp1, mp2);
    }
    return 0;
}

int main(VOID) {
    HAB hab;
    HMQ hmq;
    HWND hwndFrame, hwndClient;
    QMSG qmsg;

    /* Initialize Presentation Manager */
    hab = WinInitialize(0);
    hmq = WinCreateMsgQueue(hab, 0);

    /* Register window classes */
    WinRegisterClass(hab, "MyClientClass", ClientWndProc, CS_SIZEREDRAW, 0);
    WinRegisterClass(hab, "MyFrameClass", FrameWndProc, CS_SIZEREDRAW, 0);

    /* Create frame window */
    hwndFrame = WinCreateWindow(
        HWND_DESKTOP,
        "My Frame Window",
        "MyFrameClass",
        WS_VISIBLE | WS_BORDER | FCF_TITLEBAR | FCF_SYSMENU | FCF_MINMAX,
        0, 0, 200, 100,
        HWND_DESKTOP,
        HWND_TOP,
        hab,
        NULL,
        NULL
    );

    /* Create client window */
    hwndClient = WinCreateWindow(
        hwndFrame,
        "My Client Window",
        "MyClientClass",
        WS_VISIBLE,
        0, 0, 200, 100,
        hwndFrame,
        HWND_TOP,
        hab,
        NULL,
        NULL
    );

    /* Message loop */
    while (WinGetMsg(hab, &qmsg, NULL, 0, 0)) {
        WinDispatchMsg(hab, &qmsg);
    }

    /* Clean up */
    WinDestroyWindow(hwndFrame);
    WinDestroyMsgQueue(hmq);
    WinTerminate(hab);

    return 0;
}

Explanation:

    Include Header:
        #include <os2.h>: Includes the necessary header file for OS/2 Presentation Manager functions.
    Global Variables:
        hab: An anchor block handle, used to identify the application to Presentation Manager.
        hwndFrame: A handle to the frame window.
    Window Procedures:
        ClientWndProc: Handles messages for the client window.
            WM_PAINT: Fills the client area with blue color.
            WM_DESTROY: Posts a quit message to the frame window.
        FrameWndProc: Handles messages for the frame window.
            WM_COMMAND: Processes menu commands (not implemented in this example).
            WM_CLOSE: Destroys the frame window.
    Main Function:
        Initialization:
            WinInitialize: Initializes Presentation Manager and returns an anchor block handle.
            WinCreateMsgQueue: Creates a message queue for the application.
        Window Registration:
            WinRegisterClass: Registers the window classes for the client and frame windows.
        Window Creation:
            WinCreateWindow: Creates the frame and client windows with the specified attributes.
        Message Loop:
            WinGetMsg: Retrieves messages from the message queue.
            WinDispatchMsg: Dispatches messages to the appropriate window procedures.
        Cleanup:
            WinDestroyWindow: Destroys the frame window.
            WinDestroyMsgQueue: Destroys the message queue.
            WinTerminate: Terminates Presentation Manager.

Note:

    This is a basic example and can be extended to include more features such as menus, controls, and more complex window interactions.
    You'll need to use an OS/2 development environment (such as IBM Visual Age for C++) to compile and run this code.
    This code demonstrates the fundamental concepts of creating and managing windows in the OS/2 Presentation Manager environment.

This example provides a starting point for creating OS/2 Presentation Manager applications. You can further explore the Presentation Manager API to implement more advanced features and create sophisticated graphical user interfaces.

    https://github.com/spacerace/MPL

Interesting. It doesn't use WinCreateStdWindow, so maybe you're right and it's not a 2.x PM code. That said, I see no big mistakes. Not surprising though - GPT and other AI tools are really useful in these cases, where there's a non-ambiguous code base to use. It hallucinates, but behaves better than in other topics.

Mentore
94
Article Discussions / Re: Asking OS/2 things to OpenAI - Fun and maybe Insightful.
« Last post by Dave Yeo on January 09, 2025, 04:49:33 am »
Thought I'd ask Gemini a similar question. Larger example, includes where the example came from, missing #define INCL_WIN.
Actually, looking at the source, it is old MS Programming library v1.3, 16 bit API?
Code: [Select]
#include <os2.h>

/* Window class structure */
static HAB hab;
static HWND hwndFrame;

/* Window procedure */
MRESULT EXPENTRY ClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
    switch (msg) {
        case WM_PAINT: {
            HPS hps;
            RECTL rc;

            WinQueryWindowRect(hwnd, &rc);
            hps = WinGetPS(hwnd);
            GpiSetColor(hps, SYSCLR_BLUE);
            GpiFillRect(hps, &rc);
            WinReleasePS(hps);
            break;
        }
        case WM_DESTROY:
            WinPostMsg(hwndFrame, WM_QUIT, 0, 0);
            break;
        default:
            return WinDefWindowProc(hwnd, msg, mp1, mp2);
    }
    return 0;
}

/* Frame window procedure */
MRESULT EXPENTRY FrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
    switch (msg) {
        case WM_COMMAND:
            switch (SHORT1FROMMP(mp1)) {
                case IDM_QUIT:
                    WinPostMsg(hwnd, WM_CLOSE, 0, 0);
                    break;
            }
            break;
        case WM_CLOSE:
            WinDestroyWindow(hwnd);
            break;
        default:
            return WinDefWindowProc(hwnd, msg, mp1, mp2);
    }
    return 0;
}

int main(VOID) {
    HAB hab;
    HMQ hmq;
    HWND hwndFrame, hwndClient;
    QMSG qmsg;

    /* Initialize Presentation Manager */
    hab = WinInitialize(0);
    hmq = WinCreateMsgQueue(hab, 0);

    /* Register window classes */
    WinRegisterClass(hab, "MyClientClass", ClientWndProc, CS_SIZEREDRAW, 0);
    WinRegisterClass(hab, "MyFrameClass", FrameWndProc, CS_SIZEREDRAW, 0);

    /* Create frame window */
    hwndFrame = WinCreateWindow(
        HWND_DESKTOP,
        "My Frame Window",
        "MyFrameClass",
        WS_VISIBLE | WS_BORDER | FCF_TITLEBAR | FCF_SYSMENU | FCF_MINMAX,
        0, 0, 200, 100,
        HWND_DESKTOP,
        HWND_TOP,
        hab,
        NULL,
        NULL
    );

    /* Create client window */
    hwndClient = WinCreateWindow(
        hwndFrame,
        "My Client Window",
        "MyClientClass",
        WS_VISIBLE,
        0, 0, 200, 100,
        hwndFrame,
        HWND_TOP,
        hab,
        NULL,
        NULL
    );

    /* Message loop */
    while (WinGetMsg(hab, &qmsg, NULL, 0, 0)) {
        WinDispatchMsg(hab, &qmsg);
    }

    /* Clean up */
    WinDestroyWindow(hwndFrame);
    WinDestroyMsgQueue(hmq);
    WinTerminate(hab);

    return 0;
}

Explanation:

    Include Header:
        #include <os2.h>: Includes the necessary header file for OS/2 Presentation Manager functions.
    Global Variables:
        hab: An anchor block handle, used to identify the application to Presentation Manager.
        hwndFrame: A handle to the frame window.
    Window Procedures:
        ClientWndProc: Handles messages for the client window.
            WM_PAINT: Fills the client area with blue color.
            WM_DESTROY: Posts a quit message to the frame window.
        FrameWndProc: Handles messages for the frame window.
            WM_COMMAND: Processes menu commands (not implemented in this example).
            WM_CLOSE: Destroys the frame window.
    Main Function:
        Initialization:
            WinInitialize: Initializes Presentation Manager and returns an anchor block handle.
            WinCreateMsgQueue: Creates a message queue for the application.
        Window Registration:
            WinRegisterClass: Registers the window classes for the client and frame windows.
        Window Creation:
            WinCreateWindow: Creates the frame and client windows with the specified attributes.
        Message Loop:
            WinGetMsg: Retrieves messages from the message queue.
            WinDispatchMsg: Dispatches messages to the appropriate window procedures.
        Cleanup:
            WinDestroyWindow: Destroys the frame window.
            WinDestroyMsgQueue: Destroys the message queue.
            WinTerminate: Terminates Presentation Manager.

Note:

    This is a basic example and can be extended to include more features such as menus, controls, and more complex window interactions.
    You'll need to use an OS/2 development environment (such as IBM Visual Age for C++) to compile and run this code.
    This code demonstrates the fundamental concepts of creating and managing windows in the OS/2 Presentation Manager environment.

This example provides a starting point for creating OS/2 Presentation Manager applications. You can further explore the Presentation Manager API to implement more advanced features and create sophisticated graphical user interfaces.

    https://github.com/spacerace/MPL
95
Applications / Re: AVxCAT 2.1.1.2
« Last post by Remy on January 08, 2025, 04:48:56 pm »
Hi Martin,

I updated AVxCAT to FP1 (small update process change) and updated pdf ogg link.

Note:
Since AVxCAT V2.1.1, update information are available into following file too.
Update filename as well MD5 checksum >  https://remydodin.levillage.org/doc/realisations/updates/avxcat21.updt

Regards
Rémy 
96
Applications / Re: AVxCAT 2.1.1.2
« Last post by Remy on January 08, 2025, 03:12:03 pm »
Hello Remy.

I' now on version 2.2.0.0 with your indications of downloading the file and unzipping it on the 2.1.1.0 installation.
It seems to be working.


Checking the AVXCAT 2.2.pdf file, it says it works with - http://silk.apana.org.au/vorbis/oggvorbis-1.2.0-os2.zip
Will it work fine with https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/apps/mmedia/sound/convert/OggVorbis_1-3-3.wpi
Do you think it will be fine to update to it?

Regards

Hi Martin,

PDF typo (should be 1.3.3 now - older version may work too  ::)) Thanks having seen this
I'm going to update it to prevent regression.

Could you give a test on prereqs exe ? check found missings tools/dlls and save results into files (from the menu) and look at them for provided links?
note: If no ogg installed, it will provide v1.3.3 link

Regards
Rémy
97
Web applications / Re: Dooble releases, Qt5 builds
« Last post by David Graser on January 08, 2025, 05:00:37 am »
Here is a tip for those that do not like the command  prompt window for dooble starting up and staying on the desktop.

1. Left click on the Dooble program icon.

(2. Under the Program tab, delete the last charactor in the the Path and File Name box  e) changing dooble.exe to dooble.ex

3. Select the Session tab.

4. At the bottom of the tab, check the Start Minimized.

5. Under the Program tab, add back the e in the the Path and File Name box changing dooble.ex to dooble.exe.

6. Close properties session.

7. Start Dooble.

You should not see the command prompt window as it is started.

98
With the same tool, I asked "Give me a C source code sample of creating a window in PM"

Quote
The sources offer several examples of creating windows in OS/2 Presentation Manager using the WinCreateWindow and WinCreateStdWindow functions. Here's a C source code sample based on these examples, along with explanations:

#define INCL_WIN // Include header file for PM window functions
#include <os2.h>

// Client window procedure - handles messages for the window
MRESULT EXPENTRY ClientWndProc(HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2) {
    switch (msg) {
        case WM_PAINT:
            // Handle window painting - draw content here
            break;

        case WM_DESTROY:
            // Handle window destruction
            break;

        default:
            return WinDefWindowProc(hwnd, msg, mp1, mp2); // Default message processing
    }
    return NULL;
}

int main() {
    HAB hab;          // Anchor block handle
    HMQ hmq;          // Message queue handle
    HWND hwndFrame;   // Frame window handle
    HWND hwndClient;  // Client window handle
    QMSG qmsg;         // Message queue element

    ULONG flCreateFlags = FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER |
                        FCF_MINMAX | FCF_SHELLPOSITION | FCF_TASKLIST;

    static CHAR szClientClass[] = "Client Window"; // Client window class name

    hab = WinInitialize(NULL);   // Initialize PM
    hmq = WinCreateMsgQueue(hab, 0); // Create message queue

    // Register client window class
    WinRegisterClass(hab, szClientClass, ClientWndProc, CS_SIZEREDRAW, 0);

    // Create standard window
    hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_VISIBLE, &flCreateFlags,
                                    szClientClass, "My Window", 0L, NULL, 0, &hwndClient);

    // Message dispatch loop
    while (WinGetMsg(hab, &qmsg, NULL, 0, 0)) {
        WinDispatchMsg(hab, &qmsg);
    }

    WinDestroyWindow(hwndFrame); // Destroy window
    WinDestroyMsgQueue(hmq);    // Destroy message queue
    WinTerminate(hab);          // Terminate PM
    return 0;
}

Explanation:

Headers: INCL_WIN is defined to include the necessary header file (pmwin.h) for PM window functions. os2.h is included for general OS/2 API definitions.

Client Window Procedure: ClientWndProc is responsible for handling messages sent to the window. It's crucial for responding to events like painting and window destruction. The WinDefWindowProc function is used to process default messages.

Main Function:

Initialization:  WinInitialize and WinCreateMsgQueue initialize the Presentation Manager and create a message queue.

Window Class Registration: WinRegisterClass associates the client window procedure (ClientWndProc) with a window class name (szClientClass).

Window Creation: WinCreateStdWindow creates a standard window with a title bar, system menu, and other standard elements. The flCreateFlags variable controls the window's style and appearance.

Message Loop: The while loop retrieves messages from the message queue using WinGetMsg and dispatches them to the appropriate window procedure using WinDispatchMsg. This is the core of the event-driven model in PM.

Cleanup: WinDestroyWindow, WinDestroyMsgQueue, and WinTerminate clean up resources and exit the PM environment.
Key Points:

The code creates a standard window, which provides the basic framework for most PM applications.

You can customize the window's appearance using the flCreateFlags variable and its style constants.

The client window procedure is where you'll handle window-specific logic, including drawing content and responding to user interactions.

Understanding the message loop and how PM handles events is crucial for developing OS/2 applications.
Remember that this is a basic example, and building more complex applications would involve using additional PM API functions to create and manage other UI elements like menus, dialog boxes, and controls.
99
OK. It is now time to get crazy.

I used NotebookLM from Google - https://notebooklm.google.com
I uploaded the PDF of "1988 - Inside OS2 - Gordon Letwin" and it has an option at the right to create some kind of a podcast about that content. (Deep Dive conversation)

It created a 50MB, 20 minutes wav file. Crazy.

- https://drive.google.com/file/d/1CvGsp03V6MLTn64B2xdJzSwH83OFbatM/view?usp=sharing
100
Applications / Re: AVxCAT 2.1.1.2
« Last post by Martin Iturbide on January 08, 2025, 01:38:25 am »
Hello Remy.

I' now on version 2.2.0.0 with your indications of downloading the file and unzipping it on the 2.1.1.0 installation.
It seems to be working.


Checking the AVXCAT 2.2.pdf file, it says it works with - http://silk.apana.org.au/vorbis/oggvorbis-1.2.0-os2.zip
Will it work fine with https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/apps/mmedia/sound/convert/OggVorbis_1-3-3.wpi
Do you think it will be fine to update to it?

Regards
Pages: 1 ... 8 9 [10]