User (Legacy) Posted July 31, 2003 Report Posted July 31, 2003 I have a ChartFX program built in C++. I just started changing around some of the displayed options on a right-click pop-up menu. But now that I've removed some of these option, I get a weird runtime error R6025 - pure virtual function call Anybody seen this before?
Software FX Posted July 31, 2003 Report Posted July 31, 2003 Can you specify which options you changed or send us a small app that reproduces this behavior ? -- Regards, JC Software FX Support "NssOne" <none@none.com> wrote in message news:Algx733VDHA.1484@WEBSERVER1... > I have a ChartFX program built in C++. I just started changing around some > of the displayed options on a right-click pop-up menu. But now that I've > removed some of these option, I get a weird runtime error > > R6025 > - pure virtual function call > > Anybody seen this before? > >
User (Legacy) Posted July 31, 2003 Author Report Posted July 31, 2003 Here's a snippet of my code that I rearranged. ICommandBarPtr pCmdBar; ICommandItem *pCmdItem; // Get a reference to the command bar pCmdBar = m_pChartFX->GetCommands(); // Remove 1st & 2nd commands from the background popup menu // NOTE: The index will change every time a command is added or removed. pCmdBar->get_Item(CFX_ID_CM_BACKGROUND, &pCmdItem); pCmdItem->RemoveSubCommand(9); pCmdItem->RemoveSubCommand(8); pCmdItem->RemoveSubCommand(7); pCmdItem->RemoveSubCommand(6); pCmdItem->RemoveSubCommand(5); pCmdItem->RemoveSubCommand(4); pCmdItem->RemoveSubCommand(3); pCmdItem->RemoveSubCommand(2); pCmdItem->RemoveSubCommand(1); pCmdItem->RemoveSubCommand(0); pCmdItem->Release(); pCmdBar->Release(); Everything else in my code was the same until I changed those setting around. The program did not give me any errors before implementing those settings into the code. "SoftwareFX Support" <support@softwarefx.com> wrote in message news:DDiRzu4VDHA.228@WEBSERVER1... > Can you specify which options you changed or send us a small app that > reproduces this behavior ? > > -- > Regards, > > JC > Software FX Support
Software FX Posted August 6, 2003 Report Posted August 6, 2003 The problem: pCmdBar->Release(); pCmdBar is a Smart pointer ( ICommandBarPtr ) which will be released automatically when the object is destroyed. By directly releasing that object you are causing the error. You must do: pCmdBar.Release(); Or nothing at all. -- FP Software FX, Inc.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.