Highlighted

Error in Visual studio 2015 for C++ project

Explorer ,
Jun 01, 2020

Copy link to clipboard

Copied

Hi,

Can someone guide me to solve this problem.

 

InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
int32 PMString::GetAsNumber(this,importScript);
importScript.Append("var MD2 = app.activeDocument;");
importScript.Append("var PN = MD2.pages.length;");
//importScript.Append("alert(PN);");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
Utils<IScriptArgs>()->Clear();

After adding this code I have an error I don't know how to resolve this error. Please guide me.

error C2761: 'int32 PMString::GetAsNumber(PMString::ConversionError *,CharCounter *) const': member function redeclaration not allowed

Nithu
TOPICS
How to, Scripting, SDK

Views

254

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Error in Visual studio 2015 for C++ project

Explorer ,
Jun 01, 2020

Copy link to clipboard

Copied

Hi,

Can someone guide me to solve this problem.

 

InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importScript;
int32 PMString::GetAsNumber(this,importScript);
importScript.Append("var MD2 = app.activeDocument;");
importScript.Append("var PN = MD2.pages.length;");
//importScript.Append("alert(PN);");
PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importScript);
Utils<IScriptArgs>()->Clear();

After adding this code I have an error I don't know how to resolve this error. Please guide me.

error C2761: 'int32 PMString::GetAsNumber(PMString::ConversionError *,CharCounter *) const': member function redeclaration not allowed

Nithu
TOPICS
How to, Scripting, SDK

Views

255

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 01, 2020 0
Adobe Community Professional ,
Jun 01, 2020

Copy link to clipboard

Copied

Quoting the code you have written below

int32 PMString::GetAsNumber(this,importScript);

Does this look alright to you? Is this the way methods are called, there are errors at multiple levels. I would suggest you should seriously consider taking a course in basic programming. For now look into the following things and resolve the issues yourself if you want to understand what you write

  • Difference btw method decleration and definition
  • What are objects, classes
  • What are member functions

 

P.S. :- This has nothing whatsoever to do with VS

 

-Manan

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 01, 2020 1