|
Hi all,
i have a date in dd/mm/yyyy format .
i want to find weekday name with help of this.
please tell me how can i do this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
COleDateTime dt("9/24/2008");
CString dayNameLong = dt.Format("%A");
CString dayNameShort = dt.Format("%a");
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
One of best article on DATE and TIME understanding, i must say that!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
i am getting a compile error while using an conversion operator which returns an list iterator. i am using visual studio 2005
code sample:
template<class t="">
class MyClass
{
public:
MyClass();
operator list<class t="">::iterator ()
{
return m_it;
}
list<class t="">::iterator m_it;
};
i am getting an error for following (when i assign the object to the iterator):
MyClass<int> myObj;
list<int>:: iterator it = myObj;
plz tell if there is any mistake in the above code.
thanks
|
|
|
|
|
the template syntax didnt appear properly in the code sample. trying to put again
|
|
|
|
|
template < class T >
class MyClass
{
public:
MyClass();
operator list <class T>::iterator ()
{
return m_it;
}
list<class T>::iterator m_it;
};
i am getting an error for following (when i assign the object to the iterator):
MyClass <int > myObj;
list <int >:: iterator it = myObj;
|
|
|
|
|
I think the operator list <class T>::iterator() should be actually define like
operator list <T>::iterator()
Also the member variable list<class T>::iterator m_it should be
list<T>::iterator m_it;
|
|
|
|
|
actually this is the first thing i had tried : it gives other compile errors.
|
|
|
|
|
I tried this in vc 6 environment. It is working fine..
What error are you getting..?
|
|
|
|
|
exactly, it works fine in vc6, but gives errors in vc2005
if i use the class keyword in the declaration then it gives: no operator found which converts from MyClass<class t=""> to iterator.
and if i do not use the class keyword then it gives : c2833 'operator qualified-name' is not a recognised operator or type.
thanks
|
|
|
|
|
I dont have the VS2005. How ever in VS 2008, I had to prefix the typename keyword to get it compiled. Try the same in VS2005.
operator typename list<T>::iterator()
{
return m_it;
}
typename list<T>::iterator m_it;
|
|
|
|
|
it really works
thank u so much
Prasann
|
|
|
|
|
Any time you use a type that is dependent on the template parameter (such as list<T>) you must preface it with the typename keyword.
|
|
|
|
|
How do I change the font style of the text in CView to the font style selected from the fontdialog?
|
|
|
|
|
LOGFONT newlf;
CFontDialog fd;
if(fd.DoModal() == IDOK)
{
fd.GetCurrentFont(&newlf);
setfont(newlf);
UpdateData(FALSE);
}
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Thanks. I have used this method, font style of the text is changed but the alignment of the text is not proper. How do I ensure that the text alignment isn't changed?
|
|
|
|
|
Hi,
You can change the alignment using SetTextAlign();
pDCMem->SetTextAlign (TA_BASELINE);
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
i want to change background color of group box caption
in OnCtrlColor method i can change color of caption of groupbox but i want to change background color of groupbox caption
how is that possible?
|
|
|
|
|
Call pDC->SetBkColor(); also OnCtrlColor() function should return the brush with that color.
|
|
|
|
|
|
Who must be see this link? Naveen or anilaabc?
|
|
|
|
|
Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hi all,
I got this error:
Windows has triggered a breakpoint in UpdateService.exe.
This may be due to a corruption of the heap, and indicates a bug in UpdateService.exe
or any of the DLLs it has loaded.
The output window may have more diagnostic information.
and this is my code:
USES_CONVERSION;
pDoCheckForProductUpdates->productName = new std::string(W2A(prd->m_Name.c_str()));
pDoCheckForProductUpdates->productVersion = new std::string(W2A(prd->m_VersionNo.c_str()));
pDoCheckForProductUpdates->serialNumber = new std::string(W2A(prd->m_SerialNo.c_str()));
pDoCheckForProductUpdates->siteCode = new std::string(W2A(prd->m_SiteCode.c_str()));
_ns1__DoGetLatestProduct *pDoGetLatestProduct;
_ns1__DoGetLatestProductResponse *pDoGetLatestProductResponse;
pDoGetLatestProduct = InstantiateGetProduct();
pDoGetLatestProductResponse = InstantiateGetProductResponse();
iRet = m_pWebServiceSoap->__ns2__DoCheckForProductUpdates(pDoCheckForProductUpdates,pDoCheckForProductUpdatesResponse);
The error happens at the bold part. going to this part of atlsimpstr.h
#if _SECURE_ATL
CopyChars( PXSTR( pNewData->data() ), nCharsToCopy,
PCXSTR( pOldData->data() ), nCharsToCopy );
#else
CopyChars( PXSTR( pNewData->data() ), PCXSTR( pOldData->data() ), nCharsToCopy );
#endif
pNewData->nDataLength = nOldLength;
pOldData->Release();
Attach( pNewData );
}
Whats wrong with my code?
This error doesnt happen before but when i used "Use Standard Windows Libraries" but due to certain changes i encountered this error: fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
Now i used Use MFC in a Shared DLL to solve that error now i encounter the above error.
Thanks,
Jayjay
modified on Wednesday, September 24, 2008 10:43 PM
|
|
|
|