cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Getting ProUISpinbox value in CREO Toolkit

PARTHIBAN_K
16-Pearl

Getting ProUISpinbox value in CREO Toolkit

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.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Parthiban Kannan

href="https://www.linkedin.com/in/parthiban-kannan/" target="_blank"
ACCEPTED SOLUTION

Accepted Solutions

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?

View solution in original post

1 REPLY 1

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?

Announcements


Top Tags