mIRC Home    About    Download    Register    News    Help

Print Thread
#120476 17/05/05 10:08 PM
Joined: Mar 2005
Posts: 7
G
Goblin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Mar 2005
Posts: 7
Hi,

How would I convert mVersion into a string (char[]) for viewing with MessageBox?


I'm trying something like this...

DWORD mVersion = li->mVersion;
version_string = char[10];
MessageBox(NULL, itoa(mVersion, version_string, 10), "info", MB_OK);




but that shows some 7-digit number...


Can anybody help?



Also, in my DLL, how would I ask mIRC for information? for example, if I want to get the value of the $me identifier, what commands would I use to store that in some variable in my DLL?



Thanks.

#120477 17/05/05 10:31 PM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Hi, and welcome to the wonderful world of writing mIRC DLLs wink

The version number is stored as two short numbers (the major, and the minor version number), packed together into mVersion. You can use Windows' HIWORD and LOWORD macros to retrieve each half of it; LOWORD retrieves the major version number, and HIWORD retrieves the minor part, as can be seen in the following example.

Code:
  char version_string[32];

  WORD major_version = LOWORD(li->mVersion);
  WORD minor_version = HIWORD(li->mVersion);

  wsprintf(version_string, "mIRC %d.%d", major_version, minor_version);

  MessageBox(NULL, version_string, "info", MB_OK);


Quote:
Also, in my DLL, how would I ask mIRC for information? for example, if I want to get the value of the $me identifier, what commands would I use to store that in some variable in my DLL?

As it is now, you basically have two choices: either let the user pass this information to you as parameter to the DLL call (eg. "/dll mydll.dll testProc $me"), or you can use the SendMessage way to let mIRC evaluate a string for you (documented in the mIRC helpfile, under "SendMessage"). Good luck!


Saturn, QuakeNet staff
#120478 18/05/05 12:47 AM
Joined: Mar 2005
Posts: 7
G
Goblin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Mar 2005
Posts: 7
Excellent! Thanks a HEAP!


Link Copied to Clipboard