Jump to content

New Component, Access Violation in Design Mode


tappatappa

Recommended Posts

I don't know if this is a bug, so i am posting in the General Forum.

 

I created a sub component of TUniEdit using the New Component Wizard. Since I work in c++, i followed the wizard for c++.

 

Here is the CPP

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

#include "UniEditTTC.h"
#pragma link "uniEdit"
#pragma link "uniGUIBaseClasses"
#pragma link "uniGUIClasses"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//

static inline void ValidCtrCheck(TUniEditTTC *)
{
	new TUniEditTTC(NULL);
}
//---------------------------------------------------------------------------
__fastcall TUniEditTTC::TUniEditTTC(TComponent* Owner)
	: TUniEdit(Owner)
{
}
//---------------------------------------------------------------------------
namespace Unieditttc
{
	void __fastcall PACKAGE Register()
	{
		TComponentClass classes[1] = {__classid(TUniEditTTC)};
		RegisterComponents(L"uniGUI Additional", classes, 0);
	}
}
//---------------------------------------------------------------------------

And the header

//---------------------------------------------------------------------------

#ifndef UniEditTTCH
#define UniEditTTCH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include "uniEdit.hpp"
#include "uniGUIBaseClasses.hpp"
#include "uniGUIClasses.hpp"
#include <Vcl.Controls.hpp>
//---------------------------------------------------------------------------
class PACKAGE TUniEditTTC : public TUniEdit
{
private:
protected:
public:
	__fastcall TUniEditTTC(TComponent* Owner);
__published:
};
//---------------------------------------------------------------------------
#endif

No additional feature are added, this is only for testing purposes.

 

I installed the component, and all went fine.

 

When I add the UniEditTTC to a Form in Design Mode I got

---------------------------
Error
---------------------------
Access violation at address 5008C59A in module 'rtl160.bpl'. Read of address 00000000.
---------------------------
OK   Details >>   
---------------------------

[5008C59A]{rtl160.bpl  } System.TypInfo.GetPropList (Line 1803, "System.TypInfo.pas" + 8) + $0
[00E0DFDE]{bds.exe     } bds.bds (Line 204, "" + 8) + $94E9EF
[20FD7E00]{designide160.bpl} ComponentDesigner.TCompInfo.Create (Line 6535, "ComponentDesigner.pas" + 4) + $11
[20FD4120]{designide160.bpl} ComponentDesigner.TComponentRoot.ValidateRename (Line 5242, "ComponentDesigner.pas" + 26) + $22
[500B4D25]{rtl160.bpl  } System.Classes.TComponent.ValidateRename (Line 12851, "System.Classes.pas" + 6) + $15
[51D404ED]{vcldesigner160.bpl} VCLSurface.TVclDesignSurface.ValidateRename (Line 3859, "VCLSurface.pas" + 2) + $D
[50449A08]{vcl160.bpl  } Vcl.Forms.TCustomForm.ValidateRename (Line 4114, "Vcl.Forms.pas" + 3) + $10
[500B4936]{rtl160.bpl  } System.Classes.TComponent.InsertComponent (Line 12657, "System.Classes.pas" + 4) + $C
[500B46FF]{rtl160.bpl  } System.Classes.TComponent.Create (Line 12551, "System.Classes.pas" + 2) + $8
[5032FCB3]{vcl160.bpl  } Vcl.Controls.TControl.Create (Line 5302, "Vcl.Controls.pas" + 1) + $4
[50334458]{vcl160.bpl  } Vcl.Controls.TWinControl.Create (Line 8247, "Vcl.Controls.pas" + 1) + $4
[182ADD2B]{uniGUI16.bpl} Uniguibaseclasses.TUniBaseControl + $9B
[182B1CE1]{uniGUI16.bpl} Uniguiclasses.TUniControl + $51
[182B9FB6]{uniGUI16.bpl} Uniguiclasses.TUniFormControl + $16
[182981F8]{uniGUI16.bpl} Uniedit.TUniBaseEdit + $1C
[1B012D9F]{TTCComponents.bpl} UniEditTTC.cpp.TUniCustomEdit.$bctr$qqrp25System.Classes.TComponent (Line 125, "C:\Projects\lib\FMSoft\Framework\uniGUI\Dcu\Delphi2012\uniEdit.hpp" + 0) + $33
[1B012CD7]{TTCComponents.bpl} UniEditTTC.cpp.TUniEdit.$bctr$qqrp25System.Classes.TComponent + $33
[5003C547]{rtl160.bpl  } System.TObject.NewInstance (Line 13000, "System.pas" + 1) + $10
[1B012C7F]{TTCComponents.bpl} UniEditTTC.cpp.$bctr$qqrp25System.Classes.TComponent (Line 23, "UniEditTTC.cpp" + 1) + $E
[5004311C]{rtl160.bpl  } System.@IntfClear (Line 29967, "System.pas" + 10) + $0
[21B8E53F]{delphicoreide160.bpl} CompPalMgr.TComponentPalettePageItemDelegate.CreateComponent (Line 2744, "CompPalMgr.pas" + 2) + $7
[20FCC868]{designide160.bpl} ComponentDesigner.TComponentRoot.DoCreateComponent (Line 2363, "ComponentDesigner.pas" + 12) + $17
[20FD5E3E]{designide160.bpl} ComponentDesigner.TComponentRoot.CreateComponentPos (Line 5929, "ComponentDesigner.pas" + 26) + $22
[51D432EE]{vcldesigner160.bpl} VCLSurface.TVCLDesignerOleDropTarget.DropComponentStream (Line 5034, "VCLSurface.pas" + 17) + $25
[51D42A49]{vcldesigner160.bpl} VCLSurface.TVCLDesignerOleDropTarget.Drop (Line 4857, "VCLSurface.pas" + 7) + $17
[20812C85]{coreide160.bpl} ToolFrm.TToolForm.BeginOleDrag (Line 2136, "ToolFrm.pas" + 46) + $17
[2081295A]{coreide160.bpl} ToolFrm.TToolForm.BeginOleDrag (Line 2068, "ToolFrm.pas" + 3) + $4
[20812E48]{coreide160.bpl} ToolFrm.TToolForm.PaletteBeginDrag (Line 2167, "ToolFrm.pas" + 2) + $1B
[211676F6]{vclide160.bpl} IDECategoryButtons.TIDECategoryButtons.DoBeginDrag (Line 103, "IDECategoryButtons.pas" + 3) + $A
[504B2112]{vcl160.bpl  } Vcl.CategoryButtons.TCategoryButtons.MouseMove (Line 2096, "Vcl.CategoryButtons.pas" + 24) + $9
[5003C9B2]{rtl160.bpl  } System.@CallDynaInst (Line 13519, "System.pas" + 4) + $0
[503332AA]{vcl160.bpl  } Vcl.Controls.TControl.WMMouseMove (Line 7436, "Vcl.Controls.pas" + 8) + $22
[5003CA63]{rtl160.bpl  } System.TObject.Dispatch (Line 13727, "System.pas" + 11) + $0
[50332995]{vcl160.bpl  } Vcl.Controls.TControl.WndProc (Line 7204, "Vcl.Controls.pas" + 91) + $6
[50336B3B]{vcl160.bpl  } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9745, "Vcl.Controls.pas" + 1) + $9
[5032D7BE]{vcl160.bpl  } Vcl.Controls.FindControl (Line 3540, "Vcl.Controls.pas" + 6) + $9
[503372F3]{vcl160.bpl  } Vcl.Controls.TWinControl.WndProc (Line 9976, "Vcl.Controls.pas" + 152) + $6
[504B3B7F]{vcl160.bpl  } Vcl.CategoryButtons.TCategoryButtons.WndProc (Line 3047, "Vcl.CategoryButtons.pas" + 24) + $4
[50336948]{vcl160.bpl  } Vcl.Controls.TWinControl.MainWndProc (Line 9689, "Vcl.Controls.pas" + 3) + $6
[500B6890]{rtl160.bpl  } System.Classes.StdWndProc (Line 13878, "System.Classes.pas" + 8) + $0
[20810948]{coreide160.bpl} ToolFrm.TToolForm.PaletteHook (Line 1102, "ToolFrm.pas" + 14) + $A
[500B6890]{rtl160.bpl  } System.Classes.StdWndProc (Line 13878, "System.Classes.pas" + 8) + $0
[50453213]{vcl160.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 10164, "Vcl.Forms.pas" + 23) + $1
[50453256]{vcl160.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 10194, "Vcl.Forms.pas" + 1) + $4
[50453595]{vcl160.bpl  } Vcl.Forms.TApplication.Run (Line 10332, "Vcl.Forms.pas" + 26) + $3

While if I add the component programmatically it works! For what i can see, the problem is in the RTTI. Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...