🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #4282

Re: I'd like to write my own descriptor in the Window Title

#4282
From: couzteau
Date: Fri, 25 Jun 2004 10:49
33 lines
1627 bytes
Hello

I have a problem using the command kSetDocNameCmdBoss. The way I use it crashes ID.

I've created a snippet setDocName that runs the following code:
ErrorCode SnpSetDocName::SetDocName(void)

#include "DocumentID.h"

{
	ErrorCode result = kFailure;
	PMString nameString("newName");
	do {
		InterfacePtr<ICommand> cmd( CmdUtils::CreateCommand( kSetDocNameCmdBoss ) ) ;
		InterfacePtr<IStringData> cmdString( cmd, IID_ISTRINGDATA ) ;
		if ( cmd )
		{
			IDocument* doc = Utils<ILayoutUtils>()->GetFrontDocument();
			cmd->SetItemList( UIDList( doc->GetDocWorkSpace() ) );

			cmdString->Set( nameString ) ;
			// About to use nil interface ptr!
			result = CmdUtils::ProcessCommand(cmd);
		}
	} while(false);
	return result;
}

ID crashes on ProcessCommand(). The debug log says "About to use nil interface ptr!" when ProcessCommand is executed. Which pointer is nil?

Thanks for help?

jacques
Technical Details
Message-ID: <3bb43874.2@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!62.253.162.219.MISMATCH!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb43874.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f63e9,a7fcc2416a0ef83e,start
X-Google-Attributes: gidf63e9,public
From: couzteau@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!62.253.162.219.MISMATCH!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.indesign.sdk
Subject: Re: I'd like to write my own descriptor in the Window Title
Message-ID: <3bb43874.2@webx.la2eafNXanI>
Date: Fri, 25 Jun 2004 03:49:01 -0700
References: <3bb43874.-1@webx.la2eafNXanI>
Lines: 36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit