Results 1 to 2 of 2

Thread: Control Panel Application

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402

    Control Panel Application

    I'm having a little problem with this code;

    Code:
    #include <windows.h>
    #include <cpl.h>
    #include "resource.h"
    //#include "CPLhhdr.h"
    
    HINSTANCE hinst = NULL;
    
    int WINAPI DllMain(HINSTANCE hinst, DWORD Reason, LPVOID)
    { return 1; }
    
    LONG CALLBACK CPlApplet(HWND hwndCPL, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
    { 
        int i; 
        LPCPLINFO lpCPlInfo; 
    
        i = (int) lParam1; 
    
        switch (uMsg) { 
            case CPL_INIT:      // first message, sent once 
                hinst = GetModuleHandle("test.cpl"); 
                return TRUE; 
     
            case CPL_GETCOUNT:  // second message, sent once 
                return 1; 
                break; 
     
            case CPL_INQUIRE: // third message, sent once per application 
                lpCPlInfo = (LPCPLINFO) lParam2; 
                lpCPlInfo->lData = 0; 
                lpCPlInfo->idIcon = IDI_PC;
                lpCPlInfo->idName = IDS_NAME;
    			lpCPlInfo->idInfo = IDS_DESC;
                break; 
    
            case CPL_DBLCLK:    // application icon double-clicked 
                DialogBox(hinst, MAKEINTRESOURCE(IDD_DIALOG1), hwndCPL, NULL); 
                break; 
     
            case CPL_STOP:      // sent once per application before CPL_EXIT 
                break; 
     
            case CPL_EXIT:    // sent once before FreeLibrary is called 
                break; 
     
            default: 
                break; 
        } 
        return 0; 
    }
    It's supposed to be for a control panel application file, but when compiled, it gives me this error:

    LINK : warning LNK4089: all references to "USER32.dll" discarded by /OPT:REF

    And Control Panel acts like the function never existed - that is, it never calls the function.

    What's wrong with the code? Could someone please send me a sample source code?
    Last edited by Microbasic; Aug 2nd, 2001 at 11:54 AM.


    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width