|
You're on the right track.
I personally use a CTabCtrl as just a control and handle everything in the control's parent (like
you would a simple control like a button in a dialog.
The parent window class (CView-derived in your case) contains:
1) a CTabCtrl object
2) an array of CWnd pointers for each tab's window.
The parent window (I'll call it CTabCtrlParent handles window resizing and tab control
notifications.
In CTabCtrlParent OnCreate() I create the tab control, create each window for each tab, placing
the (window pointers in the array for easy indexing later) and using CTabCtrl::InsertItem() to
add a tab using the same index as the window pointer array index.
In CTabCtrlParent OnNotify() I handle TCN_SELCHANGE, TCN_SELCHANGING notifications from the tab
control. For TCN_SELCHANGE I hide the current tab window, show the new tab window (using
MoveWindow() or something to size it in the tab control.
In CTabCtrlParent::OnSize() I resize the tab control to fit the client area and resize the current
tab window to fit the tab control's "client" area. This is the most complicated part so here's
an example:
if (pTabControl && (pTabControl->m_hWnd != 0))
{
CRect CliRect;
pTabControl->GetWindowRect(&CliRect);
::MapWindowPoints(0, *pTabControl, (LPPOINT)&CliRect, 2);
CRect TabClientRect = CliRect;
pTabControl->AdjustRect(false, &TabClientRect);
::MapWindowPoints(*pTabControl, *this, (LPPOINT)&TabClientRect, 2);
int i = pTabControl->GetCurSel();
if (i >= 0 && TabWindowPointerArray[i] && TabWindowPointerArray[i]->m_hWnd)
{
HDWP hDwp;
if ((hDwp = ::BeginDeferWindowPos(2)) != 0)
{
hDwp = ::DeferWindowPos(hDwp,*pTabControl,0,0,0,
CliRect.Width(),CliRect.Height(),
SWP_NOMOVE | SWP_NOZORDER);
hDwp = ::DeferWindowPos(hDwp,*TabWindowPointerArray[i], HWND_TOP,
TabClientRect.left,TabClientRect.top,
TabClientRect.Width(),TabClientRect.Height(), 0);
::EndDeferWindowPos(hDwp);
}
}
}
This takes care of your tab controll stuff. In the tab windows is where you'll have a splitter
and more windows, one for each splitter pane. Now you see why it's a lot of code to show here as
an example
|
|
|
|
|
Hi...
can anyone help me with this problem???
I need to create a CPtrArray called Array1. From a dialog i need to take the values and store it in this Array1. After that I need to display the values in the Array1 back in the dialog.
SO can any one suggest a solution for this.
also am new to MFCs and am stuck here without any solution..
Please do it as soon as possible....
Thanks.. waiting for ur reply... plz plz plz help me......
bye
|
|
|
|
|
CPtrArray MyPointerArray;
...
MyPointerArray.Add(somepointer);
...
for (int i = 0; i < MyPointerArray.GetSize(); ++i)
{
add MyPointerArray[i] to dialog
}
Mark
|
|
|
|
|
Nice solution indeed
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
See here[^] maybe its some helpful for you
|
|
|
|
|
Hi...
can anyone help me with this problem???
I need to create a CPtrArray called Array1. From a dialog i need to take the values and store it in this Array1. After that I need to display the values in the Array1 back in the dialog.
SO can any one suggest a solution for this.
Please do it as soon as possible....
Thanks.. waiting for ur reply...
bye
|
|
|
|
|
It would help a lot if you describe where you are stuck exactly. And also post some code if necessary.
|
|
|
|
|
When you submit a problem on any forum, please choose the subject that gives a brief introduction of your problem. The subject of your problem could be "Problem in storing values in CPtrArray" or "How to store values in CPtrArray" or so.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
I'm guessing the title would be "Problem that I haven't done my homework yet that's due in today"
|
|
|
|
|
SaptaSri wrote: Please do it as soon as possible....
|
|
|
|
|
hi
i want execue another exe in my application with CreateProcess functin.
but i dont have path of exe.
how i can call createprocess function without set path of exe.
please describe me about first and second parameters of createprocess.
|
|
|
|
|
Is this[^] helpful for you
|
|
|
|
|
WhiteSky wrote: Is this[^] helpful for you
I doubt it. Whether the OP chooses CreateProcess() , ShellExecute() , or some other mechanism, what's missing is the necessary path information. If no path is specified, Windows will help you out a little by searching: the folder in which the application was loaded from, the current folder, the Windows folder, and those folders listed in the PATH environment variable.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I said this link it seems she needs to know things about CreateProcessEx I think she want to knows only parameters maybe.But(maybe she want to run programs with input parameters)
|
|
|
|
|
How do you expect to run a file without knowing the path to it? If it's in the PATH variable, then you're in luck, but otherwise...
|
|
|
|
|
I guess she want to know about CreateProcess
|
|
|
|
|
for example i want use from peocess or thread handle.
-- modified at 3:04 Wednesday 11th October, 2006
|
|
|
|
|
so it seems you need GetModuleFileName
|
|
|
|
|
|
I guess she want to gets procceses and then get path of their and in the end insert this path to <codecreateprocess< code="">
|
|
|
|
|
dear Aqueel thank you very much.
its true.
|
|
|
|
|
Hi everyone,
I had build a graph with the following,
IGraphBuilder *pGraph ;
IMediaControl *pMediaControl ;
IVideoWindow *pVidWin ;
IMediaEventEx *pEvent;
I tried to play many files continuously so i created a list ctrl , its playing fine, BUT the problem i was facing is when one file is played and going to next file i release the above variables, so i am getting a blank screen like a flash.... i dont want that blank screen on the playing screen ... can anyone help me with this ... the movement from one file to other should be without the blank screen
Thanks in advance
With Regards
Raja Bose
|
|
|
|
|
do a google search for GMFBridge written by Geraint Davies. His ClipPlayer example sounds like what you are looking for.
cje
|
|
|
|
|
Thank you very much for replying
hmmm i will search for that and if i have any more queries i will inform.
Once again thanks.....
With regards
Raja Bose
|
|
|
|
|
hi.i write 2 program on 2 different computer,program 1 send data packet(sucj as "S15.00P")very fast(per 10ms).i use winsock for send & receive data.i use OnReceive Message of winsock to read buffer.but this message is very slow,i have data in buffer,but by use OnReceive i can't read data FROM BUFFER.please help me how can i read data from buffer very fast.i want a real time reading buffer.sender send data per 10ms & i want read data from buffer in 10ms in receiver.also i use CAsyncSocket class in visual c++ 6 in a MFC project
tnx
|
|
|
|