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:

Errors when open example c++


Recommended Posts

31 minutes ago, eltklas said:

Does anyone know how to solve this problem?

I have tried with VS2019 and VS2022 and there are a lot of errors.

Thanks for your help.

Visual Studio cannot locate the specified header files.

Have you successfully run other chooks before? Do you have the 2023 sdk installed? Is there any other errors before or after all the E1696 errors?

  • Thanks 1
Link to comment
Share on other sites

I was programming he c# chooks, and all ok.

I instaled sdk Mastercam 2023, but I dont know indicate where is it to the VS.

In VS 2019 there are thousands of errors

Help me please.

Is my first Time with C++ proyects

Thanks

image.thumb.png.2dd58161280f17d1222d1c97f2c53dc6.png

Link to comment
Share on other sites
12 minutes ago, eltklas said:

I was programming he c# chooks, and all ok.

I instaled sdk Mastercam 2023, but I dont know indicate where is it to the VS.

In VS 2019 there are thousands of errors

Help me please.

Is my first Time with C++ proyects

Thanks

 

It looks like you downloaded the Create Letters sample from my.mastercam.com. I downloaded this file and everything linked up fine for me. So the file should automatically find the sdk. If you want to double check, the path to the sdk is in Property Sheets > MastercamSDK.props > <SDKDir>.

Looking at the header files VS can't find, it looks like you might not have MFC installed.

To install MFC

1. Open "Visual Studio Installer"

2. on whichever version of VS you're using click "Modify"

3. Ensure "Desktop development with C++" is checked

4. in the sidebar go to "Desktop development with C++" > Optional > and ensure "C++ MFC for latest v143 build tools" is checked

5. if it is not checked, check it and click "Modify" in the bottom right

 

  • Thanks 1
Link to comment
Share on other sites

After follow your instructions the errors ar ok. But I dont Know what is the problem with the new errors. The folders are correct, but it doesnt work. The vs app is in administrator mode. How can I fix the new errors?

Thanks for your help

 

image.png.b741842b56df040831c75307a84e839a.png

Link to comment
Share on other sites
8 hours ago, eltklas said:

After follow your instructions the errors ar ok. But I dont Know what is the problem with the new errors. The folders are correct, but it doesnt work. The vs app is in administrator mode. How can I fix the new errors?

Thanks for your help

 

image.png.b741842b56df040831c75307a84e839a.png

The most common reason that error is thrown is because you have Mastercam open. When you build a project, if you have Mastercam open VS can't access the folder to copy the dll file into

  • Thanks 1
Link to comment
Share on other sites
23 minutes ago, eltklas said:

With the app Mastercam 2023 Closed The errors are the same. The Paths are in "MastercamSDK.props" and they are correct.

Thanks

Maybe try running VS not in admin mode? I remember having some weird errors with admin mode a while back so I turned it off and haven't had an issue since.
 

As a work around you can disable the post build - right click on the project in VS > Properties > Post-Build Event > Build Events > Use In Build < turn this off and the error should go away. The post Post Build bat file just copies the dll from where it's created (with the solution) to the Mastercam Add-Ins folder

  • Thanks 1
Link to comment
Share on other sites
20 hours ago, eltklas said:

I know we can use C++ libraries in C#. If I want to create a chain offset is it possible on C#? OR Do I have to use C++ for that? Can you help me?. Thanks

Someone else will have to take this one. I've done very little work in C#

  • Thanks 1
Link to comment
Share on other sites
On 4/14/2024 at 12:19 PM, eltklas said:

I know we can use C++ libraries in C#. If I want to create a chain offset is it possible on C#? OR Do I have to use C++ for that? Can you help me?. Thanks

Yes, you can use c++ libraries in c#, however you must compile the dll using c++/cli

You can use this project

Mastercam C++/CLI New Project Template VS 2022 - Visual Studio Marketplace

  • Thanks 1
Link to comment
Share on other sites
8 hours ago, eltklas said:
I think I understand that it is a mixture of C# and C++. is it like that? Can Windows Forms be added to it? How can I start them? thanks for your help

Yes, C++/CLI is the .NET Version of C++ that can be consumed at the c# level You can add a Winform to the C# Project by choosing add new item and choosing a new winform, you need to right click on references and click add reference and select System.Windows.Forms first

  • Thanks 1
Link to comment
Share on other sites
On 4/27/2024 at 1:37 AM, eltklas said:

I never used C++, sorry if I ask a lot.

I have already added the reference and the windows form.

Could you tell me how I show it?

my code works in C#

//creamos la copia del formulario
FrmOffset FrmOF = new FrmOffset();
//hacemos dialog
FrmOF.ShowDialog();

Thanks

 

System.Windows.Forms.Application.Run(FrmOF);

  • Thanks 1
Link to comment
Share on other sites

I have added the reference for winforms, but I have errors when  I try to show It. Can you write to me an example code for show a windows form?, and where I have to put that code?.

In C# is easiest for me. I don't know C++.

Thanks

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