|
-
Aug 4th, 2012, 01:27 AM
#1
Thread Starter
New Member
Expected ; or =(cannot specify constructor arguments in declaration)
hi,
I've been trying to work on NXopen(NX is a cad software). I'm using c# codes for that. For opening a new file in NX this is the syntax which has been given
int UF_PART_new
(
const char * part_name,
int units,
tag_t * part
)
This is the code I made in Visual Studio
//TODO: Add your application code here
const char *part_name=@"D:\\rahul\\assignments\\extrude1.prt";
tag_t part= NULL_TAG;
int units=1;
int UF_PART_new(part_name,units,&part)
Now I'm getting errors like
Expected ; or =(cannot specify constructor arguments in declaration)
; expected
both are on "int UF_PART_new(part_name,units,&part)" line. Please someone help me on this.
-
Aug 4th, 2012, 10:06 AM
#2
Re: Expected ; or =(cannot specify constructor arguments in declaration)
You say you're using C#, but the code you have is C++ - unless you're intending to use unsafe C# code, which usually isn't necessary.
The C# code would be:
Code:
string part_name=@"D:\\rahul\\assignments\\extrude1.prt";
tag_t part= NULL_TAG;
int units=1;
int test = UF_PART_new(part_name, units, part);
For C++ code or unsafe C# code, I think all you're missing is that you either need:
Code:
int test = UF_PART_new(part_name, units, &part); //use return value
or:
Code:
UF_PART_new(part_name, units, &part); //ignore return value
Last edited by David Anton; Aug 4th, 2012 at 01:34 PM.
-
Aug 5th, 2012, 02:23 AM
#3
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|