我希望CFileDialog在Windows 7中显示如下图像.

按照msdn
如果
OFN_ENABLETEMPLATE已设置OFN_EXPLORER且未设置标志,则系统使用该模板创建替换默认对话框的旧式对话框.
但即使这样做,我得到的是这样的.

请帮忙!
我有三个结构header,dataA和dataB.在header将确定将要使用的结构.在dataA与dataB具有几乎相同的结构(比方说):
struct dataA
{
int intValue;
char reserved1[8];
float floatValue;
char reserved2[4];
short shortValue;
};
struct dataA
{
int intValue;
short shortValue;
char reserved[2];
float floatValue;
};
Run Code Online (Sandbox Code Playgroud)
我想打印它像:
sprintf(outStr, "%i, %f, %s", p->intValue, p->floatValue, p->shortValue);
Run Code Online (Sandbox Code Playgroud)
- 要么 -
sprintf(outStr, "%i, %f, %s", p.intValue, p.floatValue, p.shortValue);
Run Code Online (Sandbox Code Playgroud)
我该如何申报p?(注意:这两个dataA和dataB具有大的结构,但几乎是相同的数据,除了那些被保留.值)
我在想这样的事情:
void * p;
if (header->type==1)
p = (dataA*)(pData);
else if (header->type==2) …Run Code Online (Sandbox Code Playgroud) 首先,我是C++/CLI的新手.
做了一些研究后,我发现我可以Marshal::PtrToStringBSTR用来转换IntPtr为System::String.那么,有没有办法将我的_bstr_t变量转换为一个,IntPtr以便我可以将它传递给提到的函数并进行转换?
要么,
将_bstr_t变量转换为的正确方法是System::String什么?
我创建了一个自定义控件,其类具有CStatic基类.目前我使用WM_PAINT事件处理绘图.但是有一种奇怪的行为.当我使用CWnd::EnableWindow函数禁用它后重新启用窗口时,它拒绝绘制我在OnPaint函数中写的内容.它会绘制静态控件.
我同意有这种覆盖DrawItem和使用SS_OWNERDRAW样式的标准方法.但是怎么了WM_PAINT?
void XXControl::OnPaint()
{
CPaintDC PaintDC( this );
// ** draw the control to PaintDC**
}
Run Code Online (Sandbox Code Playgroud)