Windows

CastarSdk for Windows

Overview

2024-11-04

CastarSdk SDK will helps you make money with Windows apps. You only need to integrate once and reap the benefits easily. It provides an integration package to support Windows applications developed using .NET(C#)/C++/C or other Windows development languages. After 48 hours, you'll see revenue data in your dashboard. This document has a complete integrated solution and takes approximately 45 minutes to complete.

Integration options

Supports:

Windows7-Windows11,

32 bits or 64 bits

Step 1:Apply for ClientId

Go applications-> Add -> create your ClientId for Windows.

Step 2:Download

Click to download now. SDK for Windows

windows.zip -> Unzipped files:

  • CastarSdk_64.dll

  • CastarSdk_386.dll

  • CastarSdkWin_64.dll

  • CastarSdkWin_386.dll

Step 3: SDK install

(1) StartSDK is an interface function that opens SDK, and it receives a char* parameter, which is your own unique identifier Key.

(2) StopSDK is a function that closes SDK interface functions without any parameters. It is executed when SDL is planned to be stopped.

(3) Load the corresponding DLL file according to the production environment, and you can freely define the DLL path.

(4) CastarSdkWin_ *. dll name can be changed, CastarSdk_ *. dll name cannot be changed.

#include 
    #include 
    
    #ifdef  _WIN64
    #define SDKLOADFILEDLL L"CastarSdkWin_64.dll"
    #else
    #define SDKLOADFILEDLL L"CastarSdkWin_386.dll"
    #endif
    
    //Declare the function pointer to start running the SDK
    typedef BOOL(*endSdk)();
    
    //Declare function pointer to end running SDK
    typedef BOOL(*startSdk)(char* key);
    
    HMODULE hand = NULL;
    
    //Set the ClientId here
    const char *keybuf = "CSK****FHQlUQZ";
    
    void InitSDKStart() {
        startSdk demoDllStart = (startSdk)GetProcAddress(hand, "startSDK");
        if (demoDllStart)
        {
            /*
            The SDK will always block when running successfully, 
            and will throw a Boolean error when an exception occurs.
            */
            if (!demoDllStart((char *)keybuf))
            {
                std::cout << "startSDK Error\n";
            }
        }
        else
        {
            std::cout << "startSDK Error\n";
        }
    }
    
    int main(int argc, char *argv[])
    {
        hand = LoadLibrary(SDKLOADFILEDLL);
        if (NULL == hand || INVALID_HANDLE_VALUE == hand) {
            std::cout << "LoadLibrary Error\n";
            return -1;
        }
    
        //The thread calls the InitSDKStart function to avoid blocking the main thread.
        CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InitSDKStart, NULL, 0, NULL);
    
        /*
        ......
        Handle your own business logic here
        */
    
        //When needed, call the end function
        endSdk demoDllEnd = (endSdk)GetProcAddress(hand, "stopSDK");
        if (demoDllEnd)
        {
            demoDllEnd();
        }
        else
        {
            std::cout << "startSDK Error\n";
        }
    
        std::cout << "End SDK Demo!\n";
    }

Attention:

1.The suffixes 64 and 386 correspond to 64 bit and 32-bit compilation environments, respectively. Please load the DLL appropriately according to the program compilation environment.

2.The startSDK function blocks execution. Please open a sub thread for execution, otherwise it will block the main thread.

3.CastarSdkWin *. dll depends on CastarSdk *. dll. When deploying in a production environment, please place both DLLs in a directory that the program can load.

Other questions

How to check the docking status after the docking is completed?

You can check the docking status of the SDK in the Dashboard - Applicatiopns menu. After the SDK is integrated and initialized successfully, you can check the activation status on the Dashboard. There is a 10-15 minute delay in the first activation status. Please wait patiently for the status update.

After the docking is completed, there is no data on the dashboard after the hang-up test?

Our Dashboard data refresh time is 0:00 every day to settle the previous day's earnings. After you generate data today, please query the test data the next day. We will settle your previous day's earnings the next day.

Contact us

If you have other questions, you can consult through the Livechat customer service window on the right side of the dial and official website, or you can contact our customer service staff through the following channels

Official email : support@castarsdk.com

WhatsAPP : https://whatsapp.com/channel/0029Vb0bHo50gcfFe6kQJR0a

Skype : https://join.skype.com/invite/ptBB6eukfkdX

Last updated