Error 1 error C3861: 'MustSwitchTo_acedCmdC_or_acedCmdS': identifier not found

Error 1 error C3861: 'MustSwitchTo_acedCmdC_or_acedCmdS': identifier not found

DWhiteley
Advisor Advisor
1,227 Views
3 Replies
Message 1 of 4

Error 1 error C3861: 'MustSwitchTo_acedCmdC_or_acedCmdS': identifier not found

DWhiteley
Advisor
Advisor

Hi,

 

I'm programming with C++ (VS 2012) using ObjectARX 2016

 

I have a line:-      if (ads_cmd(rbCommandList) != RTNORM) {......

 

The ads_cmd gives the following error:

 

Error 1 error C3861: 'MustSwitchTo_acedCmdC_or_acedCmdS': identifier not found 

 

I see that this is defined in adsmigr.h as:-

#define ads_cmd MustSwitchTo_acedCmdC_or_acedCmdS

 

How do I correct this error?

 

 

Many thanks in advance,

 

Dave

0 Likes
Accepted solutions (1)
1,228 Views
3 Replies
Replies (3)
Message 2 of 4

tbrammer
Advisor
Advisor
Accepted solution

ads_cmd() is defined in adsmigr.h.

Until ARX2014 it was defined as acedCmd().

Starting with ARX2015 AutoCAD switched over to "fiberless operation".

Due to this breaking change acedCmd() must be replaced bei either acedCmdS() or acedCmdC().

The same change applies for ads_command() / acedCommand().

Please read the docs about "fiberless operation".

 

I would recomment to avoid acedCmd*() / acedCmd*() whereever possible.

If you are lucky you can use the "S-type" functions. The usage of the "C-type" functions is horrible.

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 4

DWhiteley
Advisor
Advisor
Many thanks for your help.





Dave



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
0 Likes
Message 4 of 4

Anonymous
Not applicable

Hello,

 

I have had the same problem, and with the help of the arx's migration guide, I could see that I have to change acedCmd for (acedCmdS/acedCmdC).

 

I have began changing them for acedCmdS, but I am having an error with the command "Break" when I want to break a line. This is my code:

 

ads_name NameSegment;

VOK(acdbGetAdsName(NameSegment, GetObjectID()));

ads_point PointBreakNode={BreakPoint.x, BreakPoint.y, 0};

 

//create break command

struct resbuf* pCommand = acutBuildList(

RTSTR, L"_.BREAK",

RTENAME, NameSegment,

RTPOINT,PointBreakNode,

RTNONE);

ALLOW_NEXT_COMMAND;

//int nResult=acedCmd(pCommand); //My old code

int nResult = acedCmdS(pCommand);//My new code

 

The message error is the following:

 

"Exception thrown at 0x000007FED35F1157 (accore.dll) in acad.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

If there is a handler for this exception, the program may be safely continued."

 

If anyone have experimented a similar situation and could give me any clue to solve it, I will be thankful.

 

0 Likes