Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: load image,display n convert to grayscale in c++ Pin
Ravi Bhavnani3-Aug-04 1:40
professionalRavi Bhavnani3-Aug-04 1:40 
QuestionHow do I extern a structure? Pin
Link26003-Aug-04 0:36
Link26003-Aug-04 0:36 
AnswerRe: How do I extern a structure? Pin
RChin3-Aug-04 1:46
RChin3-Aug-04 1:46 
GeneralRe: How do I extern a structure? Pin
Link26003-Aug-04 1:49
Link26003-Aug-04 1:49 
GeneralRe: How do I extern a structure? Pin
RChin3-Aug-04 1:56
RChin3-Aug-04 1:56 
GeneralRe: How do I extern a structure? Pin
jmkhael3-Aug-04 1:57
jmkhael3-Aug-04 1:57 
GeneralRe: How do I extern a structure? Pin
Henry miller3-Aug-04 4:16
Henry miller3-Aug-04 4:16 
GeneralOverlaying Data (union) Pin
sweep1233-Aug-04 0:27
sweep1233-Aug-04 0:27 
I have been trying to use a 'union' with a enum type in it but keep getting various errors;

e.g. if I use this scheme:-

// w12_reserved4_data;<br />
typedef struct <br />
{<br />
	unsigned	 data 	:	1	;	<br />
}W12_RESERVED4_DATA;<br />
<br />
enum	W12_SELECTED_SOURCE_DATA		 { ON,OFF }; <br />
<br />
// w12_reserved5_data;<br />
typedef struct <br />
{<br />
	unsigned	 data 	:	8	;	<br />
}W12_RESERVED5_DATA;<br />
<br />
// Message Data Structure <br />
union	M_TT1_UNION<br />
{<br />
	W12_RESERVED4_DATA		item1_data;<br />
	W12_SELECTED_SOURCE_DATA	item2_data;<br />
	W12_RESERVED5_DATA		item3_data;<br />
	unsigned short			buffer[32];   // Max buffer size<br />
}m_tt1;

This gives error:-

c:\Database\Database2.c(973): error C2061: syntax error : identifier 'W12_SELECTED_SOURCE_DATA'

If I wrap up the enum in a structure I get a different error

typedef struct <br />
{<br />
 	enum	W12_SELECTED_SOURCE_DATA		 { ON,OFF }; <br />
}data02;<br />
<br />
// Message Data Structure <br />
union	M_TT1_UNION<br />
{<br />
	W12_RESERVED4_DATA		item1_data;<br />
	data02				item2_data;<br />
	W12_RESERVED5_DATA		item3_data;<br />
	unsigned short			buffer[32];   // Max buffer size<br />
}m_tt1;

c:\Database\Database2.c(494): error C2208: 'W12_SELECTED_SOURCE_DATA': no members defined using this type

How can I get this enum working as part of this union. I did want to overlay many bit fields with this buffer, but no luck todate.

Are they another way to overlay bits, shorts and floats with a buffer?
GeneralRe: Overlaying Data (union) Pin
LittleYellowBird3-Aug-04 5:20
LittleYellowBird3-Aug-04 5:20 
GeneralRe: Overlaying Data (union) Pin
sweep1233-Aug-04 21:43
sweep1233-Aug-04 21:43 
QuestionSet Timer ??? Pin
Zeeshan Bilal3-Aug-04 0:13
Zeeshan Bilal3-Aug-04 0:13 
AnswerRe: Set Timer ??? Pin
Antony M Kancidrowski3-Aug-04 1:01
Antony M Kancidrowski3-Aug-04 1:01 
GeneralListcontrol problem Pin
JHAKAS3-Aug-04 0:09
JHAKAS3-Aug-04 0:09 
GeneralRe: Listcontrol problem Pin
Michael P Butler3-Aug-04 0:39
Michael P Butler3-Aug-04 0:39 
Generalhandling databases in MFC Pin
Anonymous3-Aug-04 0:08
Anonymous3-Aug-04 0:08 
GeneralRe: handling databases in MFC Pin
JHAKAS3-Aug-04 0:25
JHAKAS3-Aug-04 0:25 
GeneralRe: handling databases in MFC Pin
Michael P Butler3-Aug-04 0:44
Michael P Butler3-Aug-04 0:44 
GeneralRe: handling databases in MFC Pin
Anders Gustafsson17-Jan-06 5:15
Anders Gustafsson17-Jan-06 5:15 
GeneralA question Pin
rfixxxer2-Aug-04 23:53
rfixxxer2-Aug-04 23:53 
GeneralRe: A question Pin
Anonymous3-Aug-04 0:01
Anonymous3-Aug-04 0:01 
GeneralRe: A question Pin
rfixxxer3-Aug-04 0:07
rfixxxer3-Aug-04 0:07 
GeneralRe: A question Pin
Zeeshan Bilal3-Aug-04 0:16
Zeeshan Bilal3-Aug-04 0:16 
GeneralRe: A question Pin
David Crow3-Aug-04 3:48
David Crow3-Aug-04 3:48 
GeneralMakefile problems Pin
mcsherry2-Aug-04 23:40
mcsherry2-Aug-04 23:40 
Generallinking error with &quot;afxdao.h&quot; Pin
si_692-Aug-04 23:19
si_692-Aug-04 23:19 

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.