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
 Trying to Insert a bitmap into an IERichEdit gives access violation in 64 bit

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
john_siggy@yahoo.com Posted - Apr 12 2025 : 09:09:03
Hey Nigel,

Hope you are doing well. Inserting a bitmap into IEVRichEdit, using the toolbar or "InsertLink('aaa', 'bbb'), gives
"Access violation at address xxx in module 'MSFTEDIT.DLL' Read of address FFFFFFFFFFF". Does not work in 64 bit but works fine in 32 bit. The Richedit control is version 3. Using Imageen 13.2.0 on Windows 11.

Thanks in advance...
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 20 2025 : 20:06:31
Hi John

I checked this and it appears to be working correctly. InsertImage creates an OLE object for each image, which require a handle. They are not leaked because if you clear the RichEdit content (including the undo stack) the handle count reverts to normal.

Pasting from clipboard does not insert an OLE object, but uses an embedded RTF picture instead, so does not require a handle.

Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Apr 20 2025 : 10:50:11
Interestingly image insertion works without using excess handles:

Clipboard.Assign(SaveCameraIcon.Picture);
Editor.PasteFromClipboard;

Maybe it is not a bug in the RichEdit dll.



john_siggy@yahoo.com Posted - Apr 20 2025 : 10:25:32
using your RichEdit demo under Demos/Other add a little TImage say a 16x16 bitmap. Add a button that when pressed calls a loop that only stops when terminated:

while not Application.Terminated do
    begin
      Editor.InsertLink(' aaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbb');
      Editor.InsertImage(SaveCameraIcon.Picture.Bitmap, False);
      Editor.Font.Color := clRed;
      Editor.AddLine('RichEdit is very Fast');
      application.ProcessMessages;
      inc(i);
      Label1.Caption := inttostr(i);
    end;


When you press the button, you will see lines being written to the IERichEdit and the number of Window's Handles steadily rise. Adding hyperlink and text do not incur Windows Handles.
xequte Posted - Apr 20 2025 : 02:23:03
Hi John

If the leak is occuring in RichEdit library itself (which it sounds like it is), then it is unlikely that we can resolve that. Can you give me the precise steps to reproduce it?

Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Apr 19 2025 : 18:02:03
My project inserts thousands of images into an IERichedit. All the RichEdit based editors I looked at leak one window's handle per inserted image. This amounts to thousands of handles and leads to a crash. I tried the 32 bit version of your IERichedit and it too leaks one handle per image in Imageen 13.2.0. Is there any way you could check this while beta testing? I use a process monitoring tool: pe.exe, a demo of MITEC software, to see the handles. I can send this utility at your request.

Thanks in advance
xequte Posted - Apr 14 2025 : 00:04:39
Hi John

This is fixed in the latest beta. Please email me for it.

Nigel
Xequte Software
www.imageen.com