我有一個MFC項目,目前我正在調試模式下運行。如何在調試模式下運行時顯示主視圖 - MFC
我有這個「運行」按鈕,當我點擊它時,我的算法運行,並最終得到繪製。
在過去,點擊運行後,我繼續看到主視圖。 過了一會兒(不知道是什麼改變了它),點擊後,視圖進入了後面(在Visual Studio後面)。我可以通過在「運行」開始時使用Show_Window(SW_SHOW)來修復它。
現在似乎沒有什麼是working-我也嘗試過的OnDraw和
`SetWindowPos(&CWnd::wndTop,0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE);`
我總是得到的Visual Studio對我的看法的頂部點擊運行後! (即使沒有斷點,異常...)
這裏是我的運行功能:
void CMaBakerView::maBakerRun(){
SetWindowPos(&CWnd::wndTop,0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE);
CRect ClientRect;
GetClientRect(ClientRect);
CDC* pDC = GetDC();
OnDraw(pDC);
int xMax = ClientRect.right;
int yMax = ClientRect.bottom;
//fillGUIData();
try
{
ShowWindow(SW_SHOW);
RunAlgorithm::run(xMax, yMax);//Here only pure logic is run, i can post the code of it if anyone thinks its relevant
//Other nonimportant code
} catch...
我注意到,註釋掉RunAlgorithm ::運行時,不會出現問題,但它可能是由於這是唯一真正需要時間的功能... 任何人都可以請給我一個方向嗎?
我正在使用Visual Studio 2008專業版
謝謝!
感謝您的回覆。我試過setforegrounwindow,並沒有幫助。任何其他方向? – Ginandi