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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Strange setfocus-problem in ievect

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
harry stahl Posted - Jul 31 2016 : 13:49:59
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
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 09 2016 : 17:36:37
Thanks Harry,

We will investigate this.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
harry stahl Posted - Aug 09 2016 : 13:09:49
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