Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-05

Clipboard on WindowsCE

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Technical

Does anyone know how to activate the clipboard when programming for Windows CE? I can do it OK when programming for Win32 etc, but not for WinCE. The message when the program is run is "IndexOfCached FormatID Internal Error: Invalid FormatID 0 for clipboard". Sure enough, there are no valid formats on the clipboard (count = 0). I have tried adding formats (AddFormat) and new formats (RegisterClipboardFormat) but without success. The installed platform for Lazarus/Free Pascal is Windows XP (Home).

I have been trying for months, but with zero success. It only needs to work (currently) for text as I have no need for images there any missing ingredients?

I have more recently downloaded Lazarus 9.28.2 (previously it was 9.26.0) and FPC 2.2.4 (previously it was 2.2.2) and still get exactly the same problem, despite compiling it on a different computer (but still XP operating system).

When run with Win32 it works fine on the XP platform, but when recompiling for WinCE using virtually the same code (but modified for WinCE as done successfully for other programs not using the clipboard), it fails at runtime on the Windows Mobile 6.1 and 6.5 platforms with same message as reported originally. There are no compiler errors, so that side of it is presumably OK. It has to be to do with the implementation of the Clipboard components, doesn't it?

I have tried all the options I can think of, and those suggested by others, but can get no further forward. I have even tried running Lazarus under Linux, but this does not work either.

Can anyone give any more suggestions of how to overcome the problem? Any help would be gratefully received.

An example of its successful implementation on Windows CE would be a great help.

Regards

__________ Information from ESET Smart Security, version of virus signature database 5083 (20100503) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Technical

Thank you, Felipe, for your suggestion of using Lazarus version 0.9.29. However, the only way of making it work was to completely remove all trace of previous versions of Lazarus (0.9.26, 0.9.28.2). Now I can use the clipboard with WindowsCE on the smartphone. However, there is one major problem - I had installed several extra components on the previous versions which allowed grids to be aligned within each cell and for each column to be sorted (alphabetically or numerically). Those components cannot now be installed - the error message is "Can't find unit Controls used by AlSortGrid" from the AlSortGrid.pas file. If this unit reference is removed it then says "Can't find unit Forms used by AlSortGrid" and so on through the list in the uses section. These units can be found OK when using the StringGrid unit in the Additional component tab on the IDE, so I assume the problem is the search path used by the component. I cannot find a search path specific to the Packages Component units. I have tried rebuilding the entire installation, searching for config files. I am running XP so these appear within the Lazarus installation (unlike Vista where they appear within Documents and Settings, outside the Lazarus folders) so should be removed on complete removal of previous versions. I have checked where they are pointing to and appear OK.

Do you have any comments or suggestions please?

Regards

__________ Information from ESET Smart Security, version of virus signature database 5097 (20100509) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Felipe Monteiro de Carvalho
to Technical

Hello,

Ah, you cannot just install multiple Lazarus and run them like before. Now Lazarus uses a shared configuration directory to attend Windows design rules, so if you have multiple Lazarus you cannot run lazarus from it's executable, you need to create a shortcut with the following command line:

C:\Programas\svnlazarus\lazarus.exe --primary-config-path=lazarusconf

And create a similar shortcut for each Lazarus version that you have installed.

Read more here:

http://wiki.lazarus.freepascal.org/Multiple_Lazarus

Now going back to your current issue, Check your Environment Options, check the Paths to the FPC compiler, to Make, to LCL sources and to GDB. Check that they are all pointing to the correct locations.

"Cannot Find Unit X" doesn't mean only that it can't find the unit, when it is a unit of the LCL it means that the unit may also be compiled with a different FPC version, in which case it can be recompiled.

Are your components installed as design time packages? Are them from your own code or are they from lazarus/components ?

When do these components compilation fail? On rebuilding the IDE to use them or on building your WinCE project?

You will need to build your package twice, once for win32-x86 to install in the IDE and another for arm-wince to link to your program. In both cases you need the LCL built, and possibly too other parts of Lazarus which can be checked in Configure Build Lazarus menu item Advanced tab.

Felipe Monteiro de Carvalho