I downloaded the Excel file reading program from pudn. The compilation failed at the beginning, mainly because of the location definition of the loop variable, which is a good solution!
However, after compilation, an error occurs when you run the program:
An unhandled exception occurs in 0x1026ed6a (msvcr90d. dll) in excelaccess.exe: 0xc0000005: Access conflict when the read location is 0x00000000.
The error code is as follows:
[CPP]
View plaincopy
- Lplogfont cpptooltip: getsystemtooltipfont () const
- {
- Static logfont;
- Nonclientmetrics NCM;
- Zeromemory (& NCM, sizeof (nonclientmetrics ));
- NCM. cbsize = sizeof (nonclientmetrics );
- If (0 = systemparametersinfo (spi_getnonclientmetrics, sizeof (nonclientmetrics), & NCM, 0 ))
- {
- Trace ("error of systemparametersinfo is % d/R/N", getlasterror ());
- Return false;
- }
- Memcpy (& logfont, & (NCM. lfstatusfont), sizeof (logfont ));
- Return & logfont;
- }
If the systemparametersinfo () function fails to run, zero is returned. getlasterror () also returns zero.
Modification method:
NCM. cbsize = sizeof (nonclientmetrics)-sizeof (NCM. ipaddedborderwidth );
Cause:
Since Vista and Windows Server 2008, nonclientmetrics adds the ipaddedborderwidth field at the end.
If the program plans to support both Vista and XP, Windows 2000, and Windows Server 2003, call getversionex () to check the Windows version and then determine whether to subtract sizeof (NCMS. ipaddedborderwidth ).
I downloaded the Excel file reading program from pudn. The compilation failed at the beginning, mainly because of the location definition of the loop variable, which is a good solution!
However, after compilation, an error occurs when you run the program:
An unhandled exception occurs in 0x1026ed6a (msvcr90d. dll) in excelaccess.exe: 0xc0000005: Access conflict when the read location is 0x00000000.
The error code is as follows:
[CPP]
View plaincopy
- Lplogfont cpptooltip: getsystemtooltipfont () const
- {
- Static logfont;
- Nonclientmetrics NCM;
- Zeromemory (& NCM, sizeof (nonclientmetrics ));
- NCM. cbsize = sizeof (nonclientmetrics );
- If (0 = systemparametersinfo (spi_getnonclientmetrics, sizeof (nonclientmetrics), & NCM, 0 ))
- {
- Trace ("error of systemparametersinfo is % d/R/N", getlasterror ());
- Return false;
- }
- Memcpy (& logfont, & (NCM. lfstatusfont), sizeof (logfont ));
- Return & logfont;
- }
If the systemparametersinfo () function fails to run, zero is returned. getlasterror () also returns zero.
Modification method:
NCM. cbsize = sizeof (nonclientmetrics)-sizeof (NCM. ipaddedborderwidth );
Cause:
Since Vista and Windows Server 2008, nonclientmetrics adds the ipaddedborderwidth field at the end.
If the program plans to support both Vista and XP, Windows 2000, and Windows Server 2003, call getversionex () to check the Windows version and then determine whether to subtract sizeof (NCMS. ipaddedborderwidth ).