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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to use ProMdlRetrieve function and what are the required settings for VS2012 to use ProE toolkit.

bgupta
1-Visitor

How to use ProMdlRetrieve function and what are the required settings for VS2012 to use ProE toolkit.

Hi,

I am using ProE toolkit for the first time and used ProMdlRetrieve to load model from the assembly file:

 

char* asm_name;

ProName name_wchar;

ProMdl *loaded_model = NULL;

 

 

asm_name = "015-0315.asm";

 

ProStringToWstring (name_wchar, asm_name);

err = ProMdlRetrieve (name_wchar, PRO_MDL_ASSEMBLY, loaded_model);

 

Running creo2 as it may be required for  the function ProMdlRetrieve to get the definition from, assembly and parts are in the same folder.

 

I am getting an Access Violation error when control comes to the function ProMdlRetrieve.

what are the required settings for VS2012 to use ProE toolkit.

Please answer asap...

 

-Brijesh


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.
3 REPLIES 3
FV
17-Peridot
17-Peridot
(To:bgupta)

Brijesh,

You need something like this:

char  asm_name[PRO_NAME_SIZE]= "015-0315.asm";;

ProName name_wchar ={'\0'};

ProMdl loaded_model = NULL;

ProError err = PRO_TK_GENERAL_ERROR;

ProStringToWstring (name_wchar, asm_name);

err = ProMdlRetrieve (name_wchar, PRO_MDL_ASSEMBLY, &loaded_model);

or to shorten up :

ProName name_wchar = L"015-0315.asm";

ProMdl loaded_model = NULL;

ProError err = PRO_TK_GENERAL_ERROR;

err = ProMdlRetrieve (name_wchar, PRO_MDL_ASSEMBLY, &loaded_model);

HIH.

Feliks.

bgupta
1-Visitor
(To:FV)

Hi Feliks,
Thanks for replying..


Your answer is helpful but I think I am not able to get the access of the function ProMdlRetrieve.

Getting the same error:

Unhandled exception at 0x000000013FD3BED7 in MFCApplication2.exe: 0xC0000005: Access violation reading location 0x0000000000000008.

I am testing my application by running the Parametric.exe in the background.
Do I need to run this Parametric.exe through the application code?
--------OR-----------
I there some more settings required for the MFC project?

-Brijesh

FV
17-Peridot
17-Peridot
(To:bgupta)

Brijesh,

To test ProMdlRetrieve functionality you could add four lines of code to the make_install or make_install_cxx application supplied with Pro/Toolkit.

Try to post your question to Customization Community and maybe someone with the MFC experience could help you.

Feliks.

Announcements


Top Tags