matlab警告名称不存在或不是目录; DoModal(); 静态文本框;编辑框;ID;职业与DOTA

在MATLAB编程过程中遇到'警告名称不存在或不是目录'的问题,结合DoModal()函数使用,讨论了静态文本框和编辑框的交互。同时,文章延伸到ID在编程中的重要性和现实生活中DOTA游戏的职业选择对个人发展的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

matlab警告: 名称不存在或不是目录
问题:安装了一些Matlab的工具箱后,会把这些文件夹的目录加到了路径里面。如果我们把这些文件夹删除了。以后在每次打开Matlab的时提示“警告: 名称不存在或不是目录”
解决方法:打开MATLAB/R2014a/toolbox/local/pathdef.m 把不存在的目录删除。(我的目录在D:\toolbox\local下)


DoModal();
返回值
如果成功则返回IDOK或IDCANCEL;否则返回0或-1。
IDOK和IDCANCEL都是常量,它们指示用户是选择了OK按钮还是Cancel按钮。
如果返回的是IDCANCEL,可以调用函数Windows CommDlgExtendedError来确定是否发生了一个错误。
因为这个函数弹出来的是一个模态对话框,所以这个函数的一直等到用户点击“确定”或“取消”按钮时才返回。
CPropertySheet::DoModal
Displays a modal property sheet.
virtual INT_PTR DoModal();
virtual INT_PTR DoModal();
Return Value
IDOK or IDCANCEL if the function was successful; otherwise 0 or -1. If the property sheet has been established as a wizard (see SetWizardMode), DoModal returns either ID_WIZFINISH or IDCANCEL. 
Remarks
The return value corresponds to the ID of the control that closed the property sheet. After this function returns, the windows corresponding to the property sheet and all the pages will have been destroyed. The objects themselves will still exist. Typically, you will retrieve data from the CPropertyPage objects after DoModal returns IDOK. 
To display a modeless property sheet, call Create instead. 
When a property page is created from its corresponding dialog resource, it can cause a first-chance exception. This results from the property page changing the style of the dialog resource to the required style before the page is created. Because resources are generally read-only, this causes an exception. The system handles the exception, and makes a copy of the modified resource. The first-chance exception can therefore be ignored.
NoteNote 
This exception must be handled by the operating system if you are compiling with the asynchronous exception handling model. For more information about exception handling models, see /EH (Exception Handling Model). In this case, do not wrap calls to CPropertySheet::DoModal with a C++ try-catch block in which the catch handles all exceptions, for example, catch (...). This block would handle the exception intended for the operating system, and cause unpredictable behavior. However, you can safely use C++ exception handling with specific exception types or structured exception handling where the Access Violation exception is passed through to the operating system. 
To avoid generating this first-chance exception, you can manually guarantee that the property sheet has the correct Window Styles. You need to set the following styles for a property sheet: 
DS_3DLOOK
DS_CONTROL
WS_CHILD
WS_TABSTOP
You can use the following optional styles without causing a first-chance exception:
DS_SHELLFONT
DS_LOCALEDIT
WS_CLIPCHILDREN
Disable all other Windows styles because they are not compatible with property sheets. This advice does not apply to extended styles. Setting these standard styles appropriately will guarantee that the property sheet does not have to be modified and will avoid generating the first-chance exception.




控件的消息映射宏的格式:ON_通知消息码(nID, memberFun)。nID是控件ID,memberFun是消息处理函数名
消息处理函数声明的语法形式为:afx_msg void memberFun();




静态文本框 CStatic类
编辑框 CEdit类




CStatic类的两个成员函数:
CStatic:Constructs a CStatic object. 
Create:Creates the Windows static control and attaches it to the CStatic object. 




CEdit类的成员函数Create中,第一个变量DWORD dwStyle是决定编辑框风格的,他有一个比较有意思的取值是ES_PASSWORD,可以使所有键入的字符都用“*”来显示,我们的密码就是这么来的啦。ES_MULTILINE风格可以写多行(比如说QQ啊什么的),ES_WANTRETURN风格是支持回车键的多行编辑框(比如说一些招聘网站的自我介绍什么的)。




此处为论坛讨论


不用数字,我是想用对象指针来代替id


你写程序的时候就知道对象的指针是什么?这些都是程序运行时生成的。
吃饭去了,如果我理解有误,欢迎指教。


因为是在代码中创建控件,所以
指针可以在创建控件时得到


估计楼主是对程序加载的时候的顺序不清楚吧。(MFC中)是这样的。
1。程序启动
2。比如要加载一个文本框控件,就要告诉系统我要加载一个文本框控件,然后楼把这个文本框的名字(ID)告诉系统,注意这个时候控件还没加载到内存,程序中根本就不存在这个控件的对象,更别说指针了。
3。系统根据控件的ID找到这个控件,并且获取各种参数,然后加载这个控件到内存。
4。返回控件在内存中的地址也就是指针。
也就是说指针是在3以后才产生的,但是你在2的时候就想用指针,可能吗。



互联网 大前期
医生 大后期
机械制造 上一版本中逆天,这一版本中被大幅削弱
公务员 信使减速
军队 防守塔
教育 一路小号
房地产 肉山
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值