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

ProConfigoptGet()

ptc-2192154
1-Newbie

ProConfigoptGet()

I am trying to get the current value of an axis (on or off) using ProConfigoptGet() According to what I see in the documentation this looks correct. But I get the following warning on compile.

Incompatible types = from 'unsigned short [32] to char *



Code is:

// Toolkit variables for ProE
char prooption[32];
ProName provalue;
ProName woption;
ProLine wvalue;
// Variables for Turning off and back on the AXIS and displays that we don't want in the drawing
ProLine axisvalue;

/***** Turn Off Axes *****/
sprintf(prooption, "AXIS_DISPLAY");
sprintf(provalue, "NO");
ProStringToWstring(woption, prooption);
ProStringToWstring(wvalue, provalue);
// Set a variable so that the current settings can be reset if needed
DebugPrint("Testing the value of AxisValue");
ProConfigoptGet(woption, axisvalue);

// Warning is on the above line



What am I doing wrong?


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.
1 REPLY 1

Hi Wade -

ProName is a 16-bit character array with this defintion:

typedef wchar_t ProName[PRO_NAME_SIZE];

Where PRO_NAME_SIZE is defined as "32". My guess is that this line:

sprintf(provalue, "NO");

is causing this error:

Incompatible types = from 'unsigned short [32] to char *

You'll need an extra ProStringToWstring() statement, or you could
try wsprintf() or wcscpy() instead of sprintf():

#include <wchar.h>

wcscpy( provalue, L"NO" ) ;

Note that I changed the string "NO" to L"NO", inidicating that
this is a 16-bit string value.

Hope this helps -

|+| M a r k |+|

- Mark Stallard
- Raytheon Company
- Sudbury, Massachusetts USA





"Wade Wyss" <->
07/31/2007 11:43 AM
Please respond to
"Wade Wyss" <->


To
-
cc

Subject
[proecus] - ProConfigoptGet()






I am trying to get the current value of an axis (on or off) using
ProConfigoptGet() According to what I see in the documentation this looks
correct. But I get the following warning on compile.
Incompatible types = from 'unsigned short [32] to char *

Code is:
// Toolkit variables for ProE
char prooption[32];
ProName provalue;
ProName woption;
ProLine wvalue;
// Variables for Turning off and back on the AXIS and displays that we
don't want in the drawing
ProLine axisvalue;
/***** Turn Off Axes *****/
sprintf(prooption, "AXIS_DISPLAY");
sprintf(provalue, "NO");
ProStringToWstring(woption, prooption);
ProStringToWstring(wvalue, provalue);
// Set a variable so that the current settings can be reset if needed
DebugPrint("Testing the value of AxisValue");
ProConfigoptGet(woption, axisvalue);
// Warning is on the above line

What am I doing wrong?
-----End Original Message-----
Announcements
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.

NEW Creo+ Topics:
PTC Control Center
Creo+ Portal
Real-time Collaboration