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:

rm_titus

Verified Members
  • Posts

    40
  • Joined

  • Last visited

Posts posted by rm_titus

  1. Thanks Roger!

     

    I'm working with Notes (v8_note).

    The structure font_attr is defined

     

    code:

    typedef struct

    {

    p_2d center; /**< center point of arc */

    double str_rot; /**< string rotation angle */

    double slant; /**< slant angle */

    double chr_rot; /**< character rotation angle */

    double height; /**< height of character */

    double chr_exp; /**< character expansion factor(based on height)*/

    double extra_sp; /**< extra char. space facter per unit of height*/

    double extra_ln_sp; /**< extra line space factor */

    double alt_height; /**< height of character */

    double alt_chr_exp; /**< alt char. expansion factor(based on height)*/

    /* 2 bytes */

    unsigned short alt_color:4; /**< draw color */

    unsigned short fill_color:4; /**< fill color */

    unsigned short h_txt_aln:2; /**< hort. align.(0-left,1-center,2-right)*/

    unsigned short v_txt_aln:3; /**< vert. align.(0-top,1-cap,2-half,3-base,

    4-bottom) */

    unsigned short path:3; /**< text path (0-right,1-left,2-up,3-down,

    4-arc CW, 5-arc CCW); */

    /* 2 bytes */

    unsigned short space_sty:1; /**< spacing style(0-fixed,1-proportional)*/

    unsigned short fill:1; /**< fill region flag */

    unsigned short mirror:2; /**< mirror flag (0-no mirror, 1-mirror x,

    2-mirrory,3- mirror both)*/

    unsigned short filler:12; /**< not used at present, here for alignment */

    /* 4 bytes */

    MC_BYTE font; /**< display font */

    MC_BYTE alt_font; /**< alternate display font */

    MC_BYTE text_bx; /**< text box draw flag for top */

    MC_BYTE pad; /**< Pad end of structure */

    } font_attr;

    The 'Character Width' must be one of those elements but don't know which one.

     

    --Titus

  2. Thanks Roger !!

     

    I'm not mixing Release and Debug code, it was just a quick test to see what's happening when the library mastercam.exe is the one in sdkdebug folder.

     

    I'm doing a C# Windows Form Application straightforward, having a textbox and a button on it so it's not a NET-Hook and Mastercam is not running. I need to know the type of the user without having to open Mastercam.

     

    I keep getting that exception whenever McamX2-MR2mastercam.exe is used.

     

    Thanks,

    --Titus

  3. Thanks a lot Roger !

     

    Well, initially, I wanted just userType but having more details is better smile.gif

     

    Now I'm trying to implement get_user_type() into a standalone application, with this declaration

    code:

    [DllImport("mastercam.exe", EntryPoint = "?get_user_type@@YAFXZ")]

    public extern static short get_user_type();

    but I'm getting an AccessViolationException when calling.

     

    Anything wrong in my declaration ?

     

    Thanks

    --Titus

  4. Hi guys,

     

    I'm using finally

    code:

    [DllImport("SimAccess.dll", EntryPoint = "?get_hasp_info@@YAXDPAUmcSimInfo@@@Z")]

    public extern static void get_hasp_info(sbyte countLicenses, mcSimInfo* sim);

     

    with

     

    [structLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]

    public struct mcSimInfo

    {

    public sbyte netHasp;

    public sbyte netHaspNetwork;

    public long serialNumber;

    public short timeLimitOK;

    public sbyte timed;

    public short daysLeft;

    public ushort timedStartDate;

    public ushort timedEndDate;

    public short userType;

    public int nMillSeatsLicensed;

    public int nMillSeatsLeft;

    public int nLatheSeatsLicensed;

    public int nLatheSeatsLeft;

    public int nWireSeatsLicensed;

    public int nWireSeatsLeft;

    public int nDesignSeatsLicensed;

    public int nDesignSeatsLeft;

    public int nRouterSeatsLicensed;

    public int nRouterSeatsLeft;

    public sbyte maintenance;

    public short maintDaysLeft;

    public short maintDateOK;

    public ushort maintExpirationDate;

    }

    --Titus

  5. Hi guys,

     

    FYI, I found the issue. I was doing this as Takashi suggested, I mean

    code:

    strcpy( op.u.chook.opmgr_txt, "my chook toolpath!!!");	

    strcpy( op.u.chook.chook_name, "chook.dll");

    strcpy( op.u.chook.opmgr_prm, "ParametersFunction"); // chook's function to call when op's parameters are selected in the Operation Manager

    however my function ParametersFunction wasn't declared as

    code:

    extern "C" __declspec(dllexport) 

    Thanks for your help !!

     

    --Titus

  6. Hello guys,

     

    Just a quick update, I found I could use

     

    DllImpExp void set_init_op_use_prev_op_same_type ( MC_BOOL use_prev_op )

     

     

    in order to copy other operation data, however the challenge would be to be able to set every property upon creation of an operation as Takashi suggested.

     

    The issue I'm having actually is that setting these properties individually, I'm getting errors like "Program entry point not found" rather than performing tasks.

     

    Any hint will be really appreciated !! Thanks !

     

    --Titus

  7. Hi guys,

     

    I'm trying to play with the struct prm_chook when creating a new operation.

     

    Takashi already suggested roughly how the creation of a new chook operation could be done in the following thread

     

    http://www.emastercam.com/ubb/ultimatebb.p...t=000416#000001

     

    Have someone used these members succesfully :

    code:

    chook_name, opmgr_prm, opmgr_tool, opmgr_geom, regen_nci, opmgr_nciL, opmgr_nciR ?

    Thanks a lot !!

     

    --Titus

  8. Oh! Thanks a lot guys !! Now I understand better how the versioning works...

     

    I'd have another concern about the deployment of my DLLs. One of my CHooks is calling a .NET library through an unmanaged wrapper. I am able to make everything works only if the wrapper and the .NET library are both placed in McamX2 folder.

     

    Should I use manifest or configuration files in order to load an assembly elsewhere than McamX2 ?

     

    Thanks !!

     

    --Titus

  9. Hi arenner

     

    I would try

     

    code:

    post_dlg_settings my_post_settings;

    my_post_settings.save_nci_file = TRUE;

    my_post_settings.overwrite_nci = TRUE;

    my_post_settings.save_nc_file = TRUE;

    my_post_settings.overwrite_nc = TRUE;

    my_post_settings.send_to_machine = FALSE;

    my_post_settings.editNCI = FALSE;

    my_post_settings.editNC = FALSE;

    my_post_settings.export_oplist = FALSE;

    my_post_settings.export_prm = FALSE;

    my_post_settings.wcs_1014 = FALSE;

    my_post_settings.descriptor = FALSE;

    HTH

     

    --Titus

  10. Hi Mick,

     

    Sorry, in my previous message there was a typo in the directory name. It should have read McamX2chooksmy_application.

     

    As to why I am placing another nethook API in my own directory when there is already one in McamX2, that's a good question...

     

    Well, because I want to ensure my clients are using an up-to-date API and to avoid conflicts with the external context. For example, the NetHook2_0.dll I have in my McamX2, dated Sep. 2006, does not contain the IsOperation() method. The version that I am deploying, dated Dec. 2006, does contain it.

     

    My question is why does my DLL always use the Nethook API which exists under McamX2 rather than using my version ?!

     

    Thanks a lot !

     

    --Titus

  11. Hi guys,

     

    I have built a custom DLL which is referencing the new NetHook API.

     

    My own dll as well as the nethook2_0.dll are both installed under the directory McamX2chooks.

     

    I did noticed that my dll is always using the NetHook API existing under McamX2 directory and not the one that I have deployed in the same directory as the application.

     

    Is there something I am missing here ?

     

    Thanks in advance !

     

    --Titus

  12. Hello guys,

     

    Everything works like a charm now.

     

    When you encounter an assembly loading problem,

    consider using the Assembly Binding Log Viewer

    tool that comes with the .NET Framework

    (fuslogvw.exe) to determine which dependency

    failed to load and why.

     

    Here what I did:

    - compile without /clr option (not sure if this could be a potential issue...)

    - link with /fixed:no additional switch.

    - put all other DLLs in my McamX2 directory (Thanks Roger to pointing this out !!! The DLLs was properly referenced but wasn't placed in the proper directory).

     

    Thanks Roger again for answering !

     

    --Titus

  13. Hello,

     

    When I'm trying to load the C-Hook, I'm getting the error message "Could not load file or assembly <...> or one of its dependencies. The module was expected to contain an assembly manifest."

     

    After clicking on "Ok" again, another messagebox "The appropriate Mastercam .NET Support dll could not be found" is popping up

     

    Commenting out that line of code afterwards everything goes well again...

     

    Thanks a lot for your assistance!

     

    --Titus

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...