Home > Software engineering >  VS2012 reading excel data to the double arrays
VS2012 reading excel data to the double arrays

Time:10-07

I want to use MFC read excel data, and then the data stored in an array of type double for subsequent processing, due to the amount of data is large, see said on the BBS with SafeArrayAccessData () function to read speed is much faster, so try to provide some methods in accordance with the BBS to try, but can't read it out all the time, I on the MFC, is not very good imitation of predecessors to try, so the question a lot, beg god to help me see where is wrong?

The following is an example of need to deal with and try to use the code,



Void GetData (double * PDBL)
{
The VARIANT v1.

M_range=m_sheet. Get_UsedRange ();

V1=m_range. Get_Value2 ();

M_range. ReleaseDispatch ();

SafeArrayAccessData (v1. Parray (void * *) & amp; PBSTR);

SafeArrayUnaccessData (v1. Parray);
}

CodePudding user response:

This is only a few lines, where to call a lot,,,, with libxl library, 10 a few lines of code can be read out

CodePudding user response:

http://blog.csdn.net/sunnyloves/article/details/9996669

CodePudding user response:

Can consider to save as in Excel. CSV
  • Related