ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Strange setfocus-problem in ievect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

harry stahl

Germany
62 Posts

Posted - Jul 31 2016 :  13:49:59  Show Profile  Reply
Hi,

when I use your "vectorial demo",

1. insert a Memo-Object,
2. Select object

and then (after ImageEnVect1.CopyObjectsToBack(True)) call from this form ImageEnvect1.RemoveAllOjbects, this calls then the procedure "Cancelinteracts", "RemoveTextEdit", and here at the Ende "Setfocus" is called.

In your demo the program jumps to "TImageEnVect.WMSetfocus" in unit ievect, and all is fine (no setfocus is performed) but in my program, it jumps to "Wincontrol.setfocus" (unit VCL.Controls), (a setfocus is tried) and raises then an access violation.

This is really strange and I have no idea why this different behavior occurs.

Have anyone an idea?

Edit: in the demo the ImageEnVect is in the main form. In my program it is in an extra form and the extra form will be inserted into the mainform (the parent of this form is a panel in the mainform).


HS

harry stahl

Germany
62 Posts

Posted - Aug 09 2016 :  13:09:49  Show Profile  Reply
OK, the reason for the AV was, that with the "SetFocus"-call in "TImageEnVect.RemoveTextEdit" (unit ievect) my global eventhandler "ImageEnview1.enter" was called and there were some actions done, before all the other work in "RemoveAllObjects" was done.

The exception occurs then in:

procedure TIETextControl.RemoveUnreferenced();
var
  ref: pintegerarray; //1=referenced 0=unref
  i, j: integer;
  ci: PIECharInfo;
begin
  getmem(ref, sizeof(integer) * fCharInfo.Count);
  i := 0;
  while i < fCharInfo.Count do
  ...
end;

here in the first line, because "fCharInfo" was NIL.

Even when I have changed my code, so it would perhaps good in future, to add one line of code in this proc above:

If fCharCount = NIL then Exit;

HS
Go to Top of Page

xequte

38610 Posts

Posted - Aug 09 2016 :  17:36:37  Show Profile  Reply
Thanks Harry,

We will investigate this.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: