|
So in the view class you can use that. I mean, (but I am not sure, since I dont know your implementation), you can handle it in the OnDraw, or in your drawing code. Like...
void CTopLevelMDI_TestView::OnDraw(CDC* )
{
CTopLevelMDI_TestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
if( pDoc->m_nGameType == 1 )
{
}
else if( ... )
{
}
}
|
|
|
|
|
Excellent. Using the the document as the bearer of the game type solves the problem.
Thakns a lot.
Snir_ya.
|
|
|
|
|
hi to all
I want to copy a directory which have sub-directories.I study CopyFile();
function but as i know it doesn't copy directory and a lot of sub-directory and i don't want to create those sub directory by code because there are a lot of directory How can i solve this problem
thank you in advance
|
|
|
|
|
You can use SHFileOperation API
OR
You have to search all files/folders recursively, also copy/create respectively. CFileFind will help you.
|
|
|
|
|
my code is below but i got error on 7th line where am i wrong plz help
SHFILEOPSTRUCT shFileOpStruct;
shFileOpStruct.hwnd=NULL;
shFileOpStruct.pFrom="C:\\1.txt";
shFileOpStruct.pTo="D:\\1.txt;
shFileOpStruct.wFunc=FO_COPY;
shFileOpStruct.fFlags=FOF_SIMPLEPROGRESS;
if(!SHFileOperation(&shFileOpStruct))
{
::AfxMessageBox("File transfering");
}
else
{
::AfxMessageBox("File not transfering");
}
|
|
|
|
|
rajneshmalik wrote: shFileOpStruct.pTo="D:\\1.txt;
There is a missing "
What error else it shows?
[Added]
One thing I noticed is that you have not initialized all the members of the SHFILEOPSTRUCT object.
Try this...
SHFILEOPSTRUCT shFileOpStruct = { 0 };
|
|
|
|
|
Hi , I have an MFC application whixh is huge already , and I have recently switched to writing new Dialogs using wxWidgets, but this causes unexpected behaviour, if I simlpy create wxWidgets dialogs from the MFC classes, then the program runs fine, but I get multiple icons for the application on the TaskBar, and , if I create the wxDialog as a child of the MFC app - using ::SetParent(...) , then the wxDialog is "locked" onto the main apps client area as if it were a child control, I have tried many things to get this working, even using AssociateHandle(HWND...) to Associate my main app's handle with a wxWindow and trying to ReParent(...) using that as the parent for this wxDialog, all to no avail.
If anybody has any clue whatsoever as to how to get around this strange wxWidgets behaviour, then your help would be appreciated beyond measure.
Thank you
Max
PS: Seasons Greetings
The tears shed in vain
and the hatred and pain
will be nothing but dust
at the end of the day
|
|
|
|
|
Is NOBODY going to even try to help me out on this one???
Well , anyways , I have found a workaround for the strange behaviour
which causes more than one icon to show up in the taskbar, I'll be
writing an article soon once I've gotten standard behaviour from my code.
Come on guys , where's your Christmas spirit?
The tears shed in vain
and the hatred and pain
will be nothing but dust
at the end of the day
|
|
|
|
|
Max_Power_Up wrote: Come on guys , where's your Christmas spirit?
My guess is that a) lots of folks aren't online over the holiday break, and b) most folks who use wxWidgets (like myself ) don't usually have both MFC and wx in the same exe and, as such, can't answer your question.
Judy
|
|
|
|
|
Thanks JudyL_FL, I have found that it is necessary to reparent the wxWidgets window to the top-level MFC dialog, this causes wxWidgets to share taskbar resources with the MFC app.
The tears shed in vain
and the hatred and pain
will be nothing but dust
at the end of the day
Hit me on my blog!
|
|
|
|
|
Hi
How can we Change the background color of individual columns
#sanroop#
|
|
|
|
|
johnalek wrote:
How can we Change the background color of individual columns
of the Parthenon? I think it is illegal, my friend...
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.
[my articles]
|
|
|
|
|
johnalek wrote: How can we Change the background color of individual columns
Of what?
|
|
|
|
|
Can you help us background color of ??
|
|
|
|
|
Hi Experts,
How to create a dialog with another. I elborate my problem.
I have designed one dialog(D1) with one Tree control at left side. I want ,when I click on any tree item an aonther dialog(D2) box should appear at right side of that dialog(D1) like a lot of contorls appear at right side.
Dialog(D2) box is getting appear but this is not attached with first dialog(D1). It can be seperately move. But I want to When I move D1, D2 should move.
|
|
|
|
|
For make a new dialog you can use of CDialog class or CreateWindow.
|
|
|
|
|
I did like this.
..
..
CDialog m_Dlg;
..
..
<br />
m_Dlg.Create(IDD_DLG_SELECT_ALGO,this);<br />
m_Dlg.SetWindowPos(this,100,500,400,300,SWP_SHOWWINDOW|SWP_NOMOVE);<br />
m_Dlg.ShowWindow(SW_SHOW);<br />
But not working.
|
|
|
|
|
|
D2 is displaying in the right side of D1.But it is not attached with D1.
When I move D1, D2 remains at same position. It does not bind with D1.
|
|
|
|
|
See these message :WM_MOVE and WM_MOVING.
|
|
|
|
|
Create a modeless dialog, and set it's property to behave like a child.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
set WS_CHILD style to D2
Are you have gtalk ? please add me: xiangyangzhao@gmail.com
|
|
|
|
|
Change the style as "child" in Styles tab of Dialog Properties. It might be now set as "popup". After that set "Control" in the More Styles tab and "Control Parent" in the Extended Styles tab.
|
|
|
|
|
Hi, I'm Not an expert, very few of us would claim to be.
Your problem appears not to be the drawing of the Dialog box, (that's quite simple) but the trapping of the event on which you want it drawn.
i.e. you want to trap the event of a user clicking on a Tree Control Item, by starting an event handler. That event handler should set up a Dialog box, and call it's DoModal().
Bram van Kampen
|
|
|
|
|
I am trying to do a chat room. How can I get the IP on which PC my server program is running automatically? Which method should I use?
|
|
|
|