Click here to Skip to main content
15,921,884 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStatic-Derived class: painting background Pin
42884-Apr-08 8:33
42884-Apr-08 8:33 
GeneralRe: CStatic-Derived class: painting background Pin
Hamid_RT7-Apr-08 20:52
Hamid_RT7-Apr-08 20:52 
GeneralRe: CStatic-Derived class: painting background Pin
42888-Apr-08 7:23
42888-Apr-08 7:23 
GeneralRe: CStatic-Derived class: painting background Pin
Hamid_RT8-Apr-08 8:00
Hamid_RT8-Apr-08 8:00 
QuestionA very basic question about ODBC Pin
Joseph Marzbani4-Apr-08 5:34
Joseph Marzbani4-Apr-08 5:34 
GeneralRe: A very basic question about ODBC Pin
David Crow4-Apr-08 6:04
David Crow4-Apr-08 6:04 
GeneralRe: A very basic question about ODBC Pin
Mark Salsbery4-Apr-08 7:18
Mark Salsbery4-Apr-08 7:18 
GeneralChump Is Stumped By VARIANT Problem Pin
Eurosid4-Apr-08 4:34
Eurosid4-Apr-08 4:34 
So I have this COM object that's packing up an array floats for me.

Here's the loop where the VARIANT* array is getting stuffed:

for (i = 0; i < cElements; i++)
{
     VariantInit(&vDataValues[i]);
     V_VT(&vDataValues[i]) = VT_R4;
     
     //Works ok UNLESS float_data[i] == 0.0;
     V_R4(&vDataValues[i]) = float_data[i];

     if (!V_R4(&vDataValues[i]))
     {
          *pErrorCode = 1;
          m_strMessage.Format("V_R4 failed!");
          hr = E_FAIL;
          goto Error;
     }
}

The VT_R4() operation works unless the element in float_data
happens to be 0.0. When that happens, VT_R4 fails.

I know it fails only with 0.0, because I tried this:
if( float_data[i] != 0.0 )
     V_R4(&vDataValues[i]) = float_data[i];
else
     V_R4(&vDataValues[i]) = float_data[i] + 0.1;

Then, it never fails.

I can't figure out why.
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
led mike4-Apr-08 5:04
led mike4-Apr-08 5:04 
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
Eurosid4-Apr-08 5:21
Eurosid4-Apr-08 5:21 
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
led mike4-Apr-08 5:32
led mike4-Apr-08 5:32 
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
Eurosid4-Apr-08 5:49
Eurosid4-Apr-08 5:49 
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
Iain Clarke, Warrior Programmer4-Apr-08 5:43
Iain Clarke, Warrior Programmer4-Apr-08 5:43 
GeneralRe: Chump Is Stumped By VARIANT Problem Pin
Eurosid4-Apr-08 5:51
Eurosid4-Apr-08 5:51 
Generalprimary key Pin
Try4-Apr-08 4:34
Try4-Apr-08 4:34 
GeneralRe: primary key Pin
Nitheesh George4-Apr-08 4:45
Nitheesh George4-Apr-08 4:45 
QuestionRe: primary key Pin
David Crow4-Apr-08 6:08
David Crow4-Apr-08 6:08 
GeneralRe: primary key Pin
Try6-Apr-08 1:29
Try6-Apr-08 1:29 
GeneralRe: primary key Pin
Mark Salsbery4-Apr-08 7:26
Mark Salsbery4-Apr-08 7:26 
GeneralA strange problem with CRecordset derived class Pin
Joseph Marzbani4-Apr-08 3:27
Joseph Marzbani4-Apr-08 3:27 
GeneralRe: A strange problem with CRecordset derived class Pin
prasad_som4-Apr-08 3:37
prasad_som4-Apr-08 3:37 
GeneralRe: A strange problem with CRecordset derived class Pin
Cedric Moonen4-Apr-08 3:41
Cedric Moonen4-Apr-08 3:41 
GeneralRe: A strange problem with CRecordset derived class Pin
Joseph Marzbani4-Apr-08 3:56
Joseph Marzbani4-Apr-08 3:56 
GeneralRe: A strange problem with CRecordset derived class Pin
Cedric Moonen4-Apr-08 3:59
Cedric Moonen4-Apr-08 3:59 
GeneralRe: A strange problem with CRecordset derived class Pin
CPallini4-Apr-08 4:00
mveCPallini4-Apr-08 4:00 

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.