Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [Message Deleted] Pin
Hamid_RT9-Jan-09 1:22
Hamid_RT9-Jan-09 1:22 
GeneralRe: [Message Deleted] Pin
toxcct9-Jan-09 1:24
toxcct9-Jan-09 1:24 
GeneralRe: [Message Deleted] Pin
Hamid_RT9-Jan-09 1:35
Hamid_RT9-Jan-09 1:35 
GeneralRe: [Message Deleted] Pin
Stuart Dootson9-Jan-09 1:24
professionalStuart Dootson9-Jan-09 1:24 
GeneralRe: [Message Deleted] Pin
Hamid_RT9-Jan-09 1:35
Hamid_RT9-Jan-09 1:35 
QuestionHow to get/put(VARIANT newVal) ?? Pin
komofilms8-Jan-09 21:30
komofilms8-Jan-09 21:30 
AnswerRe: How to get/put(VARIANT newVal) ?? Pin
Randor 8-Jan-09 22:01
professional Randor 8-Jan-09 22:01 
AnswerRe: How to get/put(VARIANT newVal) ?? Pin
Stuart Dootson8-Jan-09 22:11
professionalStuart Dootson8-Jan-09 22:11 
Here's an example of creating a SAFEARRAY of doubles and returning it through an output parameter (as you have in your get_ArrayTest method):

SAFEARRAYBOUND saBound[2] = { {10, 0}, {5, 0} };
pSA = ::SafeArrayCreate(VT_R8, 2, saBound);

for(int i=0;i<10;++i)
   {
   for(int j=0;j<5;++j)
   {
      static long indices[2];
      indices[0] = i;
      indices[1] = j;
      double value = i *5 + j;
      ::SafeArrayPutElement(pSA, indices, (void*)&value);
   }
}

pVal->vt = VT_ARRAY|VT_R8;
V_ARRAY(pVal) = pSA;


Accessing a SAFEARRAY is similar - you use SafeArrayGetElement rather than SafeArrayPutElement and don't need to create or destroy the array.

The vt member of the VARIANT holding the array should define the type of the array as shown, with a VT_type defining the element type, ORed with VT_ARRAY. SafeArrayGetVartype interrogates the SAFEARRAY to get the element type directly.

HTH!!!
GeneralRe: How to get/put(VARIANT newVal) ?? Pin
komofilms14-Jan-09 1:28
komofilms14-Jan-09 1:28 
QuestionHow to inverse a variable in bit level? Pin
Joseph Marzbani8-Jan-09 21:14
Joseph Marzbani8-Jan-09 21:14 
AnswerRe: How to inverse a variable in bit level? Pin
Randor 8-Jan-09 21:42
professional Randor 8-Jan-09 21:42 
JokeRe: How to inverse a variable in bit level? Pin
Cedric Moonen8-Jan-09 21:58
Cedric Moonen8-Jan-09 21:58 
GeneralRe: How to inverse a variable in bit level? Pin
Randor 8-Jan-09 23:05
professional Randor 8-Jan-09 23:05 
GeneralRe: How to inverse a variable in bit level? Pin
toxcct8-Jan-09 23:49
toxcct8-Jan-09 23:49 
GeneralRe: How to inverse a variable in bit level? Pin
Randor 8-Jan-09 23:55
professional Randor 8-Jan-09 23:55 
GeneralRe: How to inverse a variable in bit level? Pin
toxcct9-Jan-09 0:00
toxcct9-Jan-09 0:00 
GeneralRe: How to inverse a variable in bit level? Pin
Randor 9-Jan-09 0:09
professional Randor 9-Jan-09 0:09 
GeneralRe: How to inverse a variable in bit level? Pin
toxcct10-Jan-09 22:57
toxcct10-Jan-09 22:57 
AnswerRe: A plain approach Pin
CPallini8-Jan-09 22:44
mveCPallini8-Jan-09 22:44 
GeneralRe: A plain approach Pin
Iain Clarke, Warrior Programmer9-Jan-09 0:16
Iain Clarke, Warrior Programmer9-Jan-09 0:16 
JokeRe: A plain approach Pin
CPallini9-Jan-09 0:28
mveCPallini9-Jan-09 0:28 
GeneralRe: A plain approach Pin
Randor 9-Jan-09 1:05
professional Randor 9-Jan-09 1:05 
GeneralRe: A plain approach Pin
CPallini9-Jan-09 1:43
mveCPallini9-Jan-09 1:43 
GeneralRe: How to inverse a variable in bit level? Pin
Luc Pattyn9-Jan-09 2:51
sitebuilderLuc Pattyn9-Jan-09 2:51 
QuestionPotential problem with 'typedef redefinition' Pin
6Qing888-Jan-09 20:27
6Qing888-Jan-09 20:27 

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.