Page 1 of 1 1
Topic Options
#157010 - 2006-02-10 10:43 AM Scripting GUIDGen.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Guy's,

I started messing around with a script that creates buttons and/or menu items in IE. MS has a tutorial on this. In the tutorial the GUIDGen.exe tool is used to create a GUID. Is it possible to script the workings of GUIDGen.exe? All other stuff is just simple registry writes but a new GUID is needed before any registry writes can be done. Never did anything with calling an API from a script so I have no idea where to start.

Adding Toolbar Buttons to IE
Adding Menu Items to IE
Get GUIDGen.exe here

A registry suitable GUID to use within kix is what I'm looking for.

A quote from the readme included in the download.
Quote:


The GUID Generator component lets you generate globally unique identifiers, or GUIDs, that you can use to identify your Microsoft® ActiveX® classes, objects, and interfaces. GUIDGen does this by calling the CoCreateGuid application programming interface (API) function to generate a new GUID. The resulting GUID is copied to the Clipboard in one of four formats for insertion into your application’s source code.

The four formats are:
•Defined in an IMPLEMENT_OLECREATE macro, which allows instances of a CCmdTarget-derived class to be created by Automation clients. For example:
// {CA761230-ED42-11CE-BACD-00AA0057B223}
IMPLEMENT_OLECREATE(<>, <>,
0xca761230, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23);

•Defined using the DEFINE_GUID macro, which is commonly used in programming that does not use Microsoft Foundation Classes (MFC). For example:
// {CA761231-ED42-11CE-BACD-00AA0057B223}
DEFINE_GUID(<>, 0xca761231, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23);

•Declared as a statically allocated structure. For example:
// {CA761232-ED42-11CE-BACD-00AA0057B223}
static const GUID <> = { 0xca761232, 0xed42, 0x11ce, { 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23 } };

•Specified in a form suitable for registry entries or Registry Editor scripts. For example:
{CA761233-ED42-11CE-BACD-00AA0057B223}



_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#157011 - 2006-02-10 11:12 AM Re: Scripting GUIDGen.exe
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
What you actually want to script is this:
Quote:

GUIDGen does this by calling the CoCreateGuid application programming interface (API) function to generate a new GUID




This API is not part of GUIDGen - GUIDGen is just a wrapper exe to allow you to call the API.

If you search around for scripts which call coCreateGUID you should be able to find something that you can convert or use directly.

If not, post again.

Top
#157012 - 2006-02-10 11:20 AM Re: Scripting GUIDGen.exe
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I thought I'd already done this, but it looks like it may not be that easy...
Top
#157013 - 2006-02-10 11:49 AM Re: Scripting GUIDGen.exe
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
There is a free GUID generator called GUIDMaker which has a scriptable component available here: http://www.serverobjects.com/products.htm

Download the small zip, extract the DLL, copy to your system32 directory and register it.

Once you've done that you can issue GUIDs to your heart's content.

Here's one I prepared earlier:
Code:
$sGUID=CreateObject("GuidMakr.GUID").GetGUID
"GUID="+$sGUID+@CRLF



Output:
Quote:

GUID={BA456FCA-FC6F-45D4-A72B-2C9DFAF07E89}



Top
#157014 - 2006-02-10 11:49 AM Re: Scripting GUIDGen.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
I should have been clearer in my first post.

I meant to say: "scripting the workings of GUIDGen.exe". So if it calls external stuff to do the work how then to script that.

Will do some searching but if anyone has some ideas on this Id' be happy to listen.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#157015 - 2006-02-10 11:51 AM Re: Scripting GUIDGen.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Will have a look at that. Going to do some testing and will be back with the results.

Thanx
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#157016 - 2006-02-11 12:58 PM Re: Scripting GUIDGen.exe
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
And we even have a UDF to create a GUID: CreateGUID - Creates a GUID (globally unique identifier)
_________________________
There are two types of vessels, submarines and targets.

Top
#157017 - 2006-02-13 09:15 PM Re: Scripting GUIDGen.exe
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
For the current status of the project this functionality is used in have a look at the link below.

http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=156824&an=0&page=0&vc=1
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.06 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org