Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to stop a .exe? ADDENDUM Pin
ThatsAlok20-Oct-09 21:52
ThatsAlok20-Oct-09 21:52 
GeneralRe: how to stop a .exe? ADDENDUM Pin
Richard MacCutchan21-Oct-09 2:21
mveRichard MacCutchan21-Oct-09 2:21 
Questiondll for project Pin
MA Awan20-Oct-09 18:54
MA Awan20-Oct-09 18:54 
AnswerRe: dll for project Pin
Cedric Moonen20-Oct-09 20:17
Cedric Moonen20-Oct-09 20:17 
GeneralRe: dll for project Pin
Richard MacCutchan21-Oct-09 0:20
mveRichard MacCutchan21-Oct-09 0:20 
AnswerRe: dll for project Pin
CPallini20-Oct-09 20:29
mveCPallini20-Oct-09 20:29 
AnswerRe: dll for project Pin
Rajesh R Subramanian20-Oct-09 20:32
professionalRajesh R Subramanian20-Oct-09 20:32 
QuestionException: This may be due to a corruption of the heap, which indicates a bug in WBEventsSheetCalculate.exe or any of the DLLs it has loaded. Pin
NarVish20-Oct-09 18:40
NarVish20-Oct-09 18:40 
I'm getting the below exception and code given below.
Exception : "Windows has triggered a breakpoint in WBEventsSheetCalculate.exe.
This may be due to a corruption of the heap, which indicates a bug in WBEventsSheetCalculate.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while WBEventsSheetCalculate.exe has focus.
The output window may have more diagnostic information."
Any help is appreciated. Thanks in advance.

Excel::_ApplicationPtr xl;
Excel::WorkbooksPtr bookPtr;

class ExcelBookEventHandler : public IDispEventSimpleImpl<1, ExcelBookEventHandler, &__uuidof(Excel::WorkbookEvents)>;
{
BEGIN_SINK_MAP(ExcelBookEventHandler)
SINK_ENTRY_INFO(1, __uuidof(Excel::WorkbookEvents), 0x0000061b, &ExcelBookEventHandler::SheetCalculate, &SheetCalculateInfo)
END_SINK_MAP()
void _stdcall SheetCalculate(IDispatch *pDisp)
{}
}
std::vector<excelbookeventhandler> bookHandler;

class ExcelAppEventHandler : public IDispEventSimpleImpl<1, ExcelAppEventHandler, &__uuidof(Excel::AppEvents)>
{
public:
ExcelAppEventHandler(bool& doneFlag) : done_(doneFlag)
{
done_ = false;
}

// The sink map maps event handler functions to the events they handle
BEGIN_SINK_MAP(ExcelAppEventHandler)
SINK_ENTRY_INFO(1, __uuidof(Excel::AppEvents), 0x0000061f, &ExcelAppEventHandler::WorkbookOpen, &WorkbookOpenInfo)
END_SINK_MAP()

// When I create new excel workbook, this event gets fired.
void _stdcall WorkbookOpen(Excel::_Workbook *book)
{
ExcelBookEventHandler calc;
bookHandler.push_back(calc);
int val = xl->Workbooks->Count;
bookHandler[val-1].DispEventAdvise(book);
cout<<"Inside Workbook Open";
}// here, I'm getting the exception

int _tmain(int argc, _TCHAR* argv[])
{
CoInitializeEx(0, COINIT_MULTITHREADED);
{
if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
{
bookPtr = xl->Workbooks;
if(bookPtr)
{
bool flag=true;
BookCount = bookPtr->Count;
for(int i=1 ; i<=BookCount ; i++)
{
BookName = bookPtr->Item[i]->Name;
ExcelBookEventHandler calc;
bookHandler.push_back(calc);
}
}
}
for (int i=1 ; i<=BookCount ; i++)
{
bookHandler[i-1].DispEventAdvise(xl->Workbooks->Item[i]);
}
ExcelAppEventHandler handler(done);
if(SUCCEEDED(handler.DispEventAdvise(xl)))
{}
}
CoUninitialize();
return 0;
}
QuestionRe: Exception: This may be due to a corruption of the heap, which indicates a bug in WBEventsSheetCalculate.exe or any of the DLLs it has loaded. Pin
Roger Stoltz21-Oct-09 2:53
Roger Stoltz21-Oct-09 2:53 
QuestionNeed help for CStdioFile/CFile [modified] Pin
Nicholas Amh20-Oct-09 17:35
Nicholas Amh20-Oct-09 17:35 
AnswerRe: Need help for CStdioFile/CFile Pin
Naveen20-Oct-09 17:55
Naveen20-Oct-09 17:55 
GeneralRe: Need help for CStdioFile/CFile Pin
Nicholas Amh20-Oct-09 19:10
Nicholas Amh20-Oct-09 19:10 
QuestionRe: Need help for CStdioFile/CFile Pin
Randor 20-Oct-09 19:23
professional Randor 20-Oct-09 19:23 
AnswerRe: Need help for CStdioFile/CFile Pin
Nicholas Amh20-Oct-09 19:44
Nicholas Amh20-Oct-09 19:44 
GeneralRe: Need help for CStdioFile/CFile Pin
Randor 20-Oct-09 21:08
professional Randor 20-Oct-09 21:08 
AnswerRe: Need help for CStdioFile/CFile Pin
Adam Roderick J20-Oct-09 20:23
Adam Roderick J20-Oct-09 20:23 
GeneralRe: Need help for CStdioFile/CFile Pin
Nicholas Amh20-Oct-09 20:59
Nicholas Amh20-Oct-09 20:59 
GeneralRe: Need help for CStdioFile/CFile Pin
Richard MacCutchan21-Oct-09 2:33
mveRichard MacCutchan21-Oct-09 2:33 
QuestionWhen is a CWnd ready to receive messages Pin
ForNow20-Oct-09 16:14
ForNow20-Oct-09 16:14 
AnswerRe: When is a CWnd ready to receive messages Pin
Naveen20-Oct-09 18:12
Naveen20-Oct-09 18:12 
GeneralRe: When is a CWnd ready to receive messages Pin
ForNow20-Oct-09 18:19
ForNow20-Oct-09 18:19 
GeneralRe: When is a CWnd ready to receive messages Pin
Naveen20-Oct-09 18:29
Naveen20-Oct-09 18:29 
GeneralRe: When is a CWnd ready to receive messages Pin
ForNow20-Oct-09 18:39
ForNow20-Oct-09 18:39 
GeneralRe: When is a CWnd ready to receive messages Pin
Naveen20-Oct-09 18:43
Naveen20-Oct-09 18:43 
GeneralRe: When is a CWnd ready to receive messages Pin
ForNow20-Oct-09 18:54
ForNow20-Oct-09 18:54 

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.