Thread View: adobe.indesign.sdk
3 messages
3 total messages
Started by David_HOEUNG
Wed, 14 Jan 2009 17:39
Problem with kDuplicateCmdBoss
Author: David_HOEUNG
Date: Wed, 14 Jan 2009 17:39
Date: Wed, 14 Jan 2009 17:39
31 lines
1440 bytes
1440 bytes
Hi,
I have the following problem :
After duplicated an item with kDuplicateCmdBoss, any action on my document cause crash of ID (not protective shutdown).
This is the "duplicate" function code:
UIDList list(item);
UIDRef RefReturn = UIDRef::gNull;
InterfacePtr<IHierarchy> hierarchy(item, UseDefaultIID());
ASSERT_AND_BREAK_IF_NIL(hierarchy);
UIDRef parent(item.GetDataBase(), hierarchy->GetParentUID());
InterfacePtr<ICommand> dupCmd(CmdUtils::CreateCommand(kDuplicateCmdBoss));
ASSERT_AND_BREAK_IF_NIL(dupCmd);
InterfacePtr<ICopyCmdData> data(dupCmd, UseDefaultIID());
data->Set(dupCmd, &list, parent);
data->SetOffset(PMPoint(0,0));
if (CmdUtils::ProcessCommand(dupCmd) == kSuccess)
{
RefReturn = dupCmd->GetItemList()->GetRef(0);
}
return RefReturn;
What can i do ?
Thanks in advance.
Re: Problem with kDuplicateCmdBoss (IDCS3)
Author: T_Schneider
Date: Fri, 16 Jan 2009 10:39
Date: Fri, 16 Jan 2009 10:39
1 lines
939 bytes
939 bytes
You need to check the global error after the command has executed; ErrorUtils::PMGetGlobalErrorCode();. If this gets set by the command, you will need to clear this first (and something went wrong with your duplication :-)) ..
Re: Problem with kDuplicateCmdBoss (IDCS3)
Author: Jon_Pugh
Date: Thu, 26 Mar 2009 20:49
Date: Thu, 26 Mar 2009 20:49
7 lines
1105 bytes
1105 bytes
Sorry I'm so late on this. Hopefully you've found the answer before now, but I know this problem and thought I would share it. UIDList list(item); ... data->Set(dupCmd, &list, parent); This is passing a pointer to a stack based UIDList. All the copy commands want a pointer to a heap based UIDList that they can free when they are done. This can cause console messages from the memory subsystem as it tries to free a chunk of the stack which doesn't work and can crash.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads