|
I would like to know how to change the height of a statusbar. Basically I want to make an owner-drawn status bar that is a little bit taller than the default MFC one.
Cheers,
Clint
|
|
|
|
|
I am using an SDI application with a splitter window and I want to change the view in one of the panes depending on what menu item is selected (e.g. go from a TreeView to a ListView). It seems to work but when redrawing the whole thing looks like a dog's breakfast. When I resize the splitter it seems to then redraw okay. Any suggestions? Am I not getting the size correct? I also tried Invalidate() for the frame window but it didn't seems to be sucessful either.
...<br />
m_Split2.GetColumnInfo(1,cx,ctemp);<br />
m_Split2.GetRowInfo(0,cy,ctemp);<br />
m_Split2.DeleteView(0,1);<br />
m_Split2.CreateView(0,1,RUNTIME_CLASS(CMyListView),CSize(cx,cy),NULL);<br />
GetActiveDocument()->UpdateAllViews(NULL);<br />
...
Many thanks
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
http://www.codeproject.com/docview/switchingviews.asp[^] should help
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Ryan,
You de man! Thanks
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
When I go to reopen my workspace project, I only get "CAboutDlg". The other View,Doc and Frame classes are not there, how do I reopen them as well? When I compile, I get the following message:
Compiling...
Exodus.cpp
StdAfx.cpp
Linking...
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CExodusDoc::classCExodusDoc" (?classCExodusDoc@CExodusDoc@@2UCRuntimeClass@@B)
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMainFrame::classCMainFrame" (?classCMainFrame@CMainFrame@@2UCRuntimeClass@@B)
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CExodusView::classCExodusView" (?classCExodusView@CExodusView@@2UCRuntimeClass@@B)
Debug/Exodus.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Exodus.exe - 4 error(s), 0 warning(s)
Thanks
I am using VC++ 6.0.
|
|
|
|
|
My first thought was that you simply needed to delete the project's CLW and NCB files and let Visual Studio rebuild them. However, the linker errors suggest that the files were somehow removed from the project. Have you tried adding them manually?
|
|
|
|
|
Thanks Dave, you were right...I needed to add the files manually. It appears that hardly any of my files opened. What I don't understand is why VC++ doesn't open all the necessary files with the workspace (.dsw) file. It's kind of misleading.
Question: how do I open ALL my project files at once every time I reopen my project. I'm sure you don't have to manually open 2 dozen files every time you want to reopen your program, or do you?
Thanks much, Dave
I'm using VC++ 6.0
|
|
|
|
|
DaveE9th wrote:
I don't understand is why VC++ doesn't open all the necessary files with the workspace (.dsw) file. It's kind of misleading.
Normally it does. But that's not to say that it doesn't occassionally get confused. For a large project I am working on, I have to remove those temporary files at least once per week, sometimes less.
|
|
|
|
|
I'm having problems getting my spin button to work in my application. I've initialized the common controls before trying to use it, and I've set the base, range, initial position and buddy control (an edit box) for the spinner. When I run my application, I don,t see the current position of my spinner in the edit box, and a call to SendDlgItemMessage() to get the current position invariably returns the same number - the one with which the spinner was initialized. What am I doing wrong?
Cheers, nickelplate.
|
|
|
|
|
Sounds like you didn't set the "set buddy int" style, to make the spinner change the contents of the edit box.
--Mike--
"So where does that leave us? Well, it leaves us right back where we started, only more confused than before." -- Matt Gullett
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
That solved the problem. My game is now complete. Thanks a lot.
Cheers, nickelplate.
|
|
|
|
|
Hi!
I'm having problems with an edit control not responding to ctrl+c, ctrl+v and ctrl+x keystroke combinations when it's residing inside a DialogBar.
The edit control doesn't receive a WM_CHAR message for any of the three keystroke combinations as it does in a regular dialog box, and I assume that's the problem.
Anyone know why?
|
|
|
|
|
The problem is probably that you've got an accelerator table that's stealing the messages. You may need to disable the accelerator table when the edit control has focus (handle EN_SETFOCUS and EN_KILLFOCUS).
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I am facing similar problem. pl help me out
I have CComboBox placed on CDialogBar. Here I dont't get the crtl+c, ctrl+v and ctrl+x messages on the ComboBox. But I can rightmouse click on combobox and can copy/paste.
Thanks
Sandeep Naik
|
|
|
|
|
Hi All
im printing some stuff out in landscape mode, i have the below
in my OnBeginPrint function to set the orientation of the paper
LPDEVMODE pDevMode;
pDevMode = pInfo->m_pPD->GetDevMode();
pDevMode->dmOrientation = DMORIENT_LANDSCAPE;
pDC->ResetDC(pDevMode);
first time round, it prints in landscape, but the actual text doesnt stretch across
the whole page like it should, the actual text is in the size of portrait mode on a landscape peice of paper
however if i print again, its all fine
and clues any1 ?
thanks
simon
|
|
|
|
|
hi,
i faced the same problem before and I got the solution by adding this code into my OnPreparePrinting(CPrintInfo* pInfo) which I found in a forum.
{
tagPDA pPrintDlg;
AfxGetApp()->GetPrinterDeviceDefaults (&pPrintDlg);
pInfo->m_pPD->m_pd.hDevMode = pPrintDlg.hDevMode;
LPDEVMODE devMode = pInfo->m_pPD->GetDevMode();
if (devMode)
{
// dmOrientation == DMORIENT_PORTRAIT
// dmOrientation == DMORIENT_LANDSCAPE
if (devMode->dmOrientation != DMORIENT_LANDSCAPE)
devMode->dmOrientation = DMORIENT_LANDSCAPE;
GlobalUnlock (devMode);
}
pInfo->m_bDirect = 1;
int rc = DoPreparePrinting(pInfo);
pInfo->m_bDirect = 0;
return rc;
}
hope this will help you.
regards,
sherryfa
|
|
|
|
|
I have an app which is a Dialog app. It then opens another dialog when I press a button. Now what happens is that it receives information via TCP. Both the dialogs have List controls.
When the TCP info comes in, the Main Dialog which has the object of the 2nd dialog, then takes the information and neatens it and says add the information into the List control of the 2nd dialog like this:
2ndDialog.m_list.AddString(information received).
This gives an ASSERTION FAILURE as in the subject. How can I fix this?
Live in peace
|
|
|
|
|
The list box in the second dialog has not been created yet. Has the dialog been opened yet? If not, then you can't add strings to the list box.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Well the listbox, is declared in the class of the dialog. Okay, the dialog is not opened at that stage. I will try opening it then, and then try DoModal. But I know if will fail at the point when I try AddString. Let me test first then tell u......
DoModal works fine. But now its all a matter of adding to the list when the dialog is opened. Lets try that.
Live in peace
|
|
|
|
|
It does not work at all.
2ndDialog.DoModal()
takes away the execution from the main dialog, so I am not able to addString from the main dlg.
How else can i do it?
Live in peace
|
|
|
|
|
Make an array of strings in your second dialog that the first dialog can add into, then in the second dialog's OnInitDialog() function, add the strings from the array into the list box. CArray will be fine.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Well, I understand the OnInitDialog is not defined, only as virtual funtion it is defined. Now if I do use that function, without defining anything, the system crashes.
Problem is that the ListBox seems to be in the wrong context. This inevitebly causes the assertion fail. I hope that is correct reasoning though.
How does one use a richedit control, without using a richedit view?
Live in peace
|
|
|
|
|
Ohhh! Thanks I now understant your explanation. I need to define the OnInitDialog function. I see. And then I do what I need to do now.
Thanks
Live in peace
|
|
|
|
|
Does any1 knows anything more (like syntax) then they are ADODB functions?
Nothing in MSDN, NOTHING!!!
Love is the law, love under will.
|
|
|
|
|