Click here to Skip to main content
15,917,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Mouse selection Pin
Shay Harel18-Aug-04 11:10
Shay Harel18-Aug-04 11:10 
GeneralRe: Mouse selection Pin
Ivan Cachicatari18-Aug-04 11:31
Ivan Cachicatari18-Aug-04 11:31 
Questiona better strtok ? Pin
Maximilien18-Aug-04 8:30
Maximilien18-Aug-04 8:30 
AnswerRe: a better strtok ? Pin
gamitech19-Aug-04 12:26
gamitech19-Aug-04 12:26 
GeneralRe: a better strtok ? Pin
Maximilien19-Aug-04 14:24
Maximilien19-Aug-04 14:24 
GeneralVariant Types Pin
Grahamfff18-Aug-04 8:29
Grahamfff18-Aug-04 8:29 
GeneralRe: Variant Types Pin
Ivan Cachicatari18-Aug-04 11:22
Ivan Cachicatari18-Aug-04 11:22 
GeneralRe: Variant Types Pin
Grahamfff19-Aug-04 8:51
Grahamfff19-Aug-04 8:51 
Thanks for your post. I have spent the day trying the new OleVariant and VARIANT types.
I found that the example project did not do what I required, so I opted for the VARIANT, but have a problem. When I display the data is is always a funny value and when I set it to to 0, then it always remains at 0. I have just concentrated on dealing with a unsigned short at present; but will want to deal with floats, doubles etc later
See code below:-

VARIANT varData[5];<br />
<br />
union<br />
{<br />
	// Signal	mess_13_tp1_w01_pitch;<br />
	unsigned short		mess_13_tp1_w01_data1; <br />
	// Signal	mess_13_tp1_w03_heading;<br />
	unsigned short		mess_13_tp1_w03_data2; <br />
	// Bit fields as 1 byte insigned<br />
	unsigned short		mess_13_tp1_w02_data_X; <br />
	unsigned short		mess_13_tp1_w02_data1_X; <br />
	unsigned short		mess_13_tp1_w02_data2_X; <br />
	unsigned short		buffer[32];<br />
}mess_13_m_tp1_display;<br />
<br />
<br />
VariantInit(&varData[0]);<br />
varData[0].vt = VT_UI2;<br />
varData[0].puiVal = &mess_13_m_tp1_display.mess_13_tp1_w01_data1;<br />
VariantInit(&varData[1]);<br />
//varData[0].uiVal = 0; // Init it, but then always 0 ???<br />
varData[1].vt = VT_UI2;<br />
varData[1].puiVal = &mess_13_m_tp1_display.mess_13_tp1_w02_data_X;<br />
VariantInit(&varData[2]);<br />
.<br />
.<br />
Etc<br />
<br />
// Now display/Edit the data<br />
for( j = 0; j < message.getNoFields(); j++)<br />
{<br />
m_cSignalList.SetItemText(j , 0, message.details[j].fieldDesc);<br />
m_cSignalList.SetItemText(j , 1, message.details[j].signal);<br />
formatStr.Format(message.details[j].display1,&message.varData[j].uiVal);<br />
m_cSignalList.SetItemText(j, 2, formatStr);    formatStr.Format(message.details[j].display2,message.varData[j].uiVal);<br />
m_cSignalList.SetItemText(j, 3, formatStr);<br />
m_cSignalList.SetItemText(j , 4, message.details[j].unitsStr );<br />
}


I use a ListCtrl to display and modify the data, hence the need to use VARIANTS.

Any suggestions to overcome this problem?


grahamfff
QuestionHow to Save Fiels? Pin
Zero_One_ADO18-Aug-04 7:49
Zero_One_ADO18-Aug-04 7:49 
AnswerRe: How to Save Fiels? Pin
Carlos Antollini18-Aug-04 8:41
Carlos Antollini18-Aug-04 8:41 
AnswerRe: How to Save Fiels? Pin
David Crow19-Aug-04 3:07
David Crow19-Aug-04 3:07 
AnswerRe: How to Save Fiels? Pin
gamitech19-Aug-04 12:29
gamitech19-Aug-04 12:29 
QuestionAbout SetCursor? Pin
Zero_One_ADO18-Aug-04 7:47
Zero_One_ADO18-Aug-04 7:47 
AnswerRe: About SetCursor? Pin
vcplusplus18-Aug-04 8:28
vcplusplus18-Aug-04 8:28 
GeneralUnresolved external error: LNK2001 Pin
crushinghellhammer18-Aug-04 7:02
crushinghellhammer18-Aug-04 7:02 
GeneralRe: Unresolved external error: LNK2001 Pin
Mike K. Clark18-Aug-04 14:06
Mike K. Clark18-Aug-04 14:06 
GeneralLNK2005 Pin
фил18-Aug-04 7:00
фил18-Aug-04 7:00 
GeneralRe: LNK2005 Pin
Antony M Kancidrowski18-Aug-04 13:42
Antony M Kancidrowski18-Aug-04 13:42 
GeneralOwnerDrawn ComboBox &amp; CDialogBar Pin
AJ12318-Aug-04 6:35
AJ12318-Aug-04 6:35 
GeneralRe: OwnerDrawn ComboBox &amp; CDialogBar Pin
AJ12318-Aug-04 9:28
AJ12318-Aug-04 9:28 
GeneralDoc/View and CTRL+TAB Pin
Jay Carter18-Aug-04 6:05
Jay Carter18-Aug-04 6:05 
GeneralDoc/View and CTRL+TAB Pin
Jay Carter18-Aug-04 6:05
Jay Carter18-Aug-04 6:05 
GeneralNIIF_NONE Pin
BlackDice18-Aug-04 5:30
BlackDice18-Aug-04 5:30 
General#if (_WIN32_IE &gt;= 0x0500) Pin
BlackDice18-Aug-04 5:45
BlackDice18-Aug-04 5:45 
GeneralRe: #if (_WIN32_IE &gt;= 0x0500) Pin
Steve Thresher18-Aug-04 5:52
Steve Thresher18-Aug-04 5:52 

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.