Jump to content
dummzeuch

Is there a way to get the wizard name / executable from a nindex?

Recommended Posts

When you register a new wizard with the IDE using the Open Tools API function IOTAWizardServices.AddWizard you get an index back.

 

Is there a way to get any information about wizards added that way? I'd prefer getting a list of them with the associated index, but a function that for a given index gives me information about that wizard would also be fine.

 

The reason I'm asking is that I sometimes get an error message when closing the IDE telling me about an error in Wizard xx, where xx is a number (17 in my case), and I would like to know which of the installed wizards is causing it without having to disable each of them and hoping the error occurs (which does not happen reliably enough for this method).

 

689624461_2019-09-0116_09_14-Error.png.fb31b51938aa3c5397b6f1d4c9dc8510.png

Edited by dummzeuch
  • Like 1

Share this post


Link to post

Why not just keep your own list? i.e. when you call AddWizard to add a wizard, save the index and the name (via GetName or GetIDString on the wizard) in your own list.

  • Like 1

Share this post


Link to post
18 hours ago, dummzeuch said:

Is there a way to get any information about wizards added that way?

AFAIK, no. 

Quote

The reason I'm asking is that I sometimes get an error message when closing the IDE telling me about an error in Wizard xx, where xx is a number (17 in my case), and I would like to know which of the installed wizards is causing it

What makes you think another wizard is causing your wizard to crash? Have you tried simply debugging your wizard to find out what is actually crashing in it? Are you unregistering your wizard during IDE SHUTDOWN? What does your wizard actually do, and what dependancies does it really on?

Quote

 

Quote

 

Edited by Remy Lebeau

Share this post


Link to post
4 hours ago, Remy Lebeau said:

AFAIK, no. 

What makes you think another wizard is causing your wizard to crash? Have you tried simply debugging your wizard to find out what is actually crashing in it?

I didn't say that I think some other wizard is causing mine to crash. I just know that there is one wizard which crashes the IDE (or rather causes the error message) on shutdown.

I am not sure that it is my wizards that's causing the crash. That's why I wanted so see which one "expert17" actually is. If it's mine, I have to look further, if it's another one, I might just have to live with it.

4 hours ago, Remy Lebeau said:

Have you tried simply debugging your wizard to find out what is actually crashing in it?

Yes, of course I have tried to debug it. I have found one problem that might have caused the error (never mix interfaces and object references...). It hasn't occurred since then, but that might just have been pure chance.

4 hours ago, Remy Lebeau said:

Are you unregistering your wizard during IDE SHUTDOWN? What does your wizard actually do, and what dependancies does it really on?

Yes, I do. The wizard I am talking about is GExperts, so listing what it does might be rather time consuming. It depends on the default IDE designtime and runtime packages.

Share this post


Link to post
14 hours ago, Dave Nottage said:

Why not just keep your own list? i.e. when you call AddWizard to add a wizard, save the index and the name (via GetName or GetIDString on the wizard) in your own list.

How do I do that with other wizards? After all I am registering only mine.

 

One odd thing I found was the the index returned by IOTAWizardServices.AddWizard is always 0, which is odd given that according to the splash screen my wizard is not the first to be registered. Many examples I found on the interwebs treat this as an error. But I could not find any official documentation on the results of that function. (And I don't think that's the cause for the error message.)

Share this post


Link to post
9 hours ago, dummzeuch said:

How do I do that with other wizards?

As Remy says, you cannot. Add a feature request 😉

9 hours ago, dummzeuch said:

I just know that there is one wizard which crashes the IDE (or rather causes the error message) on shutdown.

I know how hard that can be to track down, even with debugging Delphi from Delphi. You might want to disable other experts one by one at least to find the culprit.

Share this post


Link to post

I am not good at writing and debugging experts, so I could be quite wrong in this question .. Nevertheless, I think that it is possible to function GetPackageName(Index: Integer): string; or function GetPackage(Index: Integer): IOTAPackageInfo;  suit you.  In any case, you can familiarize yourself with them in more detail on the website: Browsing Package Information

Edited by Dinar
  • Haha 1

Share this post


Link to post
25 minutes ago, Dinar said:

I think that it is possible to function GetPackageName(Index: Integer): string; or function GetPackage(Index: Integer): IOTAPackageInfo;  suit you.

A wizard index is not a package index, though.  AFAIK, there is no way to enumerate the installed wizards and query them for their package info.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×