|
You need to use better coordinates for SetWindowPos then.
If you use GetDlgItem (IDC_MYBUTTON)->GetWindowRect (&rcCoords) , then you'll get the button's position in screen coordinates, which you can then use in SetWindowPos for your secondary dialog.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Thanks for the response
But don't we have same flag or attribute setting or some other way after which we can provide relative x,y points to SetWindowPos ??
Regards,
AbbyIndian
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
Nope.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Ok..
Thank you
Regards,
AbbyIndian
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
This code snippet worked fine for me:
void CMyMainDialog::OnButton1()
{
CMyPopupDialog dlg(&m_btn1);
dlg.DoModal();
}
BOOL CMyPopupDialog::OnInitDialog()
{
CDialog::OnInitDialog();
CRect rc;
m_pParent->GetWindowRect(rc);
SetWindowPos(NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
return TRUE;
}
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello friends,
I am trying to built in project in Visual Studio 2005. Project is created in MFC(Application project) and Visual studio 2003 by other person.
I am getting an error while comping. The error points towards
some file comsuppwd.lib .
I am just putting error names here as follows,
error LNK2005: "class _variant_t vtMissing" (?vtMissing@@3V_variant_t@@A) already defined in comsuppwd.lib(comutil.obj) comsuppd.lib
and other is
fatal error LNK1169: one or more multiply defined symbols found
I searched on net but not able to solve this error. please help me.
Thanks in Advance.
|
|
|
|
|
"Explicit references to comsupp.lib, either from the comment pragma or via the command line, should be changed to now use either comsuppw.lib or comsuppwd.lib, as /Zc:wchar_t is now on by default. comsupp.lib should still be used when compiling with /Zc:wchar_t-." from msdn.
try setting "vsproperty->language->Treat wchar_t as Built-in type = No". or specify the lib as above.
|
|
|
|
|
We solved this by Ignoring the library comsuppd.lib/comsuppwd.lib
Properties->Linker->Input->Ignore Specific Library
Hope it helps you
Thanks,
Vijay
|
|
|
|
|
I want to burn the data in DVD using the inbuit software in windows xp operating system.How to do it. I want to do in vc++ dialog based application.
|
|
|
|
|
Check this[^]
The next time, please make a search first here in Codeproject before posting a question.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
modified on Friday, March 14, 2008 8:35 AM
|
|
|
|
|
Hi all...
How can i disable OK button from property sheet??
I want OK button to enable when user make some changes...
It's Non MFC..
Thanks
Ash..
|
|
|
|
|
Have you tried using EnableWindow() ?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I tried...
But What would be identifier for OK Button??
As OK,Cancel and Apply button comes when i create Property sheet.
I tried this
EnableWindow(GetDlgItem(hPWnd,PSBTN_OK),FALSE);
Guide me to find the identifier of OK button..
Thanks.
Ash..
|
|
|
|
|
Ashish Chauhan wrote: I tried this
EnableWindow(GetDlgItem(hPWnd,PSBTN_OK),FALSE);
So, what happened when you tried that? Did it compile? Did it run? Did it give the expected result?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It compiled..It run but it did not gave expected result..
I try to find the error with the help of GetLastError and it comes to 1400 that is "Invalid window handle"
But i'm sure hPWnd is Property sheet Handle.
Do i need to pass something else??
Ash..
|
|
|
|
|
EnableWindow(GetDlgItem(hPWnd,PSBTN_OK),FALSE);
use IDOK inplace of PSBTN_OK. and should do after the dialog is created say in WM_INITDIALOG handler.
Ashish Chauhan wrote: But i'm sure hPWnd is Property sheet Handle.
It is not the hPWnd is invalid, since GetDlgItem() returns a invalid handle EnableWindow end up with error.
If you are going for modeless property sheet, you can create your own dialog box layout.
|
|
|
|
|
Ashish Chauhan wrote: But i'm sure hPWnd is Property sheet Handle.
GetLastError() returned 1400 (invalid window handle), because GetDlgItem() failed. And Rajkumar has already explained why it is so. Is the problem solved now?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yep..It works..
Thanks Rajesh and Rajkumar...
If possible can you tell me what's the identifier for Apply Button??
Ash..
|
|
|
|
|
Ashish Chauhan wrote: what's the identifier for Apply Button??
ID_APPLY_NOW
Please do a Google and CP Search, before asking very simple questions. An instant search got me the following result:
Hacking the CPropertySheet[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
if you are looking for disabling APPLY button, have a look at PSM_CHANGED and PSM_UNCHANGED message.
|
|
|
|
|
Yeah..
PSM_UNCHANGED..That's what i looking for...
ID_APPLY_NOW didn't work..
Error shows undeclared variable..
Neverthless Problem solved..
thanks..
Ash..
|
|
|
|
|
What about EnableWindow ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
How to get foder size?
eg:there is a folder "new" in c:\\ i want to get size of this folder how to get this in VC++ dialog based application.
|
|
|
|
|
sushildaga1984 wrote: How to get foder size?
eg:there is a folder "new" in c:\\ i want to get size of this folder how to get this in VC++ dialog based application.
find size of all files of folder and add them. It gives you folder size.
|
|
|
|
|
sushildaga1984 wrote: How to get foder size?
Are you wanting the size of the folder itself, or the size of all files in the folder?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|