What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Using DialogBox function

Pages: (2): « First [ 1 ] 2 » Last »
Using DialogBox function
Author: Message:
oberststen
Junior Member
**

oberst.tk

Posts: 23
35 / Male / –
Joined: Jan 2003
O.P. Using DialogBox function
hey i'm new on C++, i tried to use the DialogBox when i recieve the "/xjaime" but it don't work, any ideas? or it just simply don't work?
07-09-2003 09:18 PM
Profile PM Web Find Quote Report
allex87
Junior Member
**

Avatar
Hmmm...

Posts: 99
37 / Male / –
Joined: Jul 2003
RE: Using DialogBox function
It does work...
How did u call it? Can u post here the full src code?
[Image: signature.gif]
07-09-2003 09:22 PM
Profile E-Mail PM Web Find Quote Report
oberststen
Junior Member
**

oberst.tk

Posts: 23
35 / Male / –
Joined: Jan 2003
O.P. RE: Using DialogBox function
here it is, i only paste the important parts

#include "resource.h"

LRESULT CALLBACK    Help(HWND, UINT, WPARAM, LPARAM);

HINSTANCE hInst;
HWND hWnd;

MPPLUGIN_RETURN_BOOL ParseCommand(/*[in]*/  const char* sCommand,
                                  /*[in]*/  const char* sCommandArg,
                                  /*[in]*/  PLUGIN_PARAM* pParam,
                                  /*[out]*/ char* sResult)
{
    if(stricmp(sCommand, "/xhelp") == 0)
    {
        DialogBox(hInst, (LPCTSTR)IDD_HELP, hWnd, (DLGPROC)Help);

        strcpy(sResult, "");
        return TRUE;
    }

    else if(stricmp(sCommand, "/xping") == 0)
    {
        strcpy(sResult, sCCNotify);
        strcat(sResult, "smppg"); //The notify code must be 5 characters long
        strcat(sResult, "Ping?");
        return TRUE;
    }
    return FALSE;
}

LRESULT CALLBACK Help(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
        case WM_INITDIALOG:
                return TRUE;

        case WM_COMMAND:
            if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
            {
                EndDialog(hDlg, LOWORD(wParam));
                return TRUE;
            }
            break;
    }
    return FALSE;
}

This post was edited on 07-09-2003 at 09:36 PM by oberststen.
07-09-2003 09:36 PM
Profile PM Web Find Quote Report
allex87
Junior Member
**

Avatar
Hmmm...

Posts: 99
37 / Male / –
Joined: Jul 2003
RE: Using DialogBox function
Well... I think hInst is not really initialized...
So.. DllMain should be:

BOOL APIENTRY DllMain( HINSTANCE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved)
{
    hInst = hModule;
        return TRUE;
}

This post was edited on 07-10-2003 at 02:00 AM by allex87.
[Image: signature.gif]
07-10-2003 02:00 AM
Profile E-Mail PM Web Find Quote Report
oberststen
Junior Member
**

oberst.tk

Posts: 23
35 / Male / –
Joined: Jan 2003
O.P. RE: Using DialogBox function
it doesn't work... i get to errors
07-10-2003 03:27 AM
Profile PM Web Find Quote Report
allex87
Junior Member
**

Avatar
Hmmm...

Posts: 99
37 / Male / –
Joined: Jul 2003
RE: Using DialogBox function
what errors?
[Image: signature.gif]
07-10-2003 03:31 AM
Profile E-Mail PM Web Find Quote Report
mikelo2k
New Member
*


Posts: 1
Joined: Jul 2003
Wink  RE: Using DialogBox function
Ok, how about you try debugging and some error checking api.
Right after the dialog box param call, put the following:
int x = GetLastError();

x will contain the error code. Now since you probably dont know how to debug a DLL, wsprintf() the code with "%i" into a string and messagebox it. Once you have the error code, post it here or consult your Win32 API manual.

There can be many reasons for the dialog not showing, sometimes if you have common controls (which you may) then you have to initialize common control sex ;)
07-10-2003 03:37 AM
Profile E-Mail PM Find Quote Report
allex87
Junior Member
**

Avatar
Hmmm...

Posts: 99
37 / Male / –
Joined: Jul 2003
RE: Using DialogBox function
Or do as described my "Debug plugins" thread....
http://shoutbox.menthix.net/showthread.php?tid=12615

This post was edited on 07-10-2003 at 03:43 AM by allex87.
[Image: signature.gif]
07-10-2003 03:39 AM
Profile E-Mail PM Web Find Quote Report
oberststen
Junior Member
**

oberst.tk

Posts: 23
35 / Male / –
Joined: Jan 2003
O.P. RE: Using DialogBox function
hmmm, something that i don't understand... i need to modify the APIEntry to

BOOL APIENTRY DllMain( HINSTANCE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved)
{
hInst = hModule;
        return TRUE;
}

and replace the original apientry? i didn't understand that
07-10-2003 03:23 PM
Profile PM Web Find Quote Report
n3tfusiOn
New Member
*


Posts: 9
– / Male / –
Joined: Jul 2003
RE: RE: Using DialogBox function
quote:
Originally posted by oberststen
hmmm, something that i don't understand... i need to modify the APIEntry to

BOOL APIENTRY DllMain( HINSTANCE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved)
{
hInst = hModule;
        return TRUE;
}

and replace the original apientry? i didn't understand that


yes , and that work lol :)
07-10-2003 05:00 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On