Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Get sim information


Recommended Posts

Hi,

Which is the easiest way to get information from SIM? I need to do a stand-alone application which is able to read information from the SIM. I've even tried to use "GetSimInfo" function from SimAccess.dll (using "LoadLibrary" and "GetProcAddress" functions) but it doesn't work properly. banghead.gif

 

Thanks

Link to comment
Share on other sites

I did that before, and it worked. biggrin.gif

 

code:

typedef void (*get_hasp_info_func)(MC_BOOL countLicenses, mcSimInfo *info);

get_hasp_info_func get_hasp_info=NULL;

 

 

 

 

HMODULE hMod=::LoadLibrary("SimAccess.dll");

if(hMod)

{

get_hasp_info = (get_hasp_info_func)::GetProcAddress(hMod,("?get_hasp_info@@YAXDPAUmcSimInfo@@@Z"));

if(get_hasp_info!=NULL)

{

mcSimInfo sim;

get_hasp_info(FALSE,∼);

CString info;

info.Format("%d %d",sim.userType,sim.serialNumber);

 

AfxMessageBox(info);

}

}

 


Link to comment
Share on other sites

Hi Pete,

I've tried your simacces H and LIB files, but on timed (temporary) sim the "getsiminfo" function always outputs an invalid date for start date, end date and maintenance expiration date. On the contrary, using an "unlimited" sim the output is correct!

I need to get the Maintenance expiration date both on timed and "unlimited" sim.

Here is the code I wrote to get this information:

 

FILE *ff;

mcInfo sim;

memset(∼,0,sizeof(mcInfo));

GetSimInfo(false,∼);

ff=fopen("AAAAAAAA.txt","w");

fprintf(ff, "serialNumber %dn", sim.serialNumber);

fprintf(ff, "timed %dn", sim.timed);

fprintf(ff, "timedStartDate %sn", sim.timedStartDate);

fprintf(ff, "timedEndDate %sn", sim.timedEndDate);

fprintf(ff, "userType %dn", sim.userType);

fprintf(ff, "maintenance %dn", sim.maintenance);

fprintf(ff, "maintDaysLeft %dn", sim.maintDaysLeft);

fprintf(ff, "maintDateOK %dn", sim.maintDateOK);

fprintf(ff, "maintExpirationDate %sn", sim.maintExpirationDate);

fclose(ff);

 

Thanks

Link to comment
Share on other sites

I have already seen the .timed and .dayleft value are correct, but I rather need the .maintExpirationDate value because I have to develop an "Update Manager" application based on maintenance expiration date...

 

I'll be waiting for your information.

 

thank you Pete

Bye

Link to comment
Share on other sites

Maintenance is a little different because it has always been our policy that a Mastercam user who is using a timed SIM has access to the latest software, so we don't store Maintenance information on timed SIMs.

 

This policy will be changing in X2 MR1 - we will be storing and checking Maintenance dates on timed SIMs. In that case, you will then be able to rely on the .maintenance & .maintDaysLeft fields.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...