Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Error Returning CArray Pin
AmbiguousName23-May-12 22:56
AmbiguousName23-May-12 22:56 
GeneralRe: Error Returning CArray Pin
CPallini23-May-12 23:02
mveCPallini23-May-12 23:02 
QuestionReadFile bytes read not equla to bytes requested Pin
evs_bud23-May-12 21:27
evs_bud23-May-12 21:27 
AnswerRe: ReadFile bytes read not equla to bytes requested Pin
CPallini23-May-12 21:37
mveCPallini23-May-12 21:37 
QuestionCreate an incoming connection RAS server with C++ Pin
Member 800297323-May-12 12:56
Member 800297323-May-12 12:56 
AnswerRe: Create an incoming connection RAS server with C++ Pin
Erudite_Eric23-May-12 22:09
Erudite_Eric23-May-12 22:09 
GeneralRe: Create an incoming connection RAS server with C++ Pin
Member 800297324-May-12 5:55
Member 800297324-May-12 5:55 
QuestionCTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_23-May-12 6:08
Vaclav_23-May-12 6:08 
I am using CTabCtrl to switch between doc / view views. Works as expected, no problems.
But I need to change the views when the are "switched" to make OpenCV driver to be happy. The following code does do that before the tabs are switched. ( so far there is only one view in each child frame).
So far I have only two views to deal with, but will have more.
Being naturally lazy, I just do not like the CRuntimeClass and follwing if's.
Is there easier / less typing /error prone way to accomplish this?
How about using the document template to get the view pointer?



TRACE("\nvoid CMDITabs::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult) ");
// select current view - before tab changes
int i = GetCurSel();
if (i >= 0)
{
TCITEM item;
item.mask = TCIF_PARAM;
GetItem(i, &item);
HWND hWnd = HWND(item.lParam);
CWnd *pWnd = FromHandle(hWnd); // child frame
//CWnd *pChild = pWnd->GetWindow(GW_CHILD); // first child
CView *pChild_View = (CView*) pWnd->GetWindow(GW_CHILD); // first child - view


CRuntimeClass * pRuntime = pChild_View->GetRuntimeClass();

if(pRuntime->m_lpszClassName == "CTCC_MDIView_AVI_Process")
{
CTCC_MDIView_AVI_Process *pProcess = (CTCC_MDIView_AVI_Process *) pWnd->GetWindow(GW_CHILD);
if(!pProcess->m_C_OpenCV_Image->C_DisconnectDriver())
{
AfxMessageBox("failed to disconnect driver", MB_ICONSTOP);
TRACE("\nFailed to disconnect driver");
}
else
{
TRACE("\n\nCTCC_MDIView_AVI_Process driver disconnected ");
AfxMessageBox("\nCTCC_MDIView_AVI_Process driver disconnected ");
}
}

if(pRuntime->m_lpszClassName == "CTCC_MDIView_AVI_Preview")
{
CTCC_MDIView_AVI_Preview *pProcess = (CTCC_MDIView_AVI_Preview *) pWnd->GetWindow(GW_CHILD);
if(!pProcess->m_C_OpenCV_Image->C_DisconnectDriver())
{
AfxMessageBox("failed to disconnect driver", MB_ICONSTOP);
TRACE("\nFailed to disconnect driver");
}
else
{
TRACE("\nCTCC_MDIView_AVI_Preview driver disconnected ");
AfxMessageBox("\nCTCC_MDIView_AVI_Preview driver disconnected ");
}
}
AnswerRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 6:47
Aescleal23-May-12 6:47 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_23-May-12 7:42
Vaclav_23-May-12 7:42 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_23-May-12 10:29
Vaclav_23-May-12 10:29 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 23:46
Aescleal23-May-12 23:46 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 23:57
Aescleal23-May-12 23:57 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_24-May-12 3:39
Vaclav_24-May-12 3:39 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_24-May-12 7:31
Vaclav_24-May-12 7:31 
Questionnew and free Pin
pix_programmer23-May-12 0:23
pix_programmer23-May-12 0:23 
AnswerRe: new and free Pin
CPallini23-May-12 1:00
mveCPallini23-May-12 1:00 
GeneralRe: new and free Pin
pix_programmer23-May-12 1:13
pix_programmer23-May-12 1:13 
GeneralRe: new and free Pin
CPallini23-May-12 1:48
mveCPallini23-May-12 1:48 
AnswerRe: new and free Pin
«_Superman_»23-May-12 4:54
professional«_Superman_»23-May-12 4:54 
QuestionUnable to write to shared memory Pin
manoharbalu22-May-12 20:20
manoharbalu22-May-12 20:20 
AnswerRe: Unable to write to shared memory Pin
Malli_S22-May-12 20:34
Malli_S22-May-12 20:34 
GeneralRe: Unable to write to shared memory Pin
manoharbalu22-May-12 22:40
manoharbalu22-May-12 22:40 
AnswerRe: Unable to write to shared memory Repost Pin
Richard MacCutchan22-May-12 22:34
mveRichard MacCutchan22-May-12 22:34 
GeneralRe: Unable to write to shared memory Repost Pin
Richard Andrew x6423-May-12 12:08
professionalRichard Andrew x6423-May-12 12:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.