Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConvert image to byte array Pin
hari_honey17-Oct-08 1:17
hari_honey17-Oct-08 1:17 
AnswerRe: Convert image to byte array Pin
Jose David Pujo17-Oct-08 1:53
Jose David Pujo17-Oct-08 1:53 
GeneralRe: Convert image to byte array Pin
Gokulnath00730-Apr-11 0:31
Gokulnath00730-Apr-11 0:31 
AnswerRe: Convert image to byte array Pin
Mark Salsbery17-Oct-08 5:41
Mark Salsbery17-Oct-08 5:41 
GeneralRe: Convert image to byte array Pin
hari_honey19-Oct-08 19:07
hari_honey19-Oct-08 19:07 
GeneralRe: Convert image to byte array Pin
Mark Salsbery20-Oct-08 6:18
Mark Salsbery20-Oct-08 6:18 
AnswerRe: Convert image to byte array Pin
CPallini17-Oct-08 9:17
mveCPallini17-Oct-08 9:17 
QuestionExcel Automation Pin
SRKSHOME17-Oct-08 0:37
SRKSHOME17-Oct-08 0:37 
Hi All,
I am trying to automate the excel into simpe MFC application. I am using excel 2007. But code is not working. Can one see any problem with this code?

#include "stdafx.h"
#include "afxdisp.h"
#include "excel.h"

#include "AutoExcel.h"
/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;
	_Application app; 

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		cerr <<_T("Fatal Error: MFC initialization failed")<<endl;
		nRetCode = 1;
	}
	if(!AfxOleInit())  
         {
            AfxMessageBox("Could not initialize COM dll");
            return FALSE;
         }
	else
	{
          // Start Excel and get Application object...
         if(!app.CreateDispatch("Excel.Application"))
         {
            AfxMessageBox("Couldn't start Excel.");
         }
         else
         {
            //Make Excel Visible and display a message
          app.SetVisible(TRUE);
          AfxMessageBox ("Excel is Running!");
         }

	}

	return nRetCode;
}

AnswerRe: Excel Automation Pin
Cedric Moonen17-Oct-08 1:03
Cedric Moonen17-Oct-08 1:03 
GeneralRe: Excel Automation Pin
SRKSHOME17-Oct-08 1:10
SRKSHOME17-Oct-08 1:10 
AnswerRe: Excel Automation Pin
Roger Stoltz17-Oct-08 1:47
Roger Stoltz17-Oct-08 1:47 
AnswerRe: Excel Automation [modified] Pin
SandipG 17-Oct-08 1:15
SandipG 17-Oct-08 1:15 
AnswerRe: Excel Automation Pin
Roger Stoltz17-Oct-08 1:35
Roger Stoltz17-Oct-08 1:35 
GeneralRe: Excel Automation Pin
SandipG 17-Oct-08 1:37
SandipG 17-Oct-08 1:37 
AnswerRe: Excel Automation Pin
David Crow17-Oct-08 4:36
David Crow17-Oct-08 4:36 
GeneralRe: Excel Automation Pin
SRKSHOME19-Oct-08 18:27
SRKSHOME19-Oct-08 18:27 
QuestionApplication encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula16-Oct-08 23:36
ttarantula16-Oct-08 23:36 
AnswerRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Rajesh R Subramanian16-Oct-08 23:46
professionalRajesh R Subramanian16-Oct-08 23:46 
AnswerRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Hamid_RT17-Oct-08 0:09
Hamid_RT17-Oct-08 0:09 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula17-Oct-08 0:17
ttarantula17-Oct-08 0:17 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
Hamid_RT17-Oct-08 19:13
Hamid_RT17-Oct-08 19:13 
GeneralRe: Application encountered serious error when running on emulator in debug mode(S.O.S) Pin
ttarantula11-Nov-08 16:04
ttarantula11-Nov-08 16:04 
QuestionWhere should I define this. Pin
CodingLover16-Oct-08 22:54
CodingLover16-Oct-08 22:54 
AnswerRe: Where should I define this. Pin
Graham Shanks16-Oct-08 23:19
Graham Shanks16-Oct-08 23:19 
QuestionRe: Where should I define this. Pin
CodingLover16-Oct-08 23:25
CodingLover16-Oct-08 23:25 

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.