Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

How could I get the Lights’Info through p

uikey

New member
Hi
I want to get/set the current window's lights Information using pro/toolkit API,then I will
store them in OpenFlight's format.but when the program began to execute,the pro/engineer2001 suddenly crashed.
This is my code about getting the light information:


Pro_light light_info;
light_info.name[5]='p','o','i','n','t';
light_info.status=1;
light_info.type=PRO_LIGHT_POINT;
light_info.rgb[3]=222.0,0.0,1.0;
light_info.position[3]=22,21,11;
light_info.cast_shadows=1;
status = pro_set_light_sources(-1,1,&light_info);//the program crashed here !!!!!!!!!
if(status == PRODEV_NO_ERROR)
{AfxMessageBox( "Succeed!!!!" );}
else
{
AfxMessageBox( "failed!!!!" );
}


Any suggestions?Thanks in advance!

*^_^*
 
I think the problem is your light_info.name. ProToolkit says this first parameter is a wchar_t type.


I'm wondering why not use the function ProStringToWstring to convert your string in a wide string?


-Hora
 

Sponsor

Articles From 3DCAD World

Back
Top