🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #575

Question about ICmdHistory...

#575
From: Kamrun
Date: Tue, 06 Jan 2009 20:54
28 lines
1670 bytes
I'm trying to get access to CmdHistory's Undo() method, and InterfacePtr returns nil, I searched through archive, didn't find anything but in header file of ICmdHistory.h says :
"There is only one global CmdHistory. In order to use it you have
to specify the target (ICommandMgr) you are interested in "

I have some snippet of the code here:

InterfacePtr<IWorkspace> ws(GetExecutionContextSession()->QueryWorkspace());
if(ws == nil) {
   break;
}

InterfacePtr<ICommandMgr> cmdMgr(ws, IID_ICOMMANDMGR);
if(cmdMgr == nil) {
     break;
}
InterfacePtr<ICmdHistory>	cmdHistory(cmdMgr, UseDefaultIID());
f(cmdHistory == nil) {
     break;
}
cmdHistory returns nil

I also tried passing with document's UIDRef instead of cmdMgr, didn't help either.
What i'm trying to do is, I want to Undo my last command (used CmdUtils::CreateCommand() to do some actions ) programmatically, now the Undo under edit menu works fine in GUI, I want to be able to do it through the CmdHistroy->Undo(). Do I have any other option to undo the result of my last command ?

Any help greatly appreciated.

Thanks,
Kamran
Technical Details
Message-ID: <59b77104.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!goblin1!goblin2!goblin.stu.neva.ru!news4us.nl!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f63e9,d29530f60f5d82e2,start
X-Google-Attributes: gidf63e9,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Kamrun@adobeforums.com
Newsgroups: adobe.indesign.sdk
Subject: Question about ICmdHistory...
Message-ID: <59b77104.-1@webcrossing.la2eafNXanI>
Date: Tue, 6 Jan 2009 12:54:42 -0800
Lines: 36
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!goblin1!goblin2!goblin.stu.neva.ru!news4us.nl!webcrossing