Click here to Skip to main content
15,920,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFonts Pin
Waldermort18-Sep-07 22:57
Waldermort18-Sep-07 22:57 
AnswerRe: Fonts Pin
KarstenK18-Sep-07 23:05
mveKarstenK18-Sep-07 23:05 
AnswerRe: Fonts Pin
nbugalia18-Sep-07 23:14
nbugalia18-Sep-07 23:14 
AnswerRe: Fonts Pin
Waldermort19-Sep-07 0:46
Waldermort19-Sep-07 0:46 
QuestionEM_GETSELTEXT Message Doesn't retrive the Text Pin
GauranG Shah18-Sep-07 22:37
GauranG Shah18-Sep-07 22:37 
AnswerRe: EM_GETSELTEXT Message Doesn't retrive the Text Pin
nbugalia18-Sep-07 23:23
nbugalia18-Sep-07 23:23 
GeneralRe: EM_GETSELTEXT Message Doesn't retrive the Text Pin
GauranG Shah18-Sep-07 23:30
GauranG Shah18-Sep-07 23:30 
QuestionRe: EM_GETSELTEXT Message Doesn't retrive the Text Pin
David Crow19-Sep-07 3:24
David Crow19-Sep-07 3:24 
AnswerRe: EM_GETSELTEXT Message Doesn't retrive the Text Pin
GauranG Shah19-Sep-07 21:14
GauranG Shah19-Sep-07 21:14 
QuestionRe: EM_GETSELTEXT Message Doesn't retrive the Text Pin
David Crow20-Sep-07 2:27
David Crow20-Sep-07 2:27 
QuestionHow to convert *.tif to *.bmp? Pin
TooShy2Talk18-Sep-07 22:34
TooShy2Talk18-Sep-07 22:34 
AnswerRe: How to convert *.tif to *.bmp? Pin
KarstenK18-Sep-07 22:58
mveKarstenK18-Sep-07 22:58 
GeneralRe: How to convert *.tif to *.bmp? Pin
TooShy2Talk18-Sep-07 23:20
TooShy2Talk18-Sep-07 23:20 
GeneralRe: How to convert *.tif to *.bmp? Pin
KarstenK18-Sep-07 23:42
mveKarstenK18-Sep-07 23:42 
AnswerRe: How to convert *.tif to *.bmp? Pin
Mark Salsbery19-Sep-07 5:48
Mark Salsbery19-Sep-07 5:48 
Questionreading simple excel sheet without using odbc Pin
neha.agarwal2718-Sep-07 21:58
neha.agarwal2718-Sep-07 21:58 
AnswerRe: reading simple excel sheet without using odbc Pin
KarstenK18-Sep-07 22:59
mveKarstenK18-Sep-07 22:59 
GeneralRe: reading simple excel sheet without using odbc Pin
neha.agarwal2718-Sep-07 23:09
neha.agarwal2718-Sep-07 23:09 
GeneralRe: reading simple excel sheet without using odbc Pin
KarstenK18-Sep-07 23:26
mveKarstenK18-Sep-07 23:26 
AnswerRe: reading simple excel sheet without using odbc Pin
Karismatic18-Sep-07 23:07
Karismatic18-Sep-07 23:07 
Using this code you can get the values from xl sheet in the variant variable var.

There are step to use this code: -
1. write the import statements acording to the verision of office u have
for office 2000 they are: -
<br />
#import "Lib\mso9.dll" no_namespace rename("DocumentProperties", "DocumentPropertiesXL") <br />
<br />
#import "Lib\vbe6ext.olb" no_namespace<br />
<br />
#import "Lib\Excel9.olb" \<br />
	rename( "DialogBox", "ExcelDialogBox" ) \<br />
	rename( "RGB", "ExcelRGB" ) \<br />
	rename( "CopyFile", "ExcelCopyFile" ) \<br />
	rename( "ReplaceText", "ExcelReplaceText" ) \<br />
	rename_namespace("EXL")<br />

Best place to add these statements is in stdafx.h

2.Declare these variables: -
<br />
	// excel variables.<br />
	EXL::_ApplicationPtr pEXLApp;<br />
	WorkbooksPtr pEXLBooks;<br />
	_WorkbookPtr pEXLBook;<br />
	WorksheetsPtr pEXLSheets;<br />
	_WorksheetPtr pEXLSheet;<br />

3.
<br />
::CoInitialize(NULL);<br />
try<br />
{<br />
	if(NULL == pEXLApp)<br />
		hResApp = pEXLApp.CreateInstance("Excel.Application");<br />
	else<br />
		hResApp = pEXLApp.GetActiveObject("Excel.Application");<br />
<br />
	pEXLBooks = pEXLApp->GetWorkbooks();<br />
	pEXLBook = pEXLBooks->Open(_bstr_t("Path of the xls file"));<br />
	pEXLSheet = pEXLBook->GetActiveSheet();<br />
<br />
	_variant_t var = pEXLSheet->GetRange("A1")->GetFormulaR1C1();<br />
<br />
	pEXLApp->GetActiveWindow()->Close();<br />
}<br />
catch(_com_error &e)<br />
{<br />
	string strError;<br />
	_bstr_t bstrSource(e.Source());<br />
	_bstr_t bstrDescription(e.Description());<br />
	_bstr_t bstrError(e.Error());<br />
<br />
	_bstr_t err_msg = "Error : " + bstrError + "\nDescription : " + bstrDescription + "\nSource : " + bstrSource;<br />
<br />
	strError = _com_util::ConvertBSTRToString(err_msg);<br />
	AfxMessageBox(strError.c_str());<br />
}


Regards,
Pankaj Sachdeva

"There is no future lies in any job"
"but"
"future lies in the person who holds the job"

QuestionConvert char string to UTF-8 Pin
kcynic18-Sep-07 21:25
kcynic18-Sep-07 21:25 
AnswerRe: Convert char string to UTF-8 Pin
fefe.wyx18-Sep-07 23:13
fefe.wyx18-Sep-07 23:13 
GeneralRe: Convert char string to UTF-8 Pin
kcynic19-Sep-07 15:00
kcynic19-Sep-07 15:00 
AnswerRe: Convert char string to UTF-8 Pin
KarstenK18-Sep-07 23:46
mveKarstenK18-Sep-07 23:46 
QuestionCombo box Max Length Pin
danasegaranea18-Sep-07 21:02
danasegaranea18-Sep-07 21:02 

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.