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:

markov

Verified Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by markov

  1. You are picky, aren't you! I asked the same question last year, and here is the answer .
  2. 1. I have not seen this problem, it works for me. May be some programming error on your side. 2. I think this is what you need. 3. I disabled it by toggling some option (I am not at my computer to tell you which one exactly), you can set it up to automatically name the NC file.
  3. Are you saying that Mastercam does not start no matter what you press on that dialog box? If I remember correctly, it asks if you still want to continue debugging even though the executable does not have debug information. If you answer that you want to go on, it should start Mastercam and let you start your C-hook. If you put a break point in it, it will stop then. If this is not happening, I do not know what else to suggest.
  4. I do not remember if I got the same message, but in any case it does not matter, you are not going to debug mastercam itself anyway.
  5. Only if you want to assume the risk! See my post above, you may have problems with C/C++ runtime calls. See also the other thread (link is in the post) where I suggested a way to work around it (I have not tried the trick myself).
  6. CaKiwi, using "wrong" Mastercam SDK and compiler can cause unpredictable behaviour - look at this problem. In short, with the mismatched Mastercam SDK, those functions may fail. With the mismatched compiler, C/C++ runtime calls may fail.
  7. quote: Thanks for your help, but I'm not sure what changed.A lot, namely the compiler and more importantly the header files! What was happening here is that you were (indirectly) using structure declarations from one version of the header files to access code (in the runtime DLL) that was compiled with a different version of the header files and different compiler.
  8. But you do not need MFC for you simple program that just opens a file. In any case it is irrelevant now that you have VS2005. If my theory was correct, the C-hook will be able to open that file now.
  9. Thanks Pete, I shall have it in mind for a future project. I ended up creating an MCX file for each character and then importing them into existing geometry as required. Marko
  10. OK, you found the right place. Select "Multi-threaded (/MT)" and check if it works.
  11. No, I have not. I was not even aware of it, I am going to try it today. But I tried in the past to call getcwd() C runtime function, and found that Mastercam sometimes changes its current directory so I could not rely on that value. I hope that current_dir is constant.
  12. Is there a reliable way to determine Mastercam installation directory from a C-hook?
  13. Somewhere in the project properties (I am not at my computer now so I can not check) there is an option to select the runtime library. If it does not use a variation of the word "static", then it probably says "libcmt.lib". Note that it is not advisable to run in the multiple runtime environments (which is what you are going to end up with if you statically link you C-hook) even if it appears to work (you may discover subtle problems later), but you probably do not have an option.
  14. The sample from MSDN should work. I have another idea. Are you by any chance compiling with VS2003, and creating C-hook for X2? If that is the case, you have a "complicated" C-hook, as described in the other thread. There may be a chance it would still work if you link it statically to the C runtime.
  15. I found the problem: I used RegGetValue function available only on Vista.
  16. errno is just an integer variable (or a macro that results in the _errno() function call) and gives you the error code of the last C runtime function call that failed. GetLastError() is a Win32 API that gives you the error code of the last failed system call. Just print the errors, probably using a MessageBox call, with something like this: code: MessageBox(..., strerror(errno), ...); char s[100]; FormatMessage(..., GetLastError(), ... , s, ...); MessageBox(..., s, ..);
  17. Text mode is the default, does not need to be explicitly specified. And from what I undestand, the problem is in fopen function returning NULL before any read happens, so I do not think this would help.
  18. What is assembly manifest? I assume it is related to .NET programming which I do not know anything about. I created a C-hook which fails to run with the following message: quote: Unhandled Exception: System.BadImageFormatException Could not load file or assembly 'file:///C:MCAMX2...' or one of its dependencies. The module is expected to contain an assembly manifest. I am quite sure that the "dependency" here is system DLL "ADVAPI32.DLL", which got linked in when I tried to use registry functions. They do not have to be called, just their presence causes DLL load to fail. So, do I have to kiss those functions goodbye, or is there still some hope for me?
  19. Stupid question, but have you checked that the file exists in that location? Check the errno value, it may give you some indication. Also, see what GetLastError() returns as another source of information.
  20. Yes, mine is working with VS2003. When did yours stop working?
  21. Are you saying that your wizard for VS2003 is not working any more (does not create a project)? In that case, I do not have any suggestions.
  22. The error you are getting is a result of the wrong SDK you are using. Depending on you C-hook, you may or may not be able to use VS2003. The more complicated it is, the less likely it is to work. "Complicated" here means using many C/C++ library functions (this includes MFC).
  23. The main difference from the C-hook development perspective is the lack of MFC in the Express edition.

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