Click here to Skip to main content
16,004,991 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drawing text Pin
Jim Crafton31-Jul-02 6:21
Jim Crafton31-Jul-02 6:21 
GeneralRe: Drawing text Pin
rsasalm_31-Jul-02 6:37
rsasalm_31-Jul-02 6:37 
GeneralRe: Drawing text Pin
PJ Arends31-Jul-02 7:53
professionalPJ Arends31-Jul-02 7:53 
GeneralRe: Drawing text Pin
rsasalm_1-Aug-02 3:17
rsasalm_1-Aug-02 3:17 
GeneralRe: Drawing text Pin
PJ Arends1-Aug-02 6:52
professionalPJ Arends1-Aug-02 6:52 
Generalbarcode reading Pin
tadedk31-Jul-02 6:09
tadedk31-Jul-02 6:09 
GeneralRe: barcode reading Pin
Anonymous31-Jul-02 8:40
Anonymous31-Jul-02 8:40 
Generalnot clear why & is used Pin
ns31-Jul-02 5:59
ns31-Jul-02 5:59 
A CP sample has:

BOOL CADOTestDlg::DestroyWindow() 
{
	// TODO: Add your specialized code here and/or call the base class
	if ( (m_pConn->State & adStateOpen) == adStateOpen)
		m_pConn->Close();

	CoUninitialize();
	return CDialog::DestroyWindow();
}


If I wanted to close in case the conn was open, I would just do:

if ( (m_pConn->State  == adStateOpen)
		m_pConn->Close();


Why do we have the & there? I tried to look up State on the MSDN but it didnt point me to the Connection State. For that matter doing F1 on Connection didnt land me in any databasey link either.
So I assumed State is the property which holds a particular value like open or closed or whatever.

So why do we have (m_pConn->State & adStateOpen) == adStateOpen

Thanks,'
ns
GeneralRe: not clear why & is used Pin
Jim Crafton31-Jul-02 6:26
Jim Crafton31-Jul-02 6:26 
GeneralRe: not clear why & is used Pin
Chris Losinger31-Jul-02 6:32
professionalChris Losinger31-Jul-02 6:32 
GeneralRe: not clear why & is used Pin
ns31-Jul-02 6:38
ns31-Jul-02 6:38 
GeneralRe: not clear why & is used Pin
Chris Losinger31-Jul-02 6:45
professionalChris Losinger31-Jul-02 6:45 
Generalaah! Thats what I was looking for! Pin
ns31-Jul-02 6:50
ns31-Jul-02 6:50 
GeneralRe: not clear why & is used Pin
Ravi Bhavnani31-Jul-02 6:54
professionalRavi Bhavnani31-Jul-02 6:54 
GeneralRe: not clear why & is used Pin
PJ Arends31-Jul-02 8:08
professionalPJ Arends31-Jul-02 8:08 
GeneralShared resources management Pin
Antony B.31-Jul-02 5:40
sussAntony B.31-Jul-02 5:40 
GeneralStill a little lost with GetActiveDocument() Pin
NickOne31-Jul-02 5:22
NickOne31-Jul-02 5:22 
GeneralRe: Still a little lost with GetActiveDocument() Pin
JennyP31-Jul-02 6:23
JennyP31-Jul-02 6:23 
GeneralRe: Still a little lost with GetActiveDocument() Pin
NickOne31-Jul-02 7:03
NickOne31-Jul-02 7:03 
GeneralRe: Still a little lost with GetActiveDocument() Pin
NickOne31-Jul-02 8:06
NickOne31-Jul-02 8:06 
Generalmultipart file download... Pin
behrang7931-Jul-02 5:02
behrang7931-Jul-02 5:02 
GeneralC1010: unexpected end of file while looking for precompiled header directive Pin
Raskolnikov31-Jul-02 4:59
Raskolnikov31-Jul-02 4:59 
GeneralRe: C1010: unexpected end of file while looking for precompiled header directive Pin
RichB31-Jul-02 5:05
RichB31-Jul-02 5:05 
GeneralI hate Microsoft Pin
Raskolnikov31-Jul-02 5:08
Raskolnikov31-Jul-02 5:08 
GeneralRe: I hate Microsoft Pin
Jim Crafton31-Jul-02 6:25
Jim Crafton31-Jul-02 6: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.