Click here to Skip to main content
15,904,653 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sending Messages to plug-ins Pin
Steve Messer27-Sep-03 8:22
Steve Messer27-Sep-03 8:22 
GeneralRe: Sending Messages to plug-ins Pin
Steve Messer27-Sep-03 9:38
Steve Messer27-Sep-03 9:38 
Generalwarning problem Pin
coda_x27-Sep-03 2:24
coda_x27-Sep-03 2:24 
GeneralRe: warning problem Pin
Michael P Butler27-Sep-03 2:51
Michael P Butler27-Sep-03 2:51 
GeneralRe: warning problem Pin
AORD27-Sep-03 11:34
AORD27-Sep-03 11:34 
GeneralRe: warning problem Pin
coda_x27-Sep-03 16:28
coda_x27-Sep-03 16:28 
Generalwarning problem Pin
coda_x27-Sep-03 2:24
coda_x27-Sep-03 2:24 
GeneralRe: warning problem Pin
Ian Darling27-Sep-03 2:46
Ian Darling27-Sep-03 2:46 
a) recordset.GetFieldValue("rate") gives a variable of variant type, which means that it can hold a value of one of a set of types. The type it actually hold is in the .vt member. If you access the wrong one for the type, then it comes out as garbage (for reasons why, take a look at the union construct).

b) .dbvVal returns a double, yet your m_rate is a float. float variables take up a smaller size than double (in VC++, float is 4 bytes, double is 8) - this means that some of the precision of the double is lost in the converstion to float.

So you need to check the type of the variant before accessing it, and you need to store the result in an appropriately typed variable, or cast it.

--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
GeneralRe: warning problem Pin
Mike Dimmick27-Sep-03 12:18
Mike Dimmick27-Sep-03 12:18 
Generalanalyze C++ source code(VC) and Java source code Pin
candan26-Sep-03 23:09
professionalcandan26-Sep-03 23:09 
GeneralRe: analyze C++ source code(VC) and Java source code Pin
Mike Dimmick27-Sep-03 2:37
Mike Dimmick27-Sep-03 2:37 
GeneralRe: analyze C++ source code(VC) and Java source code Pin
Taka Muraoka27-Sep-03 14:41
Taka Muraoka27-Sep-03 14:41 
GeneralRe: analyze C++ source code(VC) and Java source code Pin
Mike Dimmick27-Sep-03 23:59
Mike Dimmick27-Sep-03 23:59 
GeneralRe: analyze C++ source code(VC) and Java source code Pin
Taka Muraoka28-Sep-03 22:14
Taka Muraoka28-Sep-03 22:14 
GeneralRe: analyze C++ source code(VC) and Java source code Pin
candan30-Sep-03 14:34
professionalcandan30-Sep-03 14:34 
GeneralRasApi error Pin
Kannan Ramanathan26-Sep-03 21:52
Kannan Ramanathan26-Sep-03 21:52 
GeneralRe: RasApi error Pin
Kannan Ramanathan26-Sep-03 21:55
Kannan Ramanathan26-Sep-03 21:55 
GeneralRe: RasApi error Pin
Mike Dimmick27-Sep-03 12:24
Mike Dimmick27-Sep-03 12:24 
GeneralRe: RasApi error Pin
Kannan Ramanathan28-Sep-03 17:53
Kannan Ramanathan28-Sep-03 17:53 
GeneralSending files via FTP from VC++ app. Pin
DAVE_ES26-Sep-03 21:45
DAVE_ES26-Sep-03 21:45 
GeneralRe: Sending files via FTP from VC++ app. Pin
Member 54428726-Sep-03 21:58
Member 54428726-Sep-03 21:58 
GeneralSending files using socket. Pin
Anthony_Yio26-Sep-03 21:30
Anthony_Yio26-Sep-03 21:30 
GeneralCompiling error with "htmlhelp.h". Pin
George226-Sep-03 20:50
George226-Sep-03 20:50 
GeneralRe: Compiling error with "htmlhelp.h". Pin
peterchen26-Sep-03 22:58
peterchen26-Sep-03 22:58 
GeneralRe: Compiling error with "htmlhelp.h". Pin
George227-Sep-03 0:30
George227-Sep-03 0:30 

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.