View Issue Details

IDProjectCategoryView StatusLast Update
0003903JEDI VCL00 JVCL Componentspublic2008-01-06 06:01
ReportertorworxAssigned Toobones 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.34 
Summary0003903: TJvPlugin Wizard dosen't work in BDS2006.
DescriptionI can find JvPlugin Wizard in BDS2006 - New Items - Wizards. But it will be show a error message when I new a dll plugin library or bpl plugin package, and then it will close the current project, and create a wrong plugin project.
TagsNo tags attached.

Relationships

has duplicate 0004245 resolvedobones Package Based Delphi Programming 

Activities

Werewolf

2006-09-14 02:06

reporter   ~0010122

I have the same problem.
I solved it by creating plugin in Delphi6.
It's not very good solution =)

torworx

2006-09-22 07:52

reporter   ~0010151

When can it be fixed. We are waiting for the fix. Thanks.

obones

2006-09-22 08:42

administrator   ~0010152

Well, I'm looking for a solution, but you could also look on your side...

torworx

2006-09-22 08:52

reporter   ~0010153

OK, When I have free time.

2006-09-23 06:55

 

JvPluginWizard.pas (31,481 bytes)

torworx

2006-09-23 06:58

reporter   ~0010156

It seems that I found the solution, and I uploaded the fixed file -- JvPluginWizard.pas.

Hope this can be helpfull.

obones

2006-09-23 09:05

administrator   ~0010157

Can you tell me which lines you changed, or better yet, provide a parch file ?

http://homepages.borland.com/jedi/wiki/index.php?title=Create_a_patch_file

2006-09-23 20:50

 

JvPluginWizard.patch (10,905 bytes)
Index: JvPluginWizard.pas
===================================================================
--- JvPluginWizard.pas	(revision 2)
+++ JvPluginWizard.pas	(working copy)
@@ -50,6 +50,18 @@
   JvTypes;
 
 type
+  TPlugInfo = record
+    { 0 = dll; 1 = dpk }
+    PlugType: Integer;
+    { Private variables which will be used to store some properties for
+      the TJvPlugin }
+    PlugName: string;
+    PlugDesc: string;
+    PlugAuth: string;
+    PlugCopy: string;
+    PlugUID: string;
+  end;
+  
   TJvPluginWizard = class(TNotifierObject, IOTAWizard, IOTARepositoryWizard,
     IOTAMenuWizard, IOTAProjectWizard)
   public
@@ -71,18 +83,13 @@
     function GetMenuText: string; virtual;
   end;
 
-  TJvPluginProjectCreator = class(TInterfacedObject, IOTACreator, IOTAProjectCreator) // both interfaces needed !!!!
+  TJvPluginProjectCreator = class(TInterfacedObject, IOTACreator, IOTAProjectCreator
+  {$IFDEF COMPILER8_UP}, IOTAProjectCreator80{$ENDIF COMPILER8_UP}
+  ) // both interfaces needed !!!!
   public
     Wizard: TJvPluginWizard;
     { 0 = dll; 1 = dpk }
-    PlugType: Integer;
-    { Private variables which will be used to store some properties for
-      the TJvPlugin }
-    PlugName: string;
-    PlugDesc: string;
-    PlugAuth: string;
-    PlugCopy: string;
-    PlugUID: string;
+    PlugInfo: TPlugInfo;
     Project: IOTAModule;
     function GetFileName: string;
     function GetOptionFileName: string;
@@ -96,21 +103,21 @@
     function GetFileSystem: string;
     function GetOwner: IOTAModule;
     function GetUnnamed: Boolean;
+    {$IFDEF COMPILER8_UP}
+    // IOTAProjectCreator50
+    procedure NewDefaultProjectModule(const Project: IOTAProject);
+    // IOTAProjectCreator80
+    function GetProjectPersonality: string;
+    {$ENDIF COMPILER8_UP}
   end;
 
   TJvPluginModuleCreator = class(TInterfacedObject, IOTACreator, IOTAModuleCreator)
   public
     Wizard: TJvPluginWizard;
-    { 0 = dll; 1 = dpk }
-    PlugType: Integer;
     Project: IOTAModule;
-    { Private variables which will be used to store some properties for
-      the TJvPlugin }
-    PlugName: string;
-    PlugDesc: string;
-    PlugAuth: string;
-    PlugCopy: string;
-    PlugUID: string;
+    PlugInfo: TPlugInfo;
+    constructor Create(AWizard: TJvPluginWizard; AProject: IOTAModule; APlugInfo:
+        TPlugInfo);
     function GetCreatorType: string;
     function GetExisting: Boolean;
     function GetFileSystem: string;
@@ -250,6 +257,8 @@
 var
   ModuleServices: IOTAModuleServices;
   ProjectCreator: TJvPluginProjectCreator;
+  lPlugInfo: TPlugInfo;
+  ModuleCreator: TJvPluginModuleCreator;
 begin
   with TfrmPluginParams.Create(nil) do
     try
@@ -260,19 +269,27 @@
         begin
           ProjectCreator := TJvPluginProjectCreator.Create;
           ProjectCreator.Wizard := Self;
+          with lPlugInfo do
+          begin
+            { rbDll checked     => dll     => PlugType = 0 = Ord(False)
+              rbPackage checked => package => PlugType = 1 = Ord(True)
+            }
+            PlugType := Ord(rbPackage.Checked); //  radPluginType.ItemIndex;
+            PlugName := Trim(edtPluginName.Text);
 
-          { rbDll checked     => dll     => PlugType = 0 = Ord(False)
-            rbPackage checked => package => PlugType = 1 = Ord(True)
-          }
-          ProjectCreator.PlugType := Ord(rbPackage.Checked); //  radPluginType.ItemIndex;
-          ProjectCreator.PlugName := Trim(edtPluginName.Text);
+            PlugAuth := Trim(edtPluginAuthor.Text);
+            PlugCopy := Trim(edtPluginCopyright.Text);
+            PlugDesc := Trim(mmoDescripton.Text);
+            PlugUID := Trim(edtPluginUID.Text);
+          end;
+          ProjectCreator.PlugInfo := lPlugInfo;
 
-          ProjectCreator.PlugAuth := Trim(edtPluginAuthor.Text);
-          ProjectCreator.PlugCopy := Trim(edtPluginCopyright.Text);
-          ProjectCreator.PlugDesc := Trim(mmoDescripton.Text);
-          ProjectCreator.PlugUID := Trim(edtPluginUID.Text);
+          ModuleServices.CreateModule(ProjectCreator);
 
-          ModuleServices.CreateModule(ProjectCreator);
+          // Plugin Module
+          ModuleCreator := TJvPluginModuleCreator.Create(Self, ProjectCreator.Project, lPlugInfo);
+
+          ModuleServices.CreateModule(ModuleCreator);
         end;
       end;
     finally
@@ -287,10 +304,10 @@
 function TJvPluginProjectCreator.GetFileName: string;
 begin
   { 0 = dll; 1 = dpk }
-  if PlugType = 0 then
-    Result := GetCurrentDir + DirDelimiter + cPlgPrefix + PlugName + '.dpr'
+  if PlugInfo.PlugType = 0 then
+    Result := GetCurrentDir + DirDelimiter + cPlgPrefix + PlugInfo.PlugName + '.dpr'
   else
-    Result := GetCurrentDir + DirDelimiter + cPlgPrefix + PlugName + '.dpk';
+    Result := GetCurrentDir + DirDelimiter + cPlgPrefix + PlugInfo.PlugName + '.dpk';
 end;
 
 function TJvPluginProjectCreator.GetOptionFileName: string;
@@ -304,20 +321,7 @@
 end;
 
 procedure TJvPluginProjectCreator.NewDefaultModule;
-var
-  Module: IOTAModule;
-  ModuleCreator: TJvPluginModuleCreator;
 begin
-  ModuleCreator := TJvPluginModuleCreator.Create;
-  ModuleCreator.Wizard := Wizard;
-  ModuleCreator.PlugType := PlugType;
-  ModuleCreator.PlugName := PlugName;
-  ModuleCreator.PlugAuth := PlugAuth;
-  ModuleCreator.PlugDesc := PlugDesc;
-  ModuleCreator.PlugCopy := PlugCopy;
-  ModuleCreator.PlugUID := PlugUID;
-  ModuleCreator.Project := Project;
-  Module := (BorlandIDEServices as IOTAModuleServices).CreateModule(ModuleCreator);
 end;
 
 function TJvPluginProjectCreator.NewOptionSource(const ProjectName: string): IOTAFile;
@@ -334,11 +338,12 @@
   S: string;
 begin
   { 0 = dll; 1 = dpk }
-  if PlugType = 0 then
+  if PlugInfo.PlugType = 0 then
     S := 'library ' + ProjectName + ';' + CrLf +
       CrLf +
       'uses' + CrLf +
-      '  ShareMem,' + cPluginPrefix + PlugName + ';' + CrLf +
+//      '  ShareMem,' + cPluginPrefix + PlugName + ';' + CrLf +
+      '  ShareMem;' + CrLf +
       CrLf +
       '{$R *.res}' + CrLf +
       CrLf +
@@ -367,6 +372,9 @@
       {$IFDEF COMPILER9}
       '  vcl,' + CrLf + '  JvCoreD9R;' + CrLf2 +
       {$ENDIF COMPILER9}
+      {$IFDEF COMPILER10}
+      '  vcl,' + CrLf + '  JvCoreD10R;' + CrLf2 +
+      {$ENDIF COMPILER10}
       'end.';
 
   Result := TJvOTAFile.Create(S);
@@ -375,7 +383,7 @@
 function TJvPluginProjectCreator.GetCreatorType: string;
 begin
   { 0 = dll; 1 = dpk }
-  if PlugType = 0 then
+  if PlugInfo.PlugType = 0 then
     Result := sLibrary
   else
     Result := sPackage;
@@ -413,7 +421,7 @@
 
 function TJvPluginProjectCreator.GetOwner: IOTAModule;
 begin
-  Result := GetCurrentProjectGroup; // nil
+  Result := GetCurrentProjectGroup;
 end;
 
 function TJvPluginProjectCreator.GetUnnamed: Boolean;
@@ -421,6 +429,21 @@
   Result := True;
 end;
 
+{$IFDEF COMPILER8_UP}
+
+procedure TJvPluginProjectCreator.NewDefaultProjectModule(
+  const Project: IOTAProject);
+begin
+  Self.Project := Project;
+end;
+
+function TJvPluginProjectCreator.GetProjectPersonality: string;
+begin
+  Result := sDelphiPersonality;
+end;
+
+{$ENDIF COMPILER8_UP}
+
 //=== { TJvOTAFile } =========================================================
 
 // TJvOTAFile - from Stefaan Lesage
@@ -447,6 +470,14 @@
   RegisterCustomModule(TJvPlugIn, TCustomModule);
 end;
 
+constructor TJvPluginModuleCreator.Create(AWizard: TJvPluginWizard; AProject:
+    IOTAModule; APlugInfo: TPlugInfo);
+begin
+  Wizard := Wizard;
+  Project := AProject;
+  PlugInfo := APlugInfo
+end;
+
 //=== { TJvPluginModuleCreator } =============================================
 
 {*****************************************************************************
@@ -470,10 +501,10 @@
 begin
   with TJvPlugIn(INTAComponent(FormEditor.GetRootComponent).GetComponent) do
   begin
-    Author := PlugAuth;
-    Description := PlugDesc;
-    Copyright := PlugCopy;
-    PluginID := PlugUID;
+    Author := PlugInfo.PlugAuth;
+    Description := PlugInfo.PlugDesc;
+    Copyright := PlugInfo.PlugCopy;
+    PluginID := PlugInfo.PlugUID;
   end;
 end;
 
@@ -576,7 +607,7 @@
 
 function TJvPluginModuleCreator.GetFormName: string;
 begin
-  Result := cPluginPrefix + PlugName;
+  Result := cPluginPrefix + PlugInfo.PlugName;
 end;
 
 {*****************************************************************************
@@ -598,7 +629,7 @@
 
 function TJvPluginModuleCreator.GetImplFileName: string;
 begin
-  Result := GetCurrentDir + DirDelimiter + cPluginPrefix + PlugName + '.pas'
+  Result := GetCurrentDir + DirDelimiter + 'u' + cPluginPrefix + PlugInfo.PlugName + '.pas'
 end;
 
 {*****************************************************************************
@@ -663,42 +694,11 @@
  *****************************************************************************}
 
 function TJvPluginModuleCreator.GetOwner: IOTAModule;
-var
-  ModuleServices: IOTAModuleServices;
-  Module: IOTAModule;
-  NewModule: IOTAModule;
 begin
-  // You may prefer to return the project group's ActiveProject instead
-  Result := nil;
-  ModuleServices := (BorlandIDEServices as IOTAModuleServices);
-  Module := ModuleServices.CurrentModule;
-
-  if Module <> nil then
-  begin
-    if Module.QueryInterface(IOTAProject, NewModule) = S_OK then
-      Result := NewModule
-    else
-    // (rom) not sure if DELPHI or COMPILER
-    {$IFDEF COMPILER5}
-    if Module.GetOwnerCount > 0 then
-    begin
-      NewModule := Module.GetOwner(0);
-    {$ENDIF COMPILER5}
-      {$IFDEF COMPILER6_UP}
-      if Module.OwnerModuleCount > 0 then
-      begin
-        NewModule := Module.OwnerModules[0];
-      {$ENDIF COMPILER6_UP}
-        if NewModule <> nil then
-          if NewModule.QueryInterface(IOTAProject, Result) <> S_OK then
-            Result := nil;
-      {$IFDEF COMPILER6_UP}
-      end;
-      {$ENDIF COMPILER6_UP}
-    {$IFDEF COMPILER5}
-    end;
-    {$ENDIF COMPILER5}
-  end;
+  // Owned by current project
+  Result := GetCurrentProjectGroup;
+  if Assigned(Result) then
+    Result := (Result as IOTAProjectGroup).ActiveProject;
 end;
 
 {*****************************************************************************
@@ -831,7 +831,7 @@
   TypeName := FormIdent;
   Ancestor := AncestorIdent;
 
-  TypeName := PlugName;
+  TypeName := PlugInfo.PlugName;
 
   Source :=
     'unit ' + ModuleIdent + ';' + CrLf2 +
@@ -856,7 +856,7 @@
     'function RegisterPlugin: TJvPlugin; stdcall;' + CrLf2;
 
   { 0 = dll; 1 = dpk }
-  if PlugType <> 0 then
+  if PlugInfo.PlugType <> 0 then
     Source := Source + 'exports RegisterPlugin;' + CrLf2;
 
   Source := Source +
JvPluginWizard.patch (10,905 bytes)

torworx

2006-09-23 20:53

reporter   ~0010159

I wish the file uploaded this time is right. :)

obones

2006-09-28 06:31

administrator   ~0010200

Well, I tried, and it does not seem to work completely. I no longer get the error about "not being able to find the C++ option", but nothing is created in D2006.

torworx

2006-09-28 20:19

reporter   ~0010214

Maybe, I didn't make a complete test. I just use Delphi2006, so I only test it in Delphi2006.

obones

2006-09-29 01:40

administrator   ~0010216

Ah but I tested in BDS 2006 as well, but with all personalities loaded.

torworx

2006-09-29 01:47

reporter   ~0010217

Last edited: 2006-09-29 01:48

Did you make sure that you recompled JvPluginD10D.dpk after apply the JvPluginWizard.patch ?

obones

2006-09-29 01:58

administrator   ~0010218

Yes absolutely. Before the rebuild, I had an error saying this (approximately):

Cannot find options for CplusplusBuilder.Personality

Now that I have rebuilt, I do not get any error, but the project manager is empty, no new project is created.

torworx

2006-09-29 02:23

reporter   ~0010220

Well. Can you send me the JvPluginWizard.pas after aplly the patch file, or force use JvPluginWizard.pas I uploaded at 09-23-06 to replace yours to make a test. I'll waiting for the result online.

Email: taoy.cn@gmail.com
MSN: yuantcn@hotmail.com

obones

2008-01-06 06:00

administrator   ~0014118

This is now fixed in SVN

Issue History

Date Modified Username Field Change
2006-09-14 00:14 torworx New Issue
2006-09-14 02:06 Werewolf Note Added: 0010122
2006-09-14 14:28 obones Status new => confirmed
2006-09-22 07:52 torworx Note Added: 0010151
2006-09-22 08:42 obones Note Added: 0010152
2006-09-22 08:52 torworx Note Added: 0010153
2006-09-23 06:55 torworx File Added: JvPluginWizard.pas
2006-09-23 06:58 torworx Note Added: 0010156
2006-09-23 09:05 obones Note Added: 0010157
2006-09-23 20:50 torworx File Added: JvPluginWizard.patch
2006-09-23 20:53 torworx Note Added: 0010159
2006-09-28 06:31 obones Note Added: 0010200
2006-09-28 20:19 torworx Note Added: 0010214
2006-09-29 01:40 obones Note Added: 0010216
2006-09-29 01:47 torworx Note Added: 0010217
2006-09-29 01:48 torworx Note Edited: 0010217
2006-09-29 01:58 obones Note Added: 0010218
2006-09-29 02:23 torworx Note Added: 0010220
2007-09-27 03:00 obones Relationship added has duplicate 0004245
2008-01-06 06:00 obones Status confirmed => resolved
2008-01-06 06:00 obones Fixed in Version => Daily / SVN
2008-01-06 06:00 obones Resolution open => fixed
2008-01-06 06:00 obones Assigned To => obones
2008-01-06 06:00 obones Note Added: 0014118