Click here to Skip to main content
15,913,055 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
Nish Nishant6-May-06 2:12
sitebuilderNish Nishant6-May-06 2:12 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
ThatsAlok16-May-06 2:51
ThatsAlok16-May-06 2:51 
GeneralRe: Microsoft is looking for potential C++ MVPs Pin
Nish Nishant16-May-06 13:34
sitebuilderNish Nishant16-May-06 13:34 
QuestionConverting String to a Shortcut in MC++ Pin
rob knaack4-May-06 12:38
rob knaack4-May-06 12:38 
AnswerRe: Converting String to a Shortcut in MC++ Pin
George L. Jackson5-May-06 6:37
George L. Jackson5-May-06 6:37 
GeneralRe: Converting String to a Shortcut in MC++ Pin
rob knaack5-May-06 9:00
rob knaack5-May-06 9:00 
QuestionWIA 1.0 Pin
allenmpcx4-May-06 11:56
allenmpcx4-May-06 11:56 
QuestionNewbie: Using a com object in VC 7.1 Pin
ebruinsma4-May-06 4:04
ebruinsma4-May-06 4:04 
Hello,

After trying to figure this out for days, and getting more and more frustrated, I decided that I need some help with my problem.

I'm working in Microsoft Visual C++ .NET version 2003 Standard, an just learnt from posting in the Visual C++ forum that I'm using managed C++, so I'm reposting my question in this forum.

My problem is this, I'm trying to create a webservice that allows me to run Java scripts in an Adobe InDesign instance. I've got sample code of how someone else created it in Visual Basic, but I've only got visual c++ v7.1 (bought it for an InDesign plugin Project, wich we're not going to do because it's just to complicated, and the Javascript seems to be enough for our needs)

Seeing that the only code that he needed to insert himself is about 8 lines, and the rest was automaticly generated by starting a new webservice project, I foolishly thought that it shouldn't be that hard to recreate that functionality into c++.

Creating the webservice was that easy indeed, you even got a "hello world" without even coding a single line.

The VB I want to recreate is:

Public Function DoScript(ByVal script As String) As String<br />
Try<br />
Dim ind As InDesign.Application<br />
ind = CreateObject("InDesign.Application.CS2", "localhost")<br />
Dim x As String = ind.DoScript(script, InDesign.idScriptLanguage.idJavascript)<br />
Return x<br />
Catch ex As Exception<br />
Return "An error occurred: " & ex.Message<br />
End Try<br />
End Function


I found this article on this site and used it as a lead.
http://www.codeproject.com/Purgatory/Adobe_InDesign_COM_object.asp[^]

So I started by adding a reference to the InDesign com object to my project, and as far as I can see that was succesful.
But when I want to compile the following code, I get the following error message:


#include "stdafx.h"<br />
#include "InDesignCS2Class.h"<br />
#include "Global.asax.h"

//using namespace Interop::InDesign;

namespace InDesignCS2<br />
{<br />
String* InDesignCS2Class::RunScript(String* script)<br />
{

// create an InDesign instance
InDesign.Application app = (InDesign.Application) COMCreateObject("InDesign.Application");
// get a reference to the current active document
//InDesign.Document doc = app.ActiveDocument;

// get the first page
//InDesign.Page page = (InDesign.Page) doc.Pages[1]; //1e pagina

// get the first textframe
//InDesign.TextFrame frame = (InDesign.TextFrame) page.TextFrames[1];

// write contents of textframe
//Console.WriteLine(frame.Contents.ToString());

// set contents of textframe
//frame.Contents = "Andere content";

return script;<br />
}<br />
};


error C2065: 'InDesign' : undeclared identifier


Can anyone please tell me what I'm doing wrong, or what I've forgotten to do.

TIA,

Erik Bruinsma
AnswerRe: Newbie: Using a com object in VC 7.1 Pin
georgeraafat4-May-06 15:00
georgeraafat4-May-06 15:00 
GeneralRe: Newbie: Using a com object in VC 7.1 Pin
ebruinsma5-May-06 3:01
ebruinsma5-May-06 3:01 
GeneralRe: Newbie: Using a com object in VC 7.1 Pin
georgeraafat5-May-06 6:18
georgeraafat5-May-06 6:18 
AnswerRe: Newbie: Using a com object in VC 7.1 Pin
toxcct5-May-06 3:14
toxcct5-May-06 3:14 
GeneralRe: Newbie: Using a com object in VC 7.1 Pin
ebruinsma5-May-06 3:28
ebruinsma5-May-06 3:28 
Questionnesting, looping, triangle Pin
Charles Reese3-May-06 8:04
Charles Reese3-May-06 8:04 
AnswerRe: nesting, looping, triangle Pin
Saksida Bojan3-May-06 19:54
Saksida Bojan3-May-06 19:54 
Questionnesting, looping, triangle Pin
Charles Reese3-May-06 8:03
Charles Reese3-May-06 8:03 
Question[urgent newbie] input streams problem with .NET Pin
kkyeung3-May-06 6:46
kkyeung3-May-06 6:46 
AnswerRe: [urgent newbie] input streams problem with .NET Pin
Saksida Bojan3-May-06 20:26
Saksida Bojan3-May-06 20:26 
GeneralRe: [urgent newbie] input streams problem with .NET Pin
kkyeung4-May-06 8:38
kkyeung4-May-06 8:38 
GeneralRe: [urgent newbie] input streams problem with .NET Pin
Saksida Bojan4-May-06 9:31
Saksida Bojan4-May-06 9:31 
QuestionExpose VC++ .Net function to VB .Net Pin
ppanke3-May-06 4:50
ppanke3-May-06 4:50 
AnswerRe: Expose VC++ .Net function to VB .Net Pin
Milton Karimbekallil3-May-06 8:46
Milton Karimbekallil3-May-06 8:46 
GeneralRe: Expose VC++ .Net function to VB .Net Pin
ppanke10-May-06 4:15
ppanke10-May-06 4:15 
GeneralRe: Expose VC++ .Net function to VB .Net Pin
Milton Karimbekallil10-May-06 16:23
Milton Karimbekallil10-May-06 16:23 
QuestionHow to use timeSetEvent in C++/CLI Pin
attias gabi30-Apr-06 20:55
attias gabi30-Apr-06 20:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.