Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: mfc class Pin
Cool_Dev16-Mar-10 20:38
Cool_Dev16-Mar-10 20:38 
GeneralRe: mfc class Pin
trioum17-Mar-10 0:11
trioum17-Mar-10 0:11 
GeneralRe: mfc class [modified] Pin
Cool_Dev17-Mar-10 4:24
Cool_Dev17-Mar-10 4:24 
GeneralRe: mfc class Pin
trioum17-Mar-10 6:22
trioum17-Mar-10 6:22 
GeneralRe: mfc class Pin
Cool_Dev17-Mar-10 19:02
Cool_Dev17-Mar-10 19:02 
GeneralRe: mfc class Pin
trioum17-Mar-10 19:38
trioum17-Mar-10 19:38 
GeneralRe: mfc class Pin
mesajflaviu20-Mar-10 8:16
mesajflaviu20-Mar-10 8:16 
GeneralRe: mfc class Pin
Cool_Dev22-Mar-10 0:07
Cool_Dev22-Mar-10 0:07 
CoInitialize(NULL);

HRESULT hr;
CLSID clsidExcelApp;

// get CLSID of Excel Application
hr = CLSIDFromProgID(L"Excel.Application", &clsidExcelApp);

IUnknown *pUnk = 0;
// get running object that has been registered with OLE.
hr = GetActiveObject(clsidExcelApp, NULL, &pUnk);
if(SUCCEEDED(hr))
{
IDispatch *pDisp = 0;
hr = pUnk->QueryInterface(IID_IDispatch, (void**)&pDisp);

//use class wizard generated excel type lib classes..
CApplication oApp(pDisp);
CWorkbooks oBooks = oApp.get_Workbooks();
CWorkbook oBook = oBooks.get_Item(COleVariant((short)1)); //First workbook
CWorksheets oSheets = oBook.get_Worksheets();
CWorksheet oSheet = oSheets.get_Item(COleVariant((short)1)); //First work sheet
oSheet.Activate();
CRange oRange = oSheet.get_Range(COleVariant(CString(L"A1")), COleVariant(CString(L"A1"))); //cell A1
COleVariant var = oRange.get_Text();

MessageBox(var.bstrVal, L"Text in cell A1");

}

doesn't work? D'Oh! | :doh:
QuestionConvert CString array to System::String Pin
Anu_Bala16-Mar-10 17:23
Anu_Bala16-Mar-10 17:23 
AnswerRe: Convert CString array to System::String Pin
Naveen16-Mar-10 18:11
Naveen16-Mar-10 18:11 
Questionhow to use a html file in a mfc application? Pin
beyondcools16-Mar-10 16:17
beyondcools16-Mar-10 16:17 
AnswerRe: how to use a html file in a mfc application? Pin
David Crow16-Mar-10 16:25
David Crow16-Mar-10 16:25 
AnswerRe: how to use a html file in a mfc application? Pin
BIJU Manjeri16-Mar-10 18:13
BIJU Manjeri16-Mar-10 18:13 
QuestionToolStripMenuItem : how to call a child frame? Pin
sofwaidatul16-Mar-10 7:50
sofwaidatul16-Mar-10 7:50 
AnswerRe: ToolStripMenuItem : how to call a child frame? Pin
Maximilien16-Mar-10 8:51
Maximilien16-Mar-10 8:51 
Questioncode for compiler design Pin
pavithraram16-Mar-10 1:22
pavithraram16-Mar-10 1:22 
AnswerRe: code for compiler design Pin
CPallini16-Mar-10 1:33
mveCPallini16-Mar-10 1:33 
AnswerRe: code for compiler design Pin
Adam Roderick J16-Mar-10 1:50
Adam Roderick J16-Mar-10 1:50 
AnswerRe: code for compiler design PinPopular
Cedric Moonen16-Mar-10 1:58
Cedric Moonen16-Mar-10 1:58 
AnswerRe: code for compiler design Pin
Wes Aday16-Mar-10 4:11
professionalWes Aday16-Mar-10 4:11 
GeneralRe: code for compiler design Pin
Rajesh R Subramanian16-Mar-10 6:29
professionalRajesh R Subramanian16-Mar-10 6:29 
GeneralRe: code for compiler design Pin
Wes Aday16-Mar-10 9:31
professionalWes Aday16-Mar-10 9:31 
JokeRe: code for compiler design PinPopular
jeron116-Mar-10 4:26
jeron116-Mar-10 4:26 
AnswerRe: code for compiler design Pin
josda100016-Mar-10 5:44
josda100016-Mar-10 5:44 
AnswerRe: code for compiler design Pin
Maximilien16-Mar-10 5:44
Maximilien16-Mar-10 5:44 

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.