无法在vc ++中设置对话框样式(Visual Studio 6) [英] not able to set style of dialog in vc++ (visual studio 6)

查看:87
本文介绍了无法在vc ++中设置对话框样式(Visual Studio 6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个主对话框,其样式为"ovarlap",现在我想在运行时将其更改为"child".我试过了,

Hi,

I have a main dialog which has style ''ovarlap'' now i want to change it to ''child'' during runtime. I tried,

HWND hWnd = ::GetActiveWindow();
SetWindowLong(hWnd, GWL_STYLE, WS_CHILD);


但是它给了我如下编译错误.

error C2660: ''SetWindowLongA'' : function does not take 3 parameters

有替代的方法吗?

有人可以帮我吗...
在此先感谢


But its giving me compilation error as below.

error C2660: ''SetWindowLongA'' : function does not take 3 parameters

Is there an alternative way to do this??

Can anyone help me on this...
Thanks in advance

推荐答案

Windows API函数SetWindowLongA确实具有3个参数.也许您正在尝试调用其他相同名称的函数,类函数或其他名称?如果这是包装类的功能(在原始Windows窗口/对话框附近),则可能不需要第一个参数,因为它是从实例"this"中获取的.

另外,我看不到改变对话框样式有任何意义;不要以为它会以任何明智的方式起作用.

—SA
The Windows API function SetWindowLongA does take 3 parameters. Maybe you are trying to call some other function of the same name, a class function or something? If this is a function of a wrapper class (around raw Windows window/dialog), first parameter may be not needed as it is taken from the instance "this".

Also, I don''t see any sense in changing style of a dialog; don''t think it can work in any sensible way.

—SA


就像SA所说的那样,这似乎是在调用错误的方法.尝试以这种方式调用它(添加::作为前缀):
Like SA said, this looks like the wrong method is being called. Try calling it this way instead (add :: as a preffix):
::SetWindowLong(hWnd, GWL_STYLE, WS_CHILD);


这篇关于无法在vc ++中设置对话框样式(Visual Studio 6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆