Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionQt - What do we mean by those code snippets [modified] Pin
Abder_Rahman14-Apr-11 1:37
Abder_Rahman14-Apr-11 1:37 
AnswerRe: Qt - What do we mean by those code snippets Pin
MicroVirus14-Apr-11 1:50
MicroVirus14-Apr-11 1:50 
GeneralRe: Qt - What do we mean by those code snippets [modified] Pin
Abder_Rahman14-Apr-11 1:55
Abder_Rahman14-Apr-11 1:55 
GeneralRe: Qt - What do we mean by those code snippets Pin
MicroVirus14-Apr-11 2:18
MicroVirus14-Apr-11 2:18 
GeneralRe: Qt - What do we mean by those code snippets Pin
Abder_Rahman14-Apr-11 22:21
Abder_Rahman14-Apr-11 22:21 
GeneralRe: Qt - What do we mean by those code snippets Pin
MicroVirus15-Apr-11 0:32
MicroVirus15-Apr-11 0:32 
AnswerRe: Qt - What do we mean by those code snippets Pin
David Crow14-Apr-11 10:00
David Crow14-Apr-11 10:00 
QuestionHow can I treat VT_DATE ? Pin
_Flaviu13-Apr-11 23:44
_Flaviu13-Apr-11 23:44 
I have an Automation excel class with follow method :
CString CXLAutomation::GetCellValueCString(int nColumn, int nRow)
{
	CString szValue =_T("");
	if(NULL == m_pdispWorksheet)return szValue;

	VARIANTARG vargRng, vargValue;
	ClearAllArgs();
	AddArgumentDouble(NULL, 0, nColumn);
	AddArgumentDouble(NULL, 0, nRow);
	if(! ExlInvoke(m_pdispWorksheet, L"Cells",&vargRng, DISPATCH_PROPERTYGET, DISP_FREEARGS))return szValue;

	if(! ExlInvoke(vargRng.pdispVal, L"Value", &vargValue, DISPATCH_PROPERTYGET, 0))return szValue;

	VARTYPE Type = vargValue.vt;
	switch(Type)
	{
	case VT_UI1:
		{
			TCHAR nChr = vargValue.bVal;
			szValue = nChr;
		}
		break;
	case VT_I4:
		{
			long nVal = vargValue.lVal;
			szValue.Format("%i", nVal);
		}
		break;
	case VT_R4:
		{
			float fVal = vargValue.fltVal;
			szValue.Format("%f", fVal);
		}
		break;
	case VT_R8:
		{
			double dVal = vargValue.dblVal;
			szValue.Format("%f", dVal);
		}
		break;
	case VT_BSTR:
		{
			BSTR b = vargValue.bstrVal;
			szValue = b;
		}
		break;
	case VT_BYREF|VT_UI1:
		{
			//Not tested
			unsigned char* pChr = vargValue.pbVal;
			szValue = (TCHAR)*pChr;
		}
		break;
	case VT_BYREF|VT_BSTR:
		{
			//Not tested
			BSTR* pb = vargValue.pbstrVal;
			szValue = *pb;
		}
		break;
	case 0:
		{
			//Empty
			szValue = _T("");
		}
		break;
	}
//	ReleaseVariant(&vargRng);
//	ReleaseVariant(&vargValue);

	return szValue;
}


but haven't VT_DATE and VT_DATE | VT_BYREF case ... can you give me an help hand ?

I can show you what I try , but didn't working ...
Thank you .

P.S. I search to google , but I didn't find something appropiate ... Frown | :(
AnswerRe: How can I treat VT_DATE ? Pin
CPallini13-Apr-11 23:58
mveCPallini13-Apr-11 23:58 
GeneralRe: How can I treat VT_DATE ? Pin
_Flaviu14-Apr-11 0:05
_Flaviu14-Apr-11 0:05 
GeneralRe: How can I treat VT_DATE ? Pin
CPallini14-Apr-11 0:15
mveCPallini14-Apr-11 0:15 
GeneralRe: How can I treat VT_DATE ? Pin
_Flaviu14-Apr-11 0:26
_Flaviu14-Apr-11 0:26 
AnswerRe: How can I treat VT_DATE ? Pin
T210215-Apr-11 10:47
T210215-Apr-11 10:47 
QuestionHow to use One Pointer Object in another .cpp file? Pin
002comp13-Apr-11 23:44
002comp13-Apr-11 23:44 
AnswerRe: How to use One Pointer Object in another .cpp file? Pin
«_Superman_»14-Apr-11 0:44
professional«_Superman_»14-Apr-11 0:44 
GeneralRe: How to use One Pointer Object in another .cpp file? [modified] Pin
002comp14-Apr-11 1:35
002comp14-Apr-11 1:35 
AnswerRe: How to use One Pointer Object in another .cpp file? Pin
Albert Holguin15-Apr-11 4:35
professionalAlbert Holguin15-Apr-11 4:35 
AnswerRe: How to use One Pointer Object in another .cpp file? Pin
Stefan_Lang14-Apr-11 7:02
Stefan_Lang14-Apr-11 7:02 
AnswerRe: How to use One Pointer Object in another .cpp file? Pin
Albert Holguin14-Apr-11 14:43
professionalAlbert Holguin14-Apr-11 14:43 
GeneralRe: How to use One Pointer Object in another .cpp file? [modified] Pin
002comp14-Apr-11 21:14
002comp14-Apr-11 21:14 
GeneralRe: How to use One Pointer Object in another .cpp file? Pin
Stefan_Lang14-Apr-11 23:18
Stefan_Lang14-Apr-11 23:18 
GeneralRe: How to use One Pointer Object in another .cpp file? Pin
002comp15-Apr-11 2:24
002comp15-Apr-11 2:24 
GeneralRe: How to use One Pointer Object in another .cpp file? Pin
Stefan_Lang15-Apr-11 4:42
Stefan_Lang15-Apr-11 4:42 
GeneralRe: How to use One Pointer Object in another .cpp file? Pin
Albert Holguin15-Apr-11 4:29
professionalAlbert Holguin15-Apr-11 4:29 
AnswerRe: How to use One Pointer Object in another .cpp file? Pin
Code-o-mat14-Apr-11 23:07
Code-o-mat14-Apr-11 23:07 

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.