Can't perform Unicode Operation - Error

General TRichView support forum. Please post your questions here
Post Reply
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Can't perform Unicode Operation - Error

Post by jnap »

Hi

I am intermittently getting this Error Message in Delphi 2010 - "Can't perform Unicode Operation"

I have just switched from Delphi 2007 to Delphi 2010 and since before the switch never had this Error Message before: "Can't perform Unicode Operation"

Is there anything I can do to prevent this Error from happening? Please could you give me some advice as to what I can do?

All the best

jnap ( Chris ).
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This error usually occurs when you try to call Unicode method for non-Unicode text item or non-Unicode string.
This is may be a result of conversion of your application to D2010: in D2010, all text items are Unicode by default.

Can you post which code raises this error?
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post by jnap »

Hi

Thank you for your very fast response :)

The Error is just on a Paste from an rvActionPaste which is assigned to a TPopupMenu.

Thank you for your time

Chris
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post by jnap »

Hi

Sorry for the confusion but I have now found the line causing the problem.

It is:

Code: Select all

//------------------------------------------------------------------------------
//  rve OnPaste...
//------------------------------------------------------------------------------
procedure TSEMArcFrm.rvePaste(Sender: TCustomRichViewEdit;
  var DoDefault: Boolean);
begin
  DoDefault := not PasteTextWithURLs(Sender, URLScanEvent);
end;
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As I understand, you use the function PasteTextWithURLs from URLScan.pas from Assorted\Hypertext\URLs demo.
Just update this unit from DelphiUnicode\Assorted\Hypertext\URLs\
Post Reply