View previous topic :: View next topic |
Author |
Message |
stuartd
Joined: 04 Aug 2006 Posts: 6
|
Posted: Fri Aug 04, 2006 3:58 am Post subject: tlbimpd enum output problem |
|
|
Found a slight problem with the output of enums by tlbimpd:
enum FileModeConstants {
/*[uuid("2c9b7380-ae63-11d3-911c-00105a17b60")]*/
static GUID IID = { 0x2c9b7380, 0xae63, 0x11d3, 0x91, 0x1c, 0x00, 0x10, 0x5a, 0x17, 0xb6, 0x08 };
createAlways = 0,
createExisting = 1,
createUnique = 2,
createOpen = 3,
}
This fails to compile as the guid is defined inside the enum body.
cheers, and nice work by the way! |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Tue Aug 15, 2006 10:27 pm Post subject: Re: tlbimpd enum output problem |
|
|
stuartd wrote: | This fails to compile as the guid is defined inside the enum body.
cheers, and nice work by the way! | I found this same problem today (and then I remember someone had posted about it). I think I figured out the solution, too.
In my situation, this flaw in tlbimpd was fixed by changing line 258 in juno\tools\codegen.d: Code: | if (!type.isEnum || !type.isAlias) { | to Code: | if (!type.isEnum && !type.isAlias) { | (which is I'm sure what John meant to type in the first place).
Juno and tlbimpd are really cool (I'm just now figuring out how cool!), and I hope their development continues. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Tue Aug 15, 2006 10:33 pm Post subject: Re: tlbimpd enum output problem |
|
|
Also, DMD seemed to like the outputted files better after I changed line 376 in juno\tools\codegen.d from Code: | output.write("static GUID IID = "); | to Code: | output.write("static GUID CLSID = "); |
(I was inspired by juno\xml\msxml.d to make this change after the compiler wouldn't compile a module that tlbimpd created for me.) |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
|
Back to top |
|
|
John
Joined: 17 Jan 2006 Posts: 75
|
Posted: Fri Aug 18, 2006 3:18 am Post subject: |
|
|
Thanks for the fixes.
Regarding the GUID issue, changing the line in codegen.d to the following should fix it:
Code: |
if (declaringType.isCoClass)
output.write("static GUID CLSID = ");
else
output.write("static GUID IID = ");
|
I know there's been no code update for ages, but I am working on Juno (and tlbimpd) when time allows. I want to get tlbimpd into a fairly stable state - except there's one major bug in reflect.d which prevents parameters from being correctly emitted in some cases. It's related to the ticket you opened. That whole algorithm needs rewriting. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Fri Aug 18, 2006 11:59 am Post subject: |
|
|
John wrote: | Thanks for the fixes. | You're quite welcome. I just hope they're helpful. A lot of this COM stuff is still way over my head, but I'm some of it is making much more sense to me.
John wrote: | I know there's been no code update for ages, but I am working on Juno (and tlbimpd) when time allows. I want to get tlbimpd into a fairly stable state - except there's one major bug in reflect.d which prevents parameters from being correctly emitted in some cases. It's related to the ticket you opened. That whole algorithm needs rewriting. | I'm glad to hear you're still interested in the project. The type identification issue in reflect is annoying, but my workaround (Ticket #1) allows identification of most of the types. (There are still a few cases where even my work-around fails, but they are few enough that I think I'll just manually fix the output for now.)
If I have some free time, I think I'm going to add some wiki content to explain how tlbimpd can be used with Juno to use some COM objects. Nothing too fancy (because I don't know how to do anything fancy), but it'd help me remember what I've learned (and perhaps someone else could benefit from it, too). |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|