Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi,
I am repeatedly getting fatal error when try to get the value of spinbox, My code is below
int RunSpinBox()
{
ProError status;
int i;
char * dialog = "mcheck_plus_resource";
ProUISpinboxIntegerGet(dialog,"ItemValue",&i);
MessageBox(0,i,"SpinBox Value",1);
}
I have attached error file. Please anybody help to solve the issue.
Solved! Go to Solution.
I'd say that the error is caused by the MessageBox function.
Here is the function prototype as described on MSDN website:
int WINAPI MessageBox( _In_opt_ HWND hWnd, _In_opt_ LPCTSTR lpText, _In_opt_ LPCTSTR lpCaption, _In_ UINT uType );
First function parameter is of type HWND and you are using an constant integer (0). Second parameter has to be a string and you are passing an integer.
Normally this types of errors are captured at the compilation time.
Personally I prefer to use ProUIMessageDialogDisplay instead of MessageBox.
Other items you need to double check are the dialog and spinbox names? Do the "mcheck_plus_resource" and "ItemValue" match the names on your resource file?
I'd say that the error is caused by the MessageBox function.
Here is the function prototype as described on MSDN website:
int WINAPI MessageBox( _In_opt_ HWND hWnd, _In_opt_ LPCTSTR lpText, _In_opt_ LPCTSTR lpCaption, _In_ UINT uType );
First function parameter is of type HWND and you are using an constant integer (0). Second parameter has to be a string and you are passing an integer.
Normally this types of errors are captured at the compilation time.
Personally I prefer to use ProUIMessageDialogDisplay instead of MessageBox.
Other items you need to double check are the dialog and spinbox names? Do the "mcheck_plus_resource" and "ItemValue" match the names on your resource file?