Hello,

I'm having problems adding commands to PopupMenu of ImageViewer component. The code I use is:

1- imgViewer.PopupMenu.StandardMenuEnabled = false;
2- imgViewer.PopupMenu.CustomMenuEnabled = true;
3- imgViewer.PopupMenu.InsertAt(MenuItemEnum.MI_Read, 0);
4- imgViewer.PopupMenu.InsertAt(MenuItemEnum.MI_ReadBlock, 1);
5- imgViewer.PopupMenu.InsertAt(MenuItemEnum.MI_BlockDelete, 2);
6- imgViewer.PopupMenu.InsertAt(MenuItemEnum.MI_LayoutClear, 3);
7- //Exception is thrown at the next line (8):
8- imgViewer.Commands.RegisterUserCommand(MenuItemEnum.MI_CustomCommand1, "Publicidad", @"D:\cloud.png", hotKey);
9- imgViewer.PopupMenu.InsertAt(MenuItemEnum.MI_CustomCommand1, 4);

I'm using Windows 10 and Visual Studio was executed with admin rights. Exception thown:

Excepción producida: "System.ArgumentException" en ESApp.exe
   en MainApp.forms.ProcesadorOCR.FrmProcesadorOcr.ArreglarMenuContextual() en D:\PROJECT\forms\ProcesadorOCR\frmProcesadorOCR.cs:línea 627
   en MainApp.forms.ProcesadorOCR.FrmProcesadorOcr.frmProcesadorOCR_Load(Object sender, EventArgs e) en D:\PROJECT\forms\ProcesadorOCR\frmProcesadorOCR.cs:línea 114
   en System.Windows.Forms.Form.OnLoad(EventArgs e)
   en System.Windows.Forms.Form.OnCreateControl()
   en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   en System.Windows.Forms.Control.CreateControl()
   en System.Windows.Forms.Control.WmShowWindow(Message& m)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.Form.WmShowWindow(Message& m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
System.ArgumentException: Arguments check failed. Expected: 
   en FineReaderVisualComponents.CommandsClass.RegisterUserCommand(MenuItemEnum CommandId, String CommandText, String IconPath, Int32 HotKey)
   en MainApp.forms.ProcesadorOCR.FrmProcesadorOcr.ArreglarMenuContextual() en D:\PROJECT\forms\ProcesadorOCR\frmProcesadorOCR.cs:línea 627
   en MainApp.forms.ProcesadorOCR.FrmProcesadorOcr.frmProcesadorOCR_Load(Object sender, EventArgs e) en D:\PROJECT\forms\ProcesadorOCR\frmProcesadorOCR.cs:línea 114
   en System.Windows.Forms.Form.OnLoad(EventArgs e)
   en System.Windows.Forms.Form.OnCreateControl()
   en System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   en System.Windows.Forms.Control.CreateControl()
   en System.Windows.Forms.Control.WmShowWindow(Message& m)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.Form.WmShowWindow(Message& m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
El programa '[19052] ESApp.vshost.exe' terminó con código -1073741819 (0xc0000005) 'Access violation'.

asked 12 Nov '15, 22:23

Andres%20Mu%C3%B1oz's gravatar image

Andres Muñoz
215

edited 12 Nov '15, 22:24

Hi Andres,

Sorry for not coming back to you for so long.

I've just tried to add your code snippet to our standard VisualComponents sample and this part of the program is working well. So, could you kindly send a simple project reproducing the issue to SDK_Support@abbyy.com?

(16 Nov '15, 20:37) Oksana Serdyuk ♦♦

Ok, I will :D

(16 Nov '15, 22:20) Andres Muñoz

After receive support from ABBYY, this is the response I got:

"However your files (D:\cloud.png) are real png files therefore the program can`t process them due to the requirements of the ABBYY FineReader Engine. Please try to use BMP pictures of 16х16 size for the icons."

So the problem was due to using png files instead of bmp files

link

answered 11 Dec '15, 17:19

Andres%20Mu%C3%B1oz's gravatar image

Andres Muñoz
215

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×1
×1
×1

Asked: 12 Nov '15, 22:23

Seen: 1,039 times

Last updated: 11 Dec '15, 17:37

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal