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
 Trying to Insert a bitmap into an IERichEdit gives access violation in 64 bit
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

john_siggy@yahoo.com

USA
163 Posts

Posted - Apr 12 2025 :  09:09:03  Show Profile  Reply
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...

xequte

38948 Posts

Posted - Apr 14 2025 :  00:04:39  Show Profile  Reply
Hi John

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

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

john_siggy@yahoo.com

USA
163 Posts

Posted - Apr 19 2025 :  18:02:03  Show Profile  Reply
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
Go to Top of Page

xequte

38948 Posts

Posted - Apr 20 2025 :  02:23:03  Show Profile  Reply
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
Go to Top of Page

john_siggy@yahoo.com

USA
163 Posts

Posted - Apr 20 2025 :  10:25:32  Show Profile  Reply
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.
Go to Top of Page

john_siggy@yahoo.com

USA
163 Posts

Posted - Apr 20 2025 :  10:50:11  Show Profile  Reply
Interestingly image insertion works without using excess handles:

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

Maybe it is not a bug in the RichEdit dll.



Go to Top of Page

xequte

38948 Posts

Posted - Apr 20 2025 :  20:06:31  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: