Generating GUIDs
From TrillWiki
Below, I will present a few methods for generating a GUID for your plugin, and explain how Trillian uses GUIDs. Once you have generated a GUID, copy it, and declare it in some common header file, like so:
#define MYGUID "{11111111-1111-1111-1111-11111111111}"
You will need to send this GUID to Trillian every time you call plugin_send, e.g.
plugin_send(MYGUID, "command", data);
Contents |
[edit] Method 1
There's an online GUID generator available at kruithof.xs4all.nl. If you would prefer to generate GUIDs for yourself then read on.
[edit] Method 2
If you use Delphi (version 7 or up), you can have it generate a GUID for you. To do so, simply make a constant like this:
Const MyGuid = ;
Then, put the cursor just before the ";" and then press Ctrl+Shift+G. Voila! You now have a unique GUID.
Const
MyGuid = ['{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'];
Now you just have to remove the square brackets around the string, and you're done:
Const
MyGuid = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}';
[edit] Method 3
For non-Delphi users, to generate a GUID yourself, you will need to run a tool like guidgen.exe, which is available from within Visual Studio (%install_dir%\common\tools\guidgen.exe). If you don't have Visual Studio, you can download GUIDGen from here
GUIDGen can create GUIDs in a few different formats. What you want is the registry format, which looks just like the GUIDs presented above.
[edit] GUIDs in Trillian
Trillian uses GUIDs to distinguish plugins from one another, particularly when it needs to call into plugin_main. If your GUID isn't unique, or if you give Trillian a different GUID during load than you do in commands like prefsInitialize or pluginRegisterAPI, you may find that these commands work incorrectly or not at all, as Trillian won't be able to find your plugin.
This guide has originally been created by TrillHunter.
