InplaceMemo causes access violation in Delphi 2010

Hi there,

the following problem occured with D2010 (the same code in D2007 is still in use an working well):

in a component I use a TForm with a TMemo as an inplace editor. Everytime I try access propertys of the Memo I'll get an access violation
Here's the code

FMemoPopup:= TFInplaceMemo.Create(self);
FMemoPopup.Parent:=nil;
FMemoPopup.Visible:= false;
//FMemoPopup.Memo1.Align:= alClient;
//FMemoPopup.Memo1.OnKeyUp:= Memo_KeyUp;
//FMemoPopup.Memo1.OnDblClick:= Memo_DblClick;

Every of the 3 lines that are now commented cause the violation when uncommented.

The TFInplaceMemo is only a form with a Memo placed on it.

what ist the problem?

thanks for answers
matthias
0
matthias
5/14/2010 6:36:31 PM
public.delphi.vcl.writing 510 articles. 0 followers. Follow

6 Replies
778 Views

Similar Articles

[PageSpeed] 3

matthias philipps wrote:

> Hi there,
> 
> the following problem occured with D2010 (the same code in D2007 is
> still in use an working well):
> 
> in a component I use a TForm with a TMemo as an inplace editor.
> Everytime I try access propertys of the Memo I'll get an access
> violation Here's the code
> 
> FMemoPopup:= TFInplaceMemo.Create(self);
> FMemoPopup.Parent:=nil;
> FMemoPopup.Visible:= false;
> //FMemoPopup.Memo1.Align:= alClient;
> //FMemoPopup.Memo1.OnKeyUp:= Memo_KeyUp;
> //FMemoPopup.Memo1.OnDblClick:= Memo_DblClick;
> 
> The TFInplaceMemo is only a form with a Memo placed on it.

> Every of the 3 lines that are now commented cause the violation when
> uncommented.

That would suggest that Memo1 is not created at all.

What happens if you create a little test app (form with button) and in
the ButtonClick use the above code?

-- 
Pieter

"Most of you are familiar with the virtues of a programmer.
 There are three, of course: laziness, impatience, and hubris."
 -- Larry Wall
0
Pieter
5/14/2010 8:31:58 PM
Thanks

> {quote:title=Pieter Zijlstra wrote:}{quote}
> 
> That would suggest that Memo1 is not created at all.
> 
> What happens if you create a little test app (form with button) and in
> the ButtonClick use the above code?
> 
> -- 
> Pieter

When I execute the code in a litte test app, everything's fine. No access violation at runtime.
I forgot to say, that the access violations happens at design-time, when I drop the component on a form of my application. 


matthias
0
matthias
5/15/2010 9:45:44 AM
Hi Matthias

On the: 15. of maj-2010 At: 11:45 matthias philipps wrote:

> I forgot to say, that the access violations happens atdesign-time, when I drop the component on a form of myapplication.

That sounds like You are creating the form in the component
constructor ?

If so I think it would be better design to create it when
You actually need it and then free it right after You are
done with it.
That way Your component dont waist unnecessary resources.


Best regards
Asger-P
0
Asger
5/15/2010 12:32:52 PM
> {quote:title=Asger Joergensen wrote:}{quote}
> If so I think it would be better design to create it when
> You actually need it and then free it right after You are
> done with it.
> That way Your component dont waist unnecessary resources.
> 
That's right, the Form with the Memo on it, is created with the component - and it would be better to create it at runtime,
- but the component is one that sources I bought some years ago, so I'm not quite sure about every line of code and want to change as less as possible. 

thanks
matthias
0
matthias
5/15/2010 1:40:14 PM
Hi matthias philipps

On the: 15. of maj-2010 At: 15:40 matthias philipps wrote:

> That's right, the Form with the Memo on it, is created withthe component - and it would be better to create it atruntime,
> - but the component is one that sources I bought some yearsago, so I'm not quite sure about every line of code andwant to change as less as possible.

Maybe You can just put it in an if statement:

C++ code coming up:

if( ! ComponentState.Contains(csDesigning) )
{
    //create the form
}

in plain english if You are not in the IDE create the form.

I dont think You need it in the IDE anyway.


Best regards
Asger-P
0
Asger
5/15/2010 3:20:32 PM
Thanks Asger,
that could be the way.

> {quote:title=Asger Joergensen wrote:}{quote}
> if( ! ComponentState.Contains(csDesigning) )
> {
>     //create the form
> }
> 
> in plain english if You are not in the IDE create the form.
> 
> I dont think You need it in the IDE anyway.
>

At design-Time it's working fine. There's no way to check it at runtime very fast. I've got to compile a real big application, or write a lot of code (it's XML and XSD coming from a database) to test. Porting my application from D2007 to D2010 is a little more work than i expected - a lot of components failed to compile due to ansistring / string incompatibility and other things.

But anyway: it would be nice to understand why that piece of code worked with D2007 well, and failed with D2010.
0
matthias
5/15/2010 9:44:35 PM
Reply:

Similar Artilces:

Inplace Edit causes access violation in Delphi 2010
Hi there, the following problem occured with D2010 (the same code in D2007 is still in use an working well): in a component I use a TForm with a TMemo as an inplace editor. Everytime I try access propertys of the Memo I'll get an access violation Here's the code FMemoPopup:= TFInplaceMemo.Create(self); FMemoPopup.Parent:=nil; FMemoPopup.Visible:= false; //FMemoPopup.Memo1.Align:= alClient; //FMemoPopup.Memo1.OnKeyUp:= Memo_KeyUp; //FMemoPopup.Memo1.OnDblClick:= Memo_DblClick; Every of the 3 lines that are now commented cause the violation when uncommented....

Delphi 2010 Access Violation
I have an application developed with delphi 2010 professional. Are there any tools in the IDE that will help me find an access violation that shows up, when the application closes? I have steppd through the code,but can' t locate anything. I am not for sure but I think a form may not be destroyed. TIA Jan B wrote: > I have an application developed with delphi 2010 professional. Are > there any tools in the IDE that will help me find an access violation > that shows up, when the application closes? I have steppd through > the code,but can' t locate anything. ...

Delphi 2010 TWebBrowser Access Violation on Close
I am using a TWebBrowser component to open up a website inside a Delphi 2010 application. I am using Windows 7 32 bit. There are several different sites opened in a form, with the TWebBrowser component. It depends on the customer choosen which site gets opened. I have one site that after it is opened and closed, then the Delphi application is closed, an Access Violation message box appears. This only shows up when it is ran from the development environment. It is only for the one website. The other sites do not give any problems. I suspect that some java script is being loaded and tha...

from delphi 6 to delphi 2010
Hi. It is possible, with component RX, dxforumlibrary, InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. Thank by comments. excequiel arostica wrote: >Hi. > It is possible, with component RX, dxforumlibrary, >InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. > >Thank by comments. Rx is dead and sources are taken over by jcl/jvcl. I dont know about the rest of the components and i have no experiences with bde over the last 9 years. excequiel arostica wrote: > Hi. > It is possible, with component RX, dxforumlibrary,...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Use of TBCDField in Aggregate causes access violation in Delphi XE7
I have just converted my application from Delphi 7 to Delphi XE7. To get the application to compile clean was surprisingly easy. However, I am now getting access violations in a number of areas. I have narrowed down the problem to the use of a TBCDField in a aggregate of a ClientDataset. The back end of my application is SQL Server 2008 R2. There are a number of fields in the database with a datatype of 'money'. When you bring in a SQL Server DataType of Money into a dataset (query or clientdataset) Delphi assigns the field a datatype of TBCDField. When I use a field with a ...

Use of TBCDField in Aggregate causes access violation in Delphi XE7
I have just converted my application from Delphi 7 to Delphi XE7. To get the application to compile clean was surprisingly easy. However, I am now getting access violations in a number of areas. I have narrowed down the problem to the use of a TBCDField in a aggregate of a ClientDataset. The back end of my application is SQL Server 2008 R2. There are a number of fields in the database with a datatype of 'money'. When you bring in a SQL Server DataType of Money into a dataset (query or clientdataset) Delphi assigns the field a datatype of TBCDField. When I use a field with a ...

Price of upgrade from Delphi 2010 Professional to Delphi 2010 Enterprise?
It's weird, but I could not find the answer on so simple question not in Embarcadero Shop, neither by the forum search. For example, the shop info about Enterprise upgrade says: The Upgrade product is available to registered owners of 2006-2009 versions, blah-blah... So, if I'm Delphi 2010 Professional user, I even not eligible for upgrade? I have to buy a new version of Enterprise??? But if I'm Delphi 2006 Professional user, I can upgrade. Please clarify this nonsense for me. Exact question is in the subject. Thanks! Hi Dmitri, > It's weird, but I could not...

Nice, Delphi XE includes free access to earlier version licenses and downloads for Delphi 2010, 2009, 2007 and 7.
Looking at the details for Delphi XE Professional while checking the prices etc and found the above as part of a paragraph. "Delphi XE includes free access to earlier version licenses and downloads for Delphi 2010, 2009, 2007 and 7. Details will be included with your order confirmation email and in the product readme." Very nice bonus! Brian > {quote:title=Brian Evans wrote:}{quote} > Looking at the details for Delphi XE Professional while checking the > prices etc and found the above as part of a paragraph. > > "Delphi XE includes free acce...

Access violation rtl140.bpl Error, Delphi 2010 IDE wont load
I get this error message below when I try to start Delphi 2010. While it's loading up this message pops up and the only thing that loads is the Tool Palette and Structure windows. How can fix this? I've tried repairing and reinstalling but the problem persists. Access violation at address 500115A7 in module 'rtl140.bpl'. Read of address 00000000. [500115A7]{rtl140.bpl } System.UTF8ToUnicodeString (Line 22482, "System.pas" + 2) + $0 [5029A838]{vcl140.bpl } Controls.TWinControl.DefaultHandler (Line 9860, "Controls.pas" + 30) + $17 [502C18E6]{vcl140.b...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Delphi 2010 w Delphi 2007
I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). Can I install D2010 on this machine without it affecting D2007? Will D2010 affect D2007 in any way? Thanks, Randall Carpenter > {quote:title=Randall Carpenter wrote:}{quote} > I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). > Can I install D2010 on this machine without it affecting D2007? Will D2010 > affect D2007 in any way? Won't hurt a thing. I have D7, RAD Studio 2007, RAD Studio 2009, and RAD Studio 2010 all on my desktop system and they coexist fine. Jus...

Migrate from Delphi 2007 to Delphi 2010
Hi All, Thanks in advance for your help. Below is my query, Currently I am using Delphi 2007 and i want to migrate to Delphi 2010. 1. What all things i need to take care while doing this? 2. What all third party components will get impacted? 3. Any known issues in Delphi 2010 which might impact the cause? 4. Any changes in database operation required as i am using Oracle? Hope I have post this query under correct category. If not sorry for the trouble and could you please suggest me the correct category for this? Looking forward for your response. Have a great day. Th...

Web resources about - InplaceMemo causes access violation in Delphi 2010 - public.delphi.vcl.writing

Resources last updated: 11/27/2015 10:01:30 PM