"Parameter is incorrect” when CPropertySheet::DoModal() is called
-
//The code in .cpp file
AfxMessageBox("near if condition");
if(InputSheet.DoModal()== IDOK)
{
AfxMessageBox("Entered if condition");
}
The outer message box “near if condition” get displayed, followed by “Parameter is incorrect” dialog box. Why “Parameter is incorrect” is getting displayed? What goes wrong? Any ideas. Plz do help.
//The declaration of InputSheet is as follows:
CInputSheet InputSheet(this,_T("Input Screen"));
//The CInputSheet.h file content is as follows:
class CInputSheet : public CPropertySheet
{
DECLARE_DYNAMIC(CInputSheet)
// Construction
public:
CInputSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CInputSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CInputSheet(CMainFrame* pMainFrame, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
public:
CMainFrame* m_pMainFrame;
// Operations
public:
public:
virtual BOOL OnInitDialog();
void MyTab();
public:
virtual ~CInputSheet();
// Generated message map functions
protected:
afx_msg void OnContextHelp();
DECLARE_MESSAGE_MAP()
};
#endif
Answers
-
I don't know what is the matter with your code, but if it were me and I was having trouble adding seven pages, I would try just adding one page (or even no pages).
Did you follow these rules when creating your pages:
-
Set the Caption edit box on the General page to the text you wish to appear in the tab for this page.
-
Set the Style list box on the Styles page to Child .
-
Set the Border list box on the Styles page to Thin .
-
Ensure that the Titlebar check box on the Styles page is selected.
-
Ensure that the Disabled check box on the More Styles page is selected.
David Wilkinson | Visual C++ MVP- Marked As Answer byWesley Yao Monday, April 13, 2009 2:31 AM
-
-
Maybe GetCurSel() is returning CB_ERR because there is no selection?
Really, you should be checking these things for yourself. You have (finally) found the place in your code where the problem arises.
David Wilkinson | Visual C++ MVP- Marked As Answer byRamesh Kumar. S Monday, April 13, 2009 8:37 AM
All Replies
-
Use Debug + Break All when the dialog is displayed. Look at the call stack to find the code that is complaining.
Hans Passant. -
Thanks nobugz!
This is the output result after using Debug + Break
First-chance exception at 0x7c81eb33 in MultiLateral.exe: Microsoft C++ exception: COleException at memory location 0x0012b56c..
This appears exactly when it executes if statement.
Any help.
Thanks in advance.
-
Call stack, not the Output window.
Hans Passant. -
Hi nobugz,
Here is my Call Stack
> Sample.exe!CMainFrame::OnOpenSampleFile() Line 3099 C++
mfc80.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x00000000, unsigned int nID=32772, int nCode=1242612, void (void)* pfn=0x00000000, void * pExtra=0x00000000, unsigned int nSig=56, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 82 C++
mfc80.dll!CCmdTarget::OnCmdMsg(unsigned int nID=32772, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 381 + 0x16 bytes C++
mfc80.dll!CFrameWnd::OnCmdMsg(unsigned int nID=32772, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 891 + 0x13 bytes C++
mfc80.dll!CMDIFrameWnd::OnCmdMsg(unsigned int nID=32772, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 82 C++
mfc80.dll!CWnd::OnCommand(unsigned int wParam=0, long lParam=2297564) Line 2299 + 0xd bytes C++
mfc80.dll!CFrameWnd::OnCommand(unsigned int wParam=32772, long lParam=2297564) Line 317 + 0xf bytes C++
mfc80.dll!CMDIFrameWnd::OnCommand(unsigned int wParam=32772, long lParam=2297564) Line 51 + 0xc bytes C++
mfc80.dll!CWnd::OnWndMsg(unsigned int message=273, unsigned int wParam=32772, long lParam=2297564, long * pResult=0x0012f7bc) Line 1755 + 0x10 bytes C++
mfc80.dll!CWnd::WindowProc(unsigned int message=273, unsigned int wParam=32772, long lParam=2297564) Line 1741 + 0x17 bytes C++
mfc80.dll!AfxCallWndProc(CWnd * pWnd=0x00000000, HWND__ * hWnd=0x001e0e3c, unsigned int nMsg=273, unsigned int wParam=32772, long lParam=2297564) Line 243 C++
mfc80.dll!AfxWndProc(HWND__ * hWnd=0x001e0e3c, unsigned int nMsg=273, unsigned int wParam=32772, long lParam=2297564) Line 388 + 0x10 bytes C++
mfc80.dll!AfxWndProcBase(HWND__ * hWnd=0x001e0e3c, unsigned int nMsg=273, unsigned int wParam=32772, long lParam=2297564) Line 407 + 0x16 bytes C++
user32.dll!77d48709()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!77d487eb()
user32.dll!77d70494()
user32.dll!77d4b368()
user32.dll!77d70494()
user32.dll!77d4b3b4()
ntdll.dll!7c90eae3()
user32.dll!77d494e3()
user32.dll!77d4de6e()
user32.dll!77d4b7ab()
comctl32.dll!5d0cb204()
comctl32.dll!5d09ad6c()
user32.dll!77d494e3()
user32.dll!77d4de6e()
user32.dll!77d48709()
user32.dll!77d487eb()
user32.dll!77d70494()
user32.dll!77d4c00e()
user32.dll!77d4e366()
mfc80.dll!CWnd::DefWindowProcA(unsigned int nMsg=514, unsigned int wParam=0, long lParam=1769489) Line 1035 + 0x13 bytes C++
mfc80.dll!CWnd::WindowProc(unsigned int message=514, unsigned int wParam=0, long lParam=1769489) Line 1742 + 0x13 bytes C++
mfc80.dll!CControlBar::WindowProc(unsigned int nMsg=514, unsigned int wParam=0, long lParam=1769489) Line 504 + 0xc bytes C++
mfc80.dll!AfxCallWndProc(CWnd * pWnd=0x00000000, HWND__ * hWnd=0x00230edc, unsigned int nMsg=514, unsigned int wParam=0, long lParam=1769489) Line 243 C++
mfc80.dll!AfxWndProc(HWND__ * hWnd=0x00230edc, unsigned int nMsg=514, unsigned int wParam=0, long lParam=1769489) Line 388 + 0x10 bytes C++
mfc80.dll!AfxWndProcBase(HWND__ * hWnd=0x00230edc, unsigned int nMsg=514, unsigned int wParam=0, long lParam=1769489) Line 407 + 0x16 bytes C++
user32.dll!77d48709()
user32.dll!77d487eb()
user32.dll!77d4ecd2()
user32.dll!77d70494()
user32.dll!77d489a5()
user32.dll!77d553a0()
user32.dll!77d70494()
user32.dll!77d489e8()
user32.dll!77d6e819()
user32.dll!77d65ce2()
mfc80.dll!CWnd::IsDialogMessageA(tagMSG * lpMsg=0x00154aa8) Line 197 + 0xd bytes C++
mfc80.dll!CWnd::PreTranslateInput(tagMSG * lpMsg=0x00154aa8) Line 4267 + 0x6 bytes C++
mfc80.dll!CControlBar::PreTranslateMessage(tagMSG * pMsg=) Line 443 + 0xa bytes C++
mfc80.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x001e0e3c, tagMSG * pMsg=0x00154aa8) Line 2882 + 0xb bytes C++
mfc80.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x00154aa8) Line 233 + 0xe bytes C++
mfc80.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x00154aa8) Line 773 + 0x9 bytes C++
mfc80.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x00154aa8) Line 255 C++
mfc80.dll!AfxInternalPumpMessage() Line 178 + 0xf bytes C++
mfc80.dll!CWinThread::Run() Line 625 + 0x7 bytes C++
mfc80.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f23, int nCmdShow=1) Line 47 + 0x7 bytes C++
Sample.exe!__tmainCRTStartup() Line 578 + 0x1d bytes C
kernel32.dll!7c816d4f()
kernel32.dll!7c8399f3()
libmmd.dll!0069006c()
libmmd.dll!00720070()
libmmd.dll!00720070()
libmmd.dll!00720070()
libmmd.dll!00720070()
libmmd.dll!0065005f()
libmmd.dll!0065005f()Actually
if(InputSheet.DoModal()== IDOK) is giving the problem,
if I step into that, the exact code which is stopping my flow is from
from dlgprop.cpp is making the “Parameter is Incorrect” dialog box to be popped up is
HWND hWnd = (HWND)::AfxPropertySheet(&m_psh);
-
I would think the problem must lie in your
CInputSheet(CMainFrame* pMainFrame, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
constructor.
David Wilkinson | Visual C++ MVP -
Thanks Davewilk. If the problem is on constructor, what could be done to resolve this issue?
If a press F11 at this statement:if(InputSheet.DoModal()== IDOK)
It opens up dlgprop.cpp and it reaches this line:HWND hWnd = (HWND)::AfxPropertySheet(&m_psh);
If i further F11 at this line. It opens afxstate.cpp and enters into this function code
AFX_MODULE_STATE* AFXAPI AfxGetModuleState()if (pState->m_pModuleState != NULL)
// thread state's module state serves as override
pResult = pState->m_pModuleState;
}
else
{
// otherwise, use global app state
pResult = _afxBaseModuleState.GetData();
}
ENSURE(pResult != NULL);
return pResult;
}
Here, when i add watch to pstate, it says no symbols loaded.
It nither enters if or else condition. Whether this could be the problem? Any help. Plz let me know.{
{
_AFX_THREAD_STATE* pState = _afxThreadState;
ENSURE(pState);
AFX_MODULE_STATE* pResult;
-
Just think about it. Your code is like this:
CInputSheet InputSheet(this ,_T("Input Screen" ));
if (InputSheet.DoModal()== IDOK)
{
//
}
The DoModal() call is MFC code, so there must be something wrong in the CInputSheet constructor. Maybe the way you added the pages.
David Wilkinson | Visual C++ MVP -
This is the way pages are added:
CPage1 m_pPage1(this);
CPage2 m_pPage2(this);
CPage3 m_pPage3(this);
CPage4 m_pPage4(this);
CPage5 m_pPage5(this);
CPage6 m_pPage6(this);
CPage7 m_pPage7(this);InputSheet.AddPage(&m_pPage1);
InputSheet.AddPage(&m_pPage2);
InputSheet.AddPage(&m_pPage4);
InputSheet.AddPage(&m_pPage3);
InputSheet.AddPage(&m_pPage6);
InputSheet.AddPage(&m_pPage5);
InputSheet.AddPage(&m_pPage7);
Also when we try to dropdown a combobox in the dialog, same "parameter is incorrect" message box appears. -
If this is the actual code in the constructor, it would seem that your pages are local variables that are going out of scope,
David Wilkinson | Visual C++ MVP -
Actually the declaration all are done in MainFrm.cpp itself
CPage1 m_pPage1( this );
CPage2 m_pPage2( this );
CPage3 m_pPage3( this );
CPage4 m_pPage4( this );
CPage5 m_pPage5( this );
CPage6 m_pPage6( this );
CPage7 m_pPage7( this );InputSheet.AddPage(&m_pPage1);
InputSheet.AddPage(&m_pPage2);
InputSheet.AddPage(&m_pPage4);
InputSheet.AddPage(&m_pPage3);
InputSheet.AddPage(&m_pPage6);
InputSheet.AddPage(&m_pPage5);
InputSheet.AddPage(&m_pPage7);AfxMessageBox("near if condition" );
if (InputSheet.DoModal()== IDOK)
{
AfxMessageBox("Entered if condition" );
}
The problem still continues. Plz do help
-
Ah, OK, you are adding the pages from outside the CInputSheet object. I usually make the pages members of the sheet, but I guess your way is OK.
What I am saying is that it is most unlikely that there is anything wrong with the MFC code invoked by DoModal() so the error must be in your code before the DoModal() call. If I were you I would simplify this code as much as possible.
David Wilkinson | Visual C++ MVP -
No davewilk, as you see in the code given above, there were no code in between declaration and addpage and calling DoModal().
Still, I couldn't understand what it conveys by saying "Parameter is incorrect" ? -
I don't know what is the matter with your code, but if it were me and I was having trouble adding seven pages, I would try just adding one page (or even no pages).
Did you follow these rules when creating your pages:
-
Set the Caption edit box on the General page to the text you wish to appear in the tab for this page.
-
Set the Style list box on the Styles page to Child .
-
Set the Border list box on the Styles page to Thin .
-
Ensure that the Titlebar check box on the Styles page is selected.
-
Ensure that the Disabled check box on the More Styles page is selected.
David Wilkinson | Visual C++ MVP- Marked As Answer byWesley Yao Monday, April 13, 2009 2:31 AM
-
-
Hi Davewilk,
First of all, I would like to thank you for showing interest on this issue. However, when i try to add one page, the objects i have created for the remaining pages are used throughout the Mainfrm.cpp. Hence, i couldn't try that.
All the pages are adhering to the 5 property settings you had mentioned.
But still, the problem continues...Plz do help.
Also,
CInputSheet InputSheet(this,_T("JTI MultiLateral Input Screen"));
int ret = InputSheet.DoModal();
If i change the code like this, ret holds 0. After adding the pages, DoModal() is giving "Parameter is incorrect".
-
All I can say is the error must lie in some of your code before the DoModal() call.
You never did show your CInputSheet constructor.
David Wilkinson | Visual C++ MVP -
Hi Davewilk,
Here is my InputSheet.cpp Implementation file. Help us to resolve this issue.
<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->// InputSheet.cpp : implementation file
//
#include "stdafx.h"
#include "Sample.h"
#include "InputSheet.h"
#include "TabCtrlEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/
// CInputSheet
IMPLEMENT_DYNAMIC(CInputSheet, CPropertySheet)
/**
* This method is generated by MFC
*
*/
CInputSheet::CInputSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}
/**
* This method is generated by MFC
*
*/
CInputSheet::CInputSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
}
/**
* This method is generated by MFC
*
*/
CInputSheet::CInputSheet(CMainFrame* pMainFrame, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
m_pMainFrame = pMainFrame;
}
//Function added on March 11 2008
/**
* This method is generated by MFC
*
*/
CInputSheet::~CInputSheet()
{
}
/**
* This method is generated by MFC
*
*/
BEGIN_MESSAGE_MAP(CInputSheet, CPropertySheet)
//{{AFX_MSG_MAP(CInputSheet)
// ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnHelpFinder)
//}}AFX_MSG_MAP
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelpFinder)
END_MESSAGE_MAP()
/
// CInputSheet message handlers
/*BOOL CInputSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: Add your specialized code here
//GetDlgItem(ID_APPLY_NOW)->ShowWindow(SW_HIDE);
SetActivePage(3);
return bResult;
}*/
/*
void CInputSheet::OnContextHelp()
{
// TODO: Add your command handler code here
}
*/
BOOL CInputSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
m_pMainFrame-> m_tab.Install(this );
if ( m_pMainFrame ->openMultiInitialFlag == FALSE)
{
m_pMainFrame->openMultiInitialFlag =TRUE;
m_pMainFrame-> m_tab.EnableItem (0,TRUE);
}
if (m_pMainFrame->userReadyFlag == FALSE)
{
m_pMainFrame-> m_tab.EnableItem (1,FALSE);
m_pMainFrame-> m_tab.EnableItem (2,FALSE);
m_pMainFrame-> m_tab.EnableItem (3,FALSE);
m_pMainFrame-> m_tab.EnableItem (4,FALSE);
m_pMainFrame-> m_tab.EnableItem (5,FALSE);
m_pMainFrame-> m_tab.EnableItem (6,FALSE);
}
if (m_pMainFrame ->wellReadyFlag == FALSE)
{
m_pMainFrame-> m_tab.EnableItem (1,FALSE);
m_pMainFrame-> m_tab.EnableItem (2,FALSE);
m_pMainFrame-> m_tab.EnableItem (3,FALSE);
}
if (m_pMainFrame ->caseReadyFlag == FALSE)
{
m_pMainFrame-> m_tab.EnableItem (4,FALSE);
m_pMainFrame-> m_tab.EnableItem (5,FALSE);
m_pMainFrame-> m_tab.EnableItem (6,FALSE);
}
return bResult;
}
void CInputSheet:: MyTab()
{
// m_tab.Install(this);
/* AfxMessageBox("Hai i am in Front");
BOOL bResult = CPropertySheet::OnInitDialog();
m_tab.EnableItem (1,FALSE);
m_tab.EnableItem (2,FALSE);
m_tab.EnableItem (3,FALSE);
m_tab.EnableItem (4,FALSE);
m_tab.EnableItem (5,FALSE);
m_tab.EnableItem (6,FALSE);
AfxMessageBox("Hai i am in Mid");
if(m_pMainFrame->wellReadyFlag == TRUE)
{
m_tab.EnableItem (1,TRUE);
m_tab.EnableItem (2,TRUE);
m_tab.EnableItem (3,TRUE);
}
AfxMessageBox("Hai i am in END");
*/
}
-
Constructor looks OK, but I would just simplify, simplify,simplify. Comment out OnInitDialog(), reduce the number of pages....
I did not understand what you said about the pages being used throughout MainFrm.cpp. In the code you showed before, the pages look like local variables (despite the m_ prefix).
Also, surely the call stack you showed before is not the entire call stack at the time of the error.
David Wilkinson | Visual C++ MVP -
Hello Davewilk, Thanks a lot to you. You directed me in a right direction, all other pages Except General Page is working fine. When i include General page it creates this parameter incorrect problem. Could you please help me in resolving this issue in general page? Plz do help. Once again thanks.
- Edited byRamesh Kumar. S Saturday, April 11, 2009 10:10 AM
-
Help you with what? You haven't shown anything about this General Page?
But if it were me I would:
1. Make absolutely sure that this page is the problem by adding the pages in a different order.
2. Of so, look carefully at the template and code of this page to see why it is different from the others.
3. If you see nothing, then Simplify, Simplify, Simplify. Comment out OnInitDialog(), do whatever you have to to narrow down the problem.
This is debugging 101.
BTW, your recent posts are showing with some garbage style information at the top. Why is that?
David Wilkinson | Visual C++ MVP -
Thanks DaveWilk,
BTW, hope that's because i pressed ctrl-v after i copying a header page over here.
Here is my GeneralPage.h
// GeneralPage.h : header file
//
#include "MainFrm.h"
class CGeneralPage : public CPropertyPage
{
DECLARE_DYNCREATE(CGeneralPage)
public :
CGeneralPage(CWnd* pParent = NULL);
CGeneralPage(CMainFrame* pMainFrame, CWnd* pParent = NULL);
~CGeneralPage();
CString GetUserId();
CString GetWellId();
void OnSelendokUserlist1();
void EnableButtons();
void RestoreDrainholeData();
int ActionFlag;
int UserList;
int WellList;
int CaseList;
CString CaseId;
BOOL deleteWell;
BOOL GeneralUserCreateFlag;
public :
enum { IDD = IDD_GENERAL_PAGE };
CStatic m_pCaseStatus;
CComboBox m_ctlWellList;
CComboBox m_ctlUserList;
CComboBox m_ctlCaseList;
CString m_nUserId;
CString m_nWellId;
CString m_nCaseId;
CString m_Phd_PathName;
CString WellId;
CString CaseDesc;
CString WellDescription;
double Well_MD;
double Well_TVD ;
CString caseId;
CString caseDescription;
CString m_userStatus;
CString m_wellStatus;
CString m_caseStatus;
CMainFrame *m_pMainFrame;
protected :
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
// @access Protected Member Functions
protected :
// Generated message map functions
//{{AFX_MSG(CGeneralPage)
virtual BOOL OnInitDialog();
afx_msg void OnCreateButton();
afx_msg void OnEditButton();
afx_msg void OnDeleteButton();
afx_msg void OnSelendokUserlist();
afx_msg void OnSetfocusUserlist();
afx_msg void OnSelendokCaseList();
afx_msg void OnSetfocusCaseList();
afx_msg void OnSelendokWelllist();
afx_msg void OnSetfocusWelllist();
afx_msg void OnPressure();
afx_msg void OnRate();
afx_msg void OnUserCreate();
afx_msg void OnReservoirCreate();
afx_msg void OnCaseCreate();
afx_msg void OnUserEdit();
afx_msg void OnReservoirEdit();
afx_msg void OnCaseEdit();
afx_msg void OnUserDelete();
afx_msg void OnReservoirDelete();
afx_msg void OnCaseDelete();
afx_msg void OnModeDisplay();
afx_msg void OnSelchangeUserlist();
afx_msg void OnSelchangeWelllist();
afx_msg void OnSelchangeCaseList();
afx_msg void OnPageStatus();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public :
afx_msg void OnEnChangePhdPath();
};
I will edit .cpp file and post here soon, because the file has more than 6000 chars
One thing, I surprised was the same code works fine in Visual Studio 6.0 without any problem. When it is converted to VC++8.0 using Visual Studio 2005. This problem arised. -
The goal here is not to cut down your code so you can dump it on the forum, but rather so you can find out what is causing the problem.
If your code works on VC6, it is unlikely that someone will spot the problem by looking at the code.
David Wilkinson | Visual C++ MVP -
Thanks Davewilk,
I am learning so much from you. Exactly, as u said, when DoModal() is invoked it then goes to Generalpage::OnInitDialog, There it reaches a function call called CGeneralPage::OnSelendokWelllist() and it goes through the code in that function. Once it reaches the following line:
m_ctlWellList.GetLBText(m_ctlWellList.GetCurSel(),
m_pMainFrame->m_caseSet.m_strWellIdParam);
//Where definitions of variables in Generalpage.h are
CComboBox m_ctlUserList;
CMainFrame* m_pMainFrame;
CCaseSet m_caseSet
where CCaseSet is a class derived from RecordSet
It jumps to LRESULT AFXAPI AfxCallWndProc(CWnd* pWnd, HWND hWnd, UINT nMsg,
WPARAM wParam = 0, LPARAM lParam = 0) of Wincore.cpp
and gets into catch block
CATCH_ALL(e)
{
lResult = AfxProcessWndProcException(e, &pThreadState->m_lastSentMsg);
TRACE(traceAppMsg, 0, "Warning: Uncaught exception in WindowProc (returning %ld)./n",
lResult);
DELETE_EXCEPTION(e);
}
END_CATCH_ALL
pThreadState->m_lastSentMsg = oldState;
return lResult;
}
lResult is 0 and then "Parameter is incorrect" dialog box appears. Any help? -
Maybe GetCurSel() is returning CB_ERR because there is no selection?
Really, you should be checking these things for yourself. You have (finally) found the place in your code where the problem arises.
David Wilkinson | Visual C++ MVP- Marked As Answer byRamesh Kumar. S Monday, April 13, 2009 8:37 AM
-
Yeah DaveWilk,
I agree with you. These things I have to look. This is because i am beginner in VC++. I really appreciate your patience in guiding me to reach this stage. Thanks a lot DaveWilk.
I will check the GetCurSel() and resolve this issue and i will share with you what happened.
-
THANKS DAVEWILK, THOUSANDS OF THANKS TO YOU. YOU MADE MY DAY!
Exactly, GetCurSel() created this problem. And this is because, there is the wrong entry in MS-Access database, when we rectified that everything went fine. It works now as same as VC++6.0 code.