BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unexpected IOTAModuleServices.CreateModule behaviour

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OpenToolsAPI
View previous topic :: View next topic  
Author Message
Bart van Hofwegen
Guest





PostPosted: Sun Mar 25, 2007 10:36 pm    Post subject: Unexpected IOTAModuleServices.CreateModule behaviour Reply with quote



Hi,

I am trying to create a simple new unit using the
IOTAModuleServices.CreateModule. I have encountered the following problems:

- It does not matter if I return sUnit or an empty string in the
ModuleCreator's GetCreatorType function; I had understood that returning
sUnit simply builds a new unit with skeleton code without having to supply
the complete source code yourself. Several sources on the internet point
this out. I get the 'Creator needs to supply source code' error if I return
nil in the NewImplSource function for both sUnit AND the empty string, and I
was expecting this only to happen for an empty string returned in
GetCreatorType, but not for the sUnit return value. Using sUnit also does
not automatically generate any code. Therefore, there seems to be no
difference in the behaviour between an empty string and sUnit, as a return
value from GetCreatorType, is this so?

- The above is no problem, I can supply the code skeleton myself, of course,
in the NewImplSource function. This works fine, only that the call to this
function receives an empty ModuleIdent parameter, and I expected the newly
created unitname (e.g. 'Unit1') in this parameter. GetExisting returns
False, and GetUnnamed returns True. This makes it impossible to generate an
errorless unit's first line 'unit Unit1;'

The last problem keeps me from using this functionality, but I have the
feeling that I am missing out on something. I am using Delphi 2006.

What is going wrong? Any help would be greatly appreciated, TIA,

Bart van Hofwegen
Back to top
Erik Berry
Guest





PostPosted: Thu Mar 29, 2007 2:26 pm    Post subject: Re: Unexpected IOTAModuleServices.CreateModule behaviour Reply with quote



Bart van Hofwegen wrote:
Quote:
this out. I get the 'Creator needs to supply source code' error if I return
nil in the NewImplSource function for both sUnit AND the empty string, and I
was expecting this only to happen for an empty string returned in
GetCreatorType, but not for the sUnit return value. Using sUnit also does
not automatically generate any code. Therefore, there seems to be no
difference in the behaviour between an empty string and sUnit, as a return
value from GetCreatorType, is this so?

Starting with Delphi 8 or so, the behavior changed. I believe you now
must supply the unit's source. If there are official docs/comments still
stating otherwise, I'd file it in QC and post the # here, so we can get it
fixed.

Quote:
- The above is no problem, I can supply the code skeleton myself, of course,
in the NewImplSource function. This works fine, only that the call to this
function receives an empty ModuleIdent parameter, and I expected the newly
created unitname (e.g. 'Unit1') in this parameter. GetExisting returns
False, and GetUnnamed returns True. This makes it impossible to generate an
errorless unit's first line 'unit Unit1;'

I seem to recall past problems like this being reported. If you can
create a simple test case, please put it in QC so we can get this fixed as well.

Erik
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OpenToolsAPI All times are GMT
Page 1 of 1

 
Jump to:  
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, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.