Hello,
I'm just getting started with Pro/Toolkit. Got it to connect ok but
that's as far as I can get. Starting very simple. ProMdlCurrentGet
function returns PRO_TK_BAD_CONTEXT
I am using Wildfire and the model is open when we run it. I've made the
code as simple as possible. The following 2 lines is the output when the
program runs:
"Connection to Pro/Engineer established. Yippe!
ProMdlCurrentGet function returned PRO_TK_BAD_CONTEXT"
Here is the full code:
#include <stdio.h>
extern "C"{
#include <procore.h>
#include <pronotify.h>
#include <prodimension.h>
#include <proutil.h>
}
int main(void){
ProProcessHandle proe_handle;
ProBoolean random;
ProName current_name;
char current_name_in_c[PRO_NAME_SIZE];
ProMdlType objtype;
ProError err;
ProMdl mdlHandle;
err = ProEngineerConnect(",NULL,NULL,",PRO_B_TRUE, 100, &random,
&proe_handle);
if(err != PRO_TK_NO_ERROR){
printf("%s\n","Error occured while connecting to Pro/Engineer.");
return -1; // failure
}
printf("Connection to Pro/Engineer established. Yippe!\n");
err = ProMdlCurrentGet(&mdlHandle);
if (err = PRO_TK_NO_ERROR)
printf("ProMdlCurrentGet function returned PRO_TK_NO_ERROR\n");
else if (err = PRO_TK_BAD_CONTEXT)
printf("ProMdlCurrentGet function returned PRO_TK_BAD_CONTEXT\n");
while(1){
ProEventProcess();
}
return(0);
}
Anybody know what's up?
TIA.
Greg
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.