作者leicheong (睡魔)
看板Programming
标题Re: [问题] 在vc2005下开发windows mobile应用程式 …
时间Thu Mar 8 09:55:03 2007
※ 引述《cptl (CPTL)》之铭言:
: 小弟目前在 vc2005 下开发windows mobile 5.0 应用程式
: 我在专案里写了一个继承CWnd 的类别物件(先简称此物件叫 wnd ),
: 并在 View 视窗里呼叫 wnd->CreateControl(...)
: 并且把程式丢到emulator上是能正常运作的
: 但当我把这个类别作成dll档, 和应用程式的执行档一起丢到emulator上时
: 我先在呼叫dll档的一个showMessage函数, 确定dll是能正确运作的!!
: 但只要呼叫到 dll类别里 wnd->CreateControl() 这个函数时
: 就会在emulator上跳出一个错误视窗, 上面写着:Debug Assertion Failed
: 并且有 Abort, Retry, Ignore 三种回应此错误方式
: 让我困惑的是!! 明明把这个class加在应用程式中是完全没问题的!
: 但把它抽离出来以dll方式使用时, 只要emulator一呼叫到继承 CWnd 的CreateContrl函
: 数,
: 马上就出现错误讯息!!
: 想请问这是怎麽回事呢?
: 既然在应用程式中emulator能正确执行, 因此我想class的写法应该没问题~
: 会不会因为制作emulator用的dll, 所以某些额外环境要另外设定呀!?
: (我在选作dll专案时, 己经有选择 MFC smart Device 的dll专案)
: 己经被这个问题卡住好几天了,希望前辈们能稍微帮忙指点~
: 感激不尽!!!
btw...
CreateControl does not create a control handle if the control's "Visible"
property is false. You can either call the CreateHandle method or access the
Handle property to create the control's handle regardless of the control's
visibility, but in this case, no window handles are created for the control's
children.
你有确定当呼叫CreateControl()时Visible属性是true吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 202.134.126.84