View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005722 | JEDI VCL | 00 JVCL Components | public | 2011-11-27 10:03 | 2012-06-11 17:10 |
Reporter | dejoy | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | suspended | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0005722: Cannot dynamically create subclass of TJvPlugIn, and donate fixed code. | ||||
Description | When your dynamically creating a subclass of TJvPlugIn,you will receive an error message 'Resource not found: subclassname'. your cannot use TJvPlugIn.CreateNew instead of Create to create a TJvPlugIn without using the associated .DFM file to initialize it. I have add and rewritten procedure of TJvPlugIn.CreateNew process to fix the error. such as those code: type TNewPlugin = class(TJvPlugIn) end; var PluginName: TNewPlugin; begin PluginName := TNewPlugin.CreateNew(Self); //raise a error 'Resource not found' end; | ||||
Steps To Reproduce | New: //--------------------------- added TJvPlugIn = class(TDataModule) public constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override; end; constructor TJvPlugIn.CreateNew(AOwner: TComponent; Dummy: Integer); begin // Create datamodule inherited CreateNew(AOwner); DesignSize := Point(100, 100); // Create commands-collection FCommands := TJvPluginCommands.Create(Self); FInstanceCount := 1; end; //-------------------------------------------- //---------------- rewritten to fixed constructor TJvPlugIn.Create(AOwner: TComponent); begin // Create datamodule CreateNew(AOwner); if (ClassType <> TJvPlugIn) and not (csDesigning in ComponentState) then begin if not InitInheritedComponent(Self, TJvPlugIn) then raise EResNotFound.CreateResFmt(@RsEFmtResNotFound, [ClassName]); if OldCreateOrder then DoCreate; end; end; //-------------- in new this code run ok: PluginName := TPluginName.CreateNew(Self); //OK | ||||
Tags | No tags attached. | ||||
2011-11-27 10:03
|
TJvPlugIn.error.rar (4,060 bytes) |
|
New: //--------------------------- added TJvPlugIn = class(TDataModule) public constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override; end; constructor TJvPlugIn.CreateNew(AOwner: TComponent; Dummy: Integer); begin // Create datamodule inherited CreateNew(AOwner); DesignSize := Point(100, 100); // Create commands-collection FCommands := TJvPluginCommands.Create(Self); FInstanceCount := 1; end; //-------------------------------------------- //---------------- rewritten to fixed constructor TJvPlugIn.Create(AOwner: TComponent); begin // Create datamodule CreateNew(AOwner); if (ClassType <> TJvPlugIn) and not (csDesigning in ComponentState) then begin if not InitInheritedComponent(Self, TJvPlugIn) then raise EResNotFound.CreateResFmt(@RsEFmtResNotFound, [ClassName]); if OldCreateOrder then DoCreate; end; end; //-------------- in new this code run ok: PluginName := TPluginName.CreateNew(Self); //OK |
|
I tried your application, and clicking on the "CreateNew" button does not crash at all. I'm using the latest SVN content under D2007 |
|
No answers, suspending the issue |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-11-27 10:03 | dejoy | New Issue | |
2011-11-27 10:03 | dejoy | File Added: TJvPlugIn.error.rar | |
2011-11-27 10:04 | dejoy | Note Added: 0019140 | |
2012-02-22 14:52 | obones | Status | new => acknowledged |
2012-02-24 16:29 | obones | Note Added: 0019539 | |
2012-02-24 16:29 | obones | Status | acknowledged => feedback |
2012-06-11 17:10 | obones | Note Added: 0019825 | |
2012-06-11 17:10 | obones | Status | feedback => resolved |
2012-06-11 17:10 | obones | Resolution | open => suspended |
2012-06-11 17:10 | obones | Assigned To | => obones |