|
Hi,
when i tried with single dialog box it is working but when i include another it is not working. This is how i did
1)Create an SDI application (as our project is done using SDI application)
2)2 new dialog boxes
3)On execution first dialog box opens with OK and CANCEL button (minimize is working fine).On pressing OK button second dialog box opens whose mimimize is not working.
4)Code changes which i have made is as below
1)
BOOL CTest_minimizebutApp::InitInstance()
{
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTest_minimizebutDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CTest_minimizebutView));
dlg.DoModal();
// AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
}
2)
void CmainDialog::OnOK()
{
// TODO: Add extra validation here
dlg1.DoModal();
CDialog::OnOK();
}
|
|
|
|
|
Hi all,
Just wondering... In MS Visual C# we have the ability to get a list of all the available methods, properties etc in a class as we are coding.
For example, if I typed "Form1." I would get a list of the object methods etc.
Visual C++ seems to be able to do this to a point:
ie. System::Windows::Forms
But it wont let me go any further than this.
I am wondering if there is a plugin that anyone could recommend that extends the default VS2005 C++ help feature.
Thanks,
Mark.
|
|
|
|
|
it wont because there isn't anything more to be displayed.
only public classes/namespaces are displayed using the :: operator.
the . operator displays internals only if applyed on an object.
if you have a pointer, use the -> operator.
show a piece of the code you have if you want us to help more...
|
|
|
|
|
Hi,
I am using Visual Studio .NET 2003 for writing VC++ code. My application was based around a treeview but I wanted to give users the ability to rearrange the node/folder structure of the treeview using drag and drop. for example, Should work roughly like "Organize favorites" in Internet explorer.
|
|
|
|
|
Has anyone come accross this issue on Vista?
I have a program that uses:
hr = IXMLHTTPRequest->send( ... );
which FAILS only on Vista.
Any idea why? Works fine on XP with which we develop.
|
|
|
|
|
|
I don't know as the Vista PC is not a development PC. I will have to investigate that when I can. Just wondered if someone had already crossed this bridge. It's probably due to Vista's tighter security policy (not UAC), and probably have to use a different class instead of IXMLHTTPRequest.
So if anyone knows the answer I would be interested to here from you.
|
|
|
|
|
You could output the value of the hr using OutputDebugString() and then use DebugView from sys internals to see the value on the vista machine.
|
|
|
|
|
Hi All,
I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class.
Atul
|
|
|
|
|
There should be no problem doing this. It sounds like your CStringArray may have been delete before the second access.
Is it a member variable of an object that's gone out of scope or did you create it on the stack?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Do you want to access CStringArray on the other dialogs?
|
|
|
|
|
Atul23 wrote: But when i access it in other class...
How?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
could you pls explain the prblm.
Ajay
|
|
|
|
|
I have a program that have a lot of dialogs and so a lot of butons.
I wanna use my own button in all the dialogs, but I don't want to add a variable for each button on dialogs.
I wnat to do it in just one piece of code, something like this : (in InitDialog())
CWnd* pWnd = GetWindow(GW_CHILD);<br />
<br />
while(pWnd)<br />
{<br />
if(pWnd->GetRuntimeClass() != RUNTIME_CLASS(CButton))<br />
;
<br />
pWnd = pWnd->GetWindow(GW_HWNDNEXT);<br />
}<br />
|
|
|
|
|
Hadi Dayvary wrote: ...but I don't want to add a variable for each button on dialogs.
Why not?
"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
|
|
|
|
|
because there are more than 500 buttons in the project and they are growing,
If there is a better way I like to use it.
I think Professional UI use that way.
|
|
|
|
|
It would take all of 10 seconds to change all references from CButton to CMyButton using search/replace in the IDE. You've spent 100 times that just looking for a solution, let alone implementing one.
"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
|
|
|
|
|
DavidCrow wrote: It would take all of 10 seconds to change all references from CButton to CMyButton using search/replace in the IDE. You've spent 100 times that just looking for a solution, let alone implementing one.
thats what we call.. a great reply!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi
i have a problem ,when i changed the font of any simple dialog from property of that dialog i observed the effect,but when i do same think for property page i didn't get the effect,i get the solution by
this->GetDlgItem(id of control)->SetFont(font size);
but i have a lot of controls on my dialog there is any short method.
please reply i wiil be obliged
malik
|
|
|
|
|
Try to put all IDs in an contigous area and make a loop. I mean:
#define IDD_PROPERTY_SHEET 10000
#define IDD_CTRL_BUTTON1 IDD_PROPERTY_SHEET + 1
...
#define IDD_CTRL_EDIT_N IDD_PROPERTY_SHEET + m (from buttons) + n (from edits)
and then use a for:
for (int i = IDD_PROPERTY_SHEET; i <= IDD_CTRL_EDIT_N; i++)
this->GetDlgItem (i)->SetFont (font_size);
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
in your propertySheet::OnInitDialog() :
CPropertyPage* pPage = GetActivePage ();
ASSERT (pPage);
// change the font for the sheet
ChangeWindowFont(this, &m_font);
// change the font for each page
for (int iCntr = 0; iCntr < GetPageCount (); iCntr++)
{
VERIFY (SetActivePage (iCntr));
CPropertyPage* pPage = GetActivePage ();
ASSERT (pPage);
ChangeWindowFont(pPage, &m_font);
}
VERIFY (SetActivePage (pPage));
void propertySheet::ChangeWindowFont(CWnd* pWnd, CFont *pFont)
{
CWnd* pChildWnd = pWnd->GetWindow(GW_CHILD);
while(pChildWnd)
{
pChildWnd->SetFont(pFont, FALSE);
pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT);
}
}
|
|
|
|
|
Most common controls use the parent's font. Try setting the
font for the page instead of for every control.
Try changing
this->GetDlgItem(id of control)->SetFont(...);
to this
SetFont(...);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
How I can subclass all buttons used in my program.
I know how to do it for one button :
// - m_ctlButton is a CCustomButton for example
m_ctlButton.SubclassDlgItem(IDC_BCANCEL, this);
but I need a way to subclass all buttons in my MFC7 application.
I know there must be a way!
Thanks;)
|
|
|
|
|
Create a class inheriting from the CButton, make the subclassing in that class and use that class all over the program to create button.
Hope you getting me
Thanks,
Anand.
|
|
|
|
|
I have created a class that is derived from CBotton,
I know that I can make all buttons a variable from CMyButton,
But I want to change all my program buttons to CMyButton at once,means not to do it one by one and without declaring a CMyBotton object for all buttons.
I hope you understand what I mean.
Thanks
|
|
|
|