|
DavidCrow wrote: but why?
Because the professor may know it came from an outside source?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
When seeing in menu, there is no shortcut for increse/decrease indent.
If there is shortcut, it will be handy while coding.
Does anyone know there is any shortcut for this?
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: If there is shortcut
Select those text and press tab or shift + tab
|
|
|
|
|
nice naveen.
there is one more technique to auto indent the code.
that is, select the whole file (ctrl +A) or a portion of the code(obviously a block) and press Alt + F8 key.
this will automatically indent the code snippet.
|
|
|
|
|
Hi, Thanks for the help.
In my system, Tab & Shift + tab works well but Alt + F8 opens Macro explorer.
Best Regards,
Suman
|
|
|
|
|
r u using visual studio 6.0?
if that is so then alt+f8 should work.
|
|
|
|
|
chandu004 wrote: if that is so then alt+f8 should work.
But only if Smart indent is enabled.
"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
|
|
|
|
|
Hi!!
I am using VC++ .Net 2003.
As tab and shift + tab are working, it is well enough for coding.
Thanks for the help.
Best Regards,
Suman
|
|
|
|
|
Hi Naveen,
Thanks for your help!!
Best Regards,
Suman
|
|
|
|
|
I've returned to using MFC after a long absence. I've been writing some custom controls for a project. As I recall there are steps you can take to use double buffering. I think they're set in PreCreateWindow. I've been googling and looking through old projects of mine, but I just can't seem to discover what I'm looking for.
Maybe my memory is playing tricks on me, but it seems like there were flags you could set that could control painting to enable double buffering.
Anyway, any help is appreciated for this prodigal MFC programmer.
[EDIT]
The System.Windows.Forms.Control equivalent is SetStyle.
[/EDIT]
-- modified at 18:44 Sunday 30th September, 2007
|
|
|
|
|
I don't think it's built into MFC like it is WinForms. You need to do all your drawing on a compatible memory DC, then BitBlt it to the device context in WM_PAINT (OnPaint).
This might help: http://www.codeproject.com/gdi/flickerfree.asp
[^]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Were you thinking of the WS_EX_COMPOSITED extended window style?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Were you thinking of the WS_EX_COMPOSITED extended window style?
That doesn't ring a bell. At this point, I think my memory may just be playing tricks on me; I'm misremembering some C# custom controls I created a couple of years ago where I used SetStyle to enable double buffering. I thought that there was an MFC equivalent, but I think I may be mistaken.
I will investigate the WS_EX_COMPOSITED style.
|
|
|
|
|
Hi,
I am programming something for school and I have a dialog based MFC application. But in the first screen some date is saved in an array that contains variables from a certain structure. The problem is that a second window has to be opened to make a mathematical calculation after having insered some numbers. But I can't get it to work. I can't acces the data from the other dialog.
Could someone please help me?
Already a lot of thanks in advance,
Steven
|
|
|
|
|
minike wrote: I can't acces the data from the other dialog.
Some how you need pass the pointer of the first dialog to the second dialog so that the second dialog can access data from the first dialog through that pointer.
|
|
|
|
|
say you have a variable a in your first dialog, and you want to pass this value to the second dialog.
so, create the same variable a in the second dialog also, and do the following.
CSecondDialog s;//if CSecondDialog is your class.
s.a=a;
s.Domodal();
so here, you can access a from any function in the second dialog.
|
|
|
|
|
Maybe a little bit late . Anyway, there is an article here[^] that describe what you are looking for.
|
|
|
|
|
If we suppose that main dialog is CMain you can use of this line on other dialogs.
CMain* m_Main=(CMain*)GetParent();
m_Main->yourvariables;
|
|
|
|
|
In which method of MFC's CMDIFrameWnd or its clientarea (a subclassed CWnd of m_hWndMDIClient) should one create a simple CControlBar ?
I've tried it blindly (which is BAD practice I know):
BOOL ApplicationFrame::OnCreateClient(LPCREATESTRUCT lpCs,CCreateContext *pContext) {<br />
BOOL r;<br />
r = CreateClient(lpCs,NULL);<br />
if(r) {<br />
m_pToolbar = new Toolbar();<br />
ASSERT(m_pToolbar);<br />
ASSERT(this);<br />
m_pToolbar->SetBarStyle(CBRS_ALIGN_TOP);<br />
m_pToolbar->SetInPlaceOwner(this);<br />
}<br />
return r;<br />
}
Where:
class ApplicationFrame : public CMDIFrameWnd {<br />
}
but the control bar is not showing up (I can't see it even with spy++). What am I missing and how to do it right ?
|
|
|
|
|
As with all MFC windows, control bars are created in two steps - one for
the C++ object and one for the Windows object (HWND).
You are missing the second part - you need to call Create() or CreateEx()
on your m_pToolbar object.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have some CListCtrl - and after i insert all my item into it i want to choose the first item.
How can i do it ?
Thanks for any help.
|
|
|
|
|
CListCtrl list_control;
list_control.<a href="http://msdn2.microsoft.com/en-us/library/9t97k8h9(VS.80).aspx">SetItemState</a>(0,LVIS_SELECTED,LVIS_SELECTED);
Software Zen: delete this;
|
|
|
|
|
We are having problems with FindFirstChangeNotification using vista - I wonder if anyone can help or has had similar problems.
We have been using FindFirstChangeNotification to monitor images coming in from a camera for a couple of years now (on XP) with no problems. We have now got a couple of laptops running Vista and find we only get notifications on every other image coming in (we then pick up both new images).
However if we run Windows Explorer at the same tim and view the folder the images are coming into with it then we get each notification as each mage comes in.
Minimise the Windows explorer and we are back to getting notifications every other image!
On top of that we are printing stuff every thrid image and if we turn the printing off we get notifications on every image (whether or not Explorer is running).
The only relationship I can see with all this is it seems to be some sort of client server issues.
If anyone can help it would be much appreciated!! Thoug I suspect it may be a case of waiting until the first (or second service pack) comes out.
|
|
|
|
|
Is this of any help? Also, does the folder you're watching contain any symbolic links?
"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
|
|
|
|
|
I'm not sure - it might do and I'll give it a whirl in a couple of days time. However it is not running across a network but on the other hand I guess there are pretty much always going to be other processes that have a notification on if you happen to have a Windows Explorer open on that folder. Unfortunately when we have an explorer open to that folder is exactly when it seems to work correctly - ho hum!!!!
There are no symbolic links set up at all - very simple folder set up indeed.
As I say I'll probably get a chance to have a try in a coupld days.
Thanks.
Mike
|
|
|
|