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.

What version Visual C++ use for Pro/W 2.0

henrykhiem

New member
Dear all,


I'm a beginer. Could u tell me what version VC++ isused for Pro/E W 2.0? I using VC++ 6.0 but I can not build my program (C++). These are my error :


:\Work\example1\1.cpp(26) : error C2065: 'ProStringToWstring' : undeclared identifier
D:\Work\example1\1.cpp(28) : error C2065: 'ProObjectwindowCreate' : undeclared identifier
D:\Work\example1\1.cpp(30) : error C2664: 'ProSolidDisplay' : cannot convert parameter 1 from 'void *' to 'struct sld_part *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Error executing cl.exe.
 
MS VC++ 6.0 should be ok. There are only link troubles with Microsoft Visual Studio .NET (VC++ 7.0) when you want to compile asynchronous WF2 application.

You have compile error, I will recommend to check if you include correct protoolkit header file from <PROE_INSTALL_DIR>/protoolkit/include

Tom
 
thank you TL


I already fixed that problem. But when i followed the example of my book, i got a new error. I dont know how to do, could you help me?


in my program, i try to open 1 part. My code:


#include "ProToolkit.h"
#include "ProSolid.h"
#include "proutil.h"
#include "ProWindows.h"
#include "ProMdl.h"
int user_initialize(int argc, char *argv[])
{
int PartOpen();
PartOpen();
return (0);


}
void user_terminate()
{
printf("Pro/Toolkit application terminated successfully\n");
return ;
}
int PartOpen()
{
ProFamilyName name;
ProMdl part;
ProStringToWstring (name,"A.prt");
ProMdlRetrieve (name, PRO_PART, &part);
ProObjectwindowCreate (name, PRO_PART, NULL);
ProSolidDisplay (part);
return (0);
}



and my errors :


rror C2664: 'ProMdlRetrieve' : cannot convert parameter 2 from 'enum pro_obj_types' to 'ProMdlType'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)


rror C2664: 'ProSolidDisplay' : cannot convert parameter 1 from 'void *' to 'struct sld_part *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast


pls help me check it, thank you
 
Hi Henry,


Your code is perfectly Okie....I didn't find any errors same code i copy pasted at my end.I think you havn't set your libs settings properly it seems to be.


Why are you trying to create your code extentions as .cpp, why don't you try with ".C" as the extension to your sample.It is not at all object oriented.


With regards,


Kishore V
 
dear henrykhiem



i have come with the the problem just like you said in the begining ,it says like that:


error C2065: 'ProStringToWstring' : undeclared identifier



would you like to tell me how to solve it ?thank you very much
 
Hi haiengcumt,


i think you not yet set the conrect include. For Prostringtowstring function, you should be use #include "ProUtil.h" and the language must be C, not C++


goodluck,


Henry
 

Sponsor

Back
Top