Click here to Skip to main content
15,897,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: converting TCHAR to LPVOID Pin
Blake Miller25-May-04 15:11
Blake Miller25-May-04 15:11 
GeneralSetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
caykahve24-May-04 6:01
caykahve24-May-04 6:01 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
jmkhael24-May-04 6:19
jmkhael24-May-04 6:19 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
caykahve24-May-04 21:32
caykahve24-May-04 21:32 
GeneralRe: SetWindowsHookEx, SC_SCREENSAVE and mouse moves Pin
jmkhael24-May-04 22:41
jmkhael24-May-04 22:41 
GeneralProblem adding ActiveX to an MFC DLL Pin
Aviv Halperin24-May-04 5:58
Aviv Halperin24-May-04 5:58 
GeneralRe: Problem adding ActiveX to an MFC DLL Pin
igor196024-May-04 8:36
igor196024-May-04 8:36 
GeneralExcel 97 Automation Pin
act_x24-May-04 4:35
act_x24-May-04 4:35 
I was writing some code to export some data to an Excel chart.
Here's a snippet of the code that is intended to add Sheets to a workbook .
From my apps point of view everything is ok , But when I exit or leave Excel without saving this file I get a MessageBox with a Memory Error . I was wondering if u'd have some suggestions . I am including "excel8.h" in my code. Thanks

COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_Application app;
Workbooks books;
_Workbook book;
Worksheets sheets;
_Worksheet sheet;
Range range;
Font font;
Range cols;
CStatusDialog statusDialog;

Interior interior;
int sheetIndex = 0 ;
int cycleStepCount=0;
string data;
char *p;
char c[20];

statusDialog.Create(IDD_DIALOG6,(CWnd*)this);
statusDialog.ShowWindow(SW_SHOW);
statusDialog.CenterWindow();

if(cyclePt.cycleCount){
// Start Excel and get Application object.
if(!app.CreateDispatch("Excel.Application")) {
AfxMessageBox("Couldn't start Excel and get Application object.");
statusDialog.ShowWindow(SW_HIDE);
return;
}
//Get a new workbook.
books = app.GetWorkbooks();
book = books.Add(covOptional);

//Get the first sheet.
sheets =book.GetSheets();

int ct=0;
if(cyclePt.cycleCount<=3)
ct =0;
else
ct = cyclePt.cycleCount-3;
// Excel Does seem to crash when I do this
if(ct)
sheets.Add(covOptional,covOptional,COleVariant((long)ct),covOptional);

app.SetVisible(TRUE);
app.SetUserControl(TRUE);
return ;
GeneralHTMLDocument and scripts Pin
Aggtaa24-May-04 4:11
Aggtaa24-May-04 4:11 
GeneralQuestions about Unicode Pin
Xiangyang Liu 刘向阳24-May-04 2:58
Xiangyang Liu 刘向阳24-May-04 2:58 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani24-May-04 4:21
professionalRavi Bhavnani24-May-04 4:21 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳24-May-04 4:31
Xiangyang Liu 刘向阳24-May-04 4:31 
GeneralRe: Questions about Unicode Pin
wb24-May-04 4:59
wb24-May-04 4:59 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳25-May-04 1:20
Xiangyang Liu 刘向阳25-May-04 1:20 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani24-May-04 9:04
professionalRavi Bhavnani24-May-04 9:04 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳25-May-04 1:19
Xiangyang Liu 刘向阳25-May-04 1:19 
GeneralRe: Questions about Unicode Pin
Ravi Bhavnani25-May-04 1:21
professionalRavi Bhavnani25-May-04 1:21 
GeneralRe: Questions about Unicode Pin
Michael Dunn24-May-04 11:05
sitebuilderMichael Dunn24-May-04 11:05 
GeneralRe: Questions about Unicode Pin
Xiangyang Liu 刘向阳24-May-04 16:18
Xiangyang Liu 刘向阳24-May-04 16:18 
GeneralProblem unsolved Pin
Xiangyang Liu 刘向阳25-May-04 1:18
Xiangyang Liu 刘向阳25-May-04 1:18 
GeneralRe: Problem unsolved Pin
Blake Miller25-May-04 15:16
Blake Miller25-May-04 15:16 
GeneralBorland C++ Starter Pin
Rilliams24-May-04 2:34
Rilliams24-May-04 2:34 
GeneralRe: Borland C++ Starter Pin
Prakash Nadar24-May-04 6:05
Prakash Nadar24-May-04 6:05 
GeneralCalendar outlook style Pin
dlocarnini24-May-04 1:34
dlocarnini24-May-04 1:34 
GeneralRe: Calendar outlook style Pin
bouli24-May-04 1:39
bouli24-May-04 1:39 

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.