- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
WCHAR wcText[100] = {0};
WCHAR *pText = wcText;
WCHAR **ppText = &pText;
HRESULT hr = pDialogCustomize->GetEditBoxText(dwCtrlID, ppText);
编辑框包含文本“5000”,但 GetEditBoxText
方法未返回此文本。
如何从编辑框中获取文本?
最佳答案
根据 http://msdn.microsoft.com/en-us/library/bb775908%28VS.85%29.aspx , GetEditBoxText 为您分配并返回一个字符串(您稍后必须使用 CoTaskMemFree 释放该字符串)。我假设您在函数调用后检查 wcText 数组,它是空的?这是因为 GetEditBoxText 正在更改 pText 的值。
尝试:
WCHAR *pText = NULL;
HRESULT hr = pDialogCustomize->GetEditBoxText(dwCtrlID, &pText);
if (S_OK == hr && NULL != pText)
// function succeeded and pText points to a buffer of text that must free when done using
关于visual-c++ - 如何使用 IFileDialogCustomize::GetEditBoxText() 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5732694/
我可以使用 FileSaveDialog1.Dialog.QueryInterface 创建一个按钮,如下所示。如何设置和处理 OnPushButton 单击事件以便我可以响应按钮单击? proced
WCHAR wcText[100] = {0}; WCHAR *pText = wcText; WCHAR **ppText = &pText; HRESULT hr = pDialogCustomi
我正在寻找一个公共(public)文件打开对话框,其中“打开”按钮上有“打开”和“打开只读”选项。 我已经按照...中的示例 Add a IFileDialogCustomize PushButton
我正在尝试通过 COM 调用在 C# 中使用 IFileDialogCustomize 接口(interface)。我调用 GetEditBoxText(id, buffer) 定义为: [M
我是一名优秀的程序员,十分优秀!