Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Tips of MTM development

From Wiki
Jump to: navigation, search
Article Metadata

beover1984 在 29 Jul 2007 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

1. MTM的4个模块中的导出函数存在多个时,需要手动把def文件中的序号调整一下,使构造各模块的函数的序号为1,否则在MTM架构加载时系统报错,下面是对应函数在各自def文件中的形式: UI MTM:

?NewMtmUiL@@YAPAVCBaseMtmUi@@AAVCBaseMtm@@AAVCRegisteredMtmDll@@@Z @ 1 NONAME ; class CBaseMtmUi * __cdecl NewMtmUiL(class CBaseMtm &,class CRegisteredMtmDll &)

UI Data MTM:

?NewMtmUiDataLayerL@@YAPAVCBaseMtmUiData@@AAVCRegisteredMtmDll@@@Z @ 1 NONAME ; class CBaseMtmUiData * __cdecl NewMtmUiDataLayerL(class CRegisteredMtmDll &)

Client MTM:

?NewL@CMtmcl@@SAPAV1@AAVCRegisteredMtmDll@@AAVCMsvSession@@@Z @ 1 NONAME ; public: static class Cppcl * __cdecl CMtmcl::NewL(class CRegisteredMtmDll &,class CMsvSession &)

Server MTM:

?NewL@CMtmse@@SAPAV1@AAVCRegisteredMtmDll@@PAVCMsvServerEntry@@@Z @ 1 NONAME ; public: static class Cppse * __cdecl CMtmse::NewL(class CRegisteredMtmDll &,class CMsvServerEntry *)

原因: 因为MTM的4个模块都是以多态(polymorphic)DLL的形式提供的,并且MTM架构加载DLL后调用序号的为1的函数创建对象,如果调用了其它函数就会出错,使得消息应用无法使用, def文件中这个序号是执行abld freeze按某种顺序产生的,并不保证创建对象的函数为第一个,所以我们只能手工改正.

2. UI Data MTM类的函数QueryCapability会用到没有提供的UID值. QueryCapability(TUid aCapability, TInt& aResponse ) MTM架构在加载MTM后会多次调用QueryCapability()这个函数并传给不同UID值,函数根据这个UID值来告诉MTM架构支持哪些操作,这些UID值在MTMDEF.HRH文件中提供,在开发中我发现有两个值文件中并没有提供: 0x10008b24和0x100038ec,通过响应0x10008b24这个值,MTM架构会在”Write message”和”Settings”下添加和这个MTM关联的菜单用来创建message和service setting;响应0x100038ec这个值可以为MTM增加一个名为”Connect”的菜单(不过我还没有找到响应”Connect”菜单的方法).

This page was last modified on 15 December 2011, at 10:11.
202 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.