运行时,提示类似这样的错误:Jar file could not be initialized
And, an exception: java.util.zip.ZipException: invalid entry compressed size (expected 552 but got 555 bytes)…

解决办法(来自forum nokia):

Go to the properties page of your project, “J2ME”, “Manage Devices”, edit all or your favourite “Emulator” entries and remove the ‘[%classpath%|-classpath “%classpath%”]’ entry from the Launch Command Table.

[ZT]S60 3rd FP1 SDK编译的SDK自带的例子在N73上无法正确显示程序图标


找到S60 3rd MR SDK中的mifconv.exe, 用其替换3rd FP1以及之后的SDK的mifconv.exe应该可以解决图
3rd FP1以及之后的SDK的mifconv.exe生成的mif文件尺寸明显小于早期版本生成的mif文件,也许Nokia修改了mif的压缩算法导致图标不能兼容。

Issue with SVG icon display on 3rd edition
From Forum Nokia Wiki

SVG(scalable vector graphics) icons sometimes do not show up on S60
3rd edition devices when built with S60 3rd edition SDK.

This problem is because of the fact that mifconv.exe compresses the
icons which the devices are unable to read.

To fix this issue,disable the SVG compression option by specifying
‘/X’ option in mifconv.exe.
Retrieved from “http://wiki.forum.nokia.com/index.php/Issue_with_SVG_icon_display_on_3rd_edition”


一种流行的技巧是用一个单独的用括弧括起来的的 “参数” 定义和调用宏, 参数在宏扩展的时候成为类似 printf() 那样的函数的整个参数列表。

#define DEBUG(args) (printf("DEBUG: "), printf args)
if(n != 0) DEBUG(("n is %d\n", n));


gcc 有一个扩展可以让函数式的宏接受可变个数的参数。 但这不是标准。另一种可能的解决方案是根据参数个数使用多个宏 (DEBUG1, DEBUG2, 等等), 或者用逗号玩个这样的花招:

#define DEBUG(args) (printf("DEBUG: "), printf(args))
#define _ ,
DEBUG("i = %d" _ i);

C99 引入了对参数个数可变的函数式宏的正式支持。在宏 “原型” 的末尾加上符号 … (就像在参数可变的函数定义中), 宏定义中的伪宏 __VA_ARGS__ 就会在调用是替换成可变参数。

最后, 你总是可以使用真实的函数, 接受明确定义的可变参数。参见问题 15.415.5。如果你需要替换宏, 使用一个函数和一个非函数式宏, 如 #define printf myprintf。

参考资料: [C9X, Sec. 6.8.3, Sec.]。

RGA app in symbian tasks list

As far as I checked RGA example applications don’t appear in Symbian tasks list.
Am I missing something or it’s not supported?
Does anyone know how to fix it?

Well, N-Gage applications don’t show in the task list. Generally I think only S60 GUI applications show up there.

To hide an app:
CApaWindowGroupName has a SetHidden() method which you call with ETrue.

To make one visible you could try SetHidden(EFalse)…

I am wondering if the system considers an RGA application as a non-gui app, or whether they’re just deliberately hidden for N-Gage.


windows shell extension的注册表问题

CodeProject上有个非常好的讲shell扩展的系列文章:The Complete Idiot’s Guide to Writing Shell Extensions,作者在文章中提到了一下关于如何处理注册表的问题,主要是在哪添加context menu handler的问题。
We can’t reliably use an RGS script since “txtfile” may not be the correct key name.
Some other text editor may be installed that associates itself with .TXT files. If it changes the default value of the HKEY_CLASSES_ROOT\.txt key, all existing shell extensions will stop working.
实际应用时我发现,如果ext针对的是一些比较常用的格式,如PNG,那么出现上述作者预料到的问题的可能性极高,原始情况下的PNG是这样:.png->pngfile,安装PhotoShop或ACDSee等软件并关联png后,就会改变.png想对应的名字项.png->ACDSee.png .png->PhotoShop.PNG.8,类似这样的东西,所以在实际应用中依赖.rgs注册表脚本文件是一种很不可取的方式,正确的做法应该是在dll注册服务器的时候,手动处理添加关联,当然,一些com的其它注册问题写在.rgs里还是没问题的,最后也别忘了在反注册的时候,手动删除自己添加的关联。(有ATL的话直接用CRegKey非常简单)