WOHW#82786 Overflow bij Excel export MJOB

svn path=/Slnkxlsx/trunk/; revision=64046
This commit is contained in:
Jos Groot Lipman
2024-03-25 15:09:52 +00:00
parent e0af00d154
commit 45b0878412
5 changed files with 31 additions and 27 deletions

View File

@@ -7,7 +7,7 @@
STDMETHODIMP CWorksheet::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* const arr[] =
static const IID* const arr[] =
{
&IID_IWorksheet
};
@@ -40,7 +40,7 @@ STDMETHODIMP CWorksheet::SetName(BSTR sheetname)
return S_OK;
}
STDMETHODIMP CWorksheet::freeze_panes(USHORT row, USHORT col)
STDMETHODIMP CWorksheet::freeze_panes(ULONG row, USHORT col)
{
if (!m_worksheet)
return invalid();
@@ -49,7 +49,7 @@ STDMETHODIMP CWorksheet::freeze_panes(USHORT row, USHORT col)
return S_OK;
}
STDMETHODIMP CWorksheet::write_string(USHORT row, USHORT col, BSTR string, ULONG format, LONG *pVal)
STDMETHODIMP CWorksheet::write_string(ULONG row, USHORT col, BSTR string, ULONG format, LONG *pVal)
{
if (!m_worksheet)
return invalid();
@@ -76,7 +76,7 @@ STDMETHODIMP CWorksheet::write_string(USHORT row, USHORT col, BSTR string, ULONG
return S_OK;
}
STDMETHODIMP CWorksheet::write_number(USHORT row, USHORT col, DOUBLE number, ULONG format)
STDMETHODIMP CWorksheet::write_number(ULONG row, USHORT col, DOUBLE number, ULONG format)
{
if (!m_worksheet)
return invalid();
@@ -96,7 +96,7 @@ STDMETHODIMP CWorksheet::write_number(USHORT row, USHORT col, DOUBLE number, ULO
return S_OK;
}
STDMETHODIMP CWorksheet::write_unixtime(USHORT row, USHORT col, LONG64 unixtime, ULONG format)
STDMETHODIMP CWorksheet::write_unixtime(ULONG row, USHORT col, LONG64 unixtime, ULONG format)
{
if (!m_worksheet)
return invalid();
@@ -128,7 +128,7 @@ unsigned int unix_stamp_of_DATE(DATE date)
SYSTEMTIME st;
VariantTimeToSystemTime(date, &st);
//convert SYSTEMTIME to FILETIME
//convert SYSTEMTIME to FILETIME
FILETIME ft;
SystemTimeToFileTime(&st, &ft);
@@ -139,7 +139,7 @@ unsigned int unix_stamp_of_DATE(DATE date)
}
// In JavaScript gebruik je new Date().getVarDate();
STDMETHODIMP CWorksheet::write_vardate(USHORT row, USHORT col, DATE date, ULONG format)
STDMETHODIMP CWorksheet::write_vardate(ULONG row, USHORT col, DATE date, ULONG format)
{
if (!m_worksheet)
return invalid();
@@ -165,7 +165,7 @@ STDMETHODIMP CWorksheet::set_column_width(USHORT col, DOUBLE number, ULONG forma
return S_OK;
}
STDMETHODIMP CWorksheet::write_formula(USHORT row, USHORT col, BSTR string, ULONG format)
STDMETHODIMP CWorksheet::write_formula(ULONG row, USHORT col, BSTR string, ULONG format)
{
if (!m_worksheet)
return invalid();
@@ -188,7 +188,7 @@ STDMETHODIMP CWorksheet::write_formula(USHORT row, USHORT col, BSTR string, ULON
return S_OK;
}
STDMETHODIMP CWorksheet::insert_image(USHORT row, USHORT col, BSTR path, ULONG format)
STDMETHODIMP CWorksheet::insert_image(ULONG row, USHORT col, BSTR path, ULONG format)
{
if (!m_worksheet)
return invalid();
@@ -198,7 +198,7 @@ STDMETHODIMP CWorksheet::insert_image(USHORT row, USHORT col, BSTR path, ULONG f
return S_OK;
}
STDMETHODIMP CWorksheet::write_comment(USHORT row, USHORT col, BSTR string)
STDMETHODIMP CWorksheet::write_comment(ULONG row, USHORT col, BSTR string)
{
if (!m_worksheet)
return invalid();

View File

@@ -30,15 +30,15 @@ interface IAbout : IDispatch{
]
interface IWorksheet : IDispatch{
[id(1)] HRESULT SetName([in] BSTR sheetname);
[id(2), helpstring("method freeze_panes")] HRESULT freeze_panes(USHORT row, USHORT col);
[id(3), helpstring("method write_string")] HRESULT write_string(USHORT row, USHORT col, BSTR string, [in, defaultvalue(0)] ULONG format, [out, retval] LONG* pVal);
[id(4), helpstring("method write_number")] HRESULT write_number(USHORT row, USHORT col, DOUBLE number, [in, defaultvalue(0)] ULONG format);
[id(5), helpstring("method write_unixtime")] HRESULT write_unixtime(USHORT row, USHORT col, LONG64 unixtime, [in, defaultvalue(0)] ULONG format);
[id(6)] HRESULT write_vardate(USHORT row, USHORT col, DATE date, [in, defaultvalue(0)] ULONG format);
[id(2), helpstring("method freeze_panes")] HRESULT freeze_panes(ULONG row, USHORT col);
[id(3), helpstring("method write_string")] HRESULT write_string(ULONG row, USHORT col, BSTR string, [in, defaultvalue(0)] ULONG format, [out, retval] LONG* pVal);
[id(4), helpstring("method write_number")] HRESULT write_number(ULONG row, USHORT col, DOUBLE number, [in, defaultvalue(0)] ULONG format);
[id(5), helpstring("method write_unixtime")] HRESULT write_unixtime(ULONG row, USHORT col, LONG64 unixtime, [in, defaultvalue(0)] ULONG format);
[id(6)] HRESULT write_vardate(ULONG row, USHORT col, DATE date, [in, defaultvalue(0)] ULONG format);
[id(7), helpstring("method set_column_width")] HRESULT set_column_width(USHORT col, DOUBLE number, [in, defaultvalue(0)] ULONG format);
[id(8), helpstring("method write_comment")] HRESULT write_comment(USHORT row, USHORT col, BSTR string);
[id(9), helpstring("method write_formula")] HRESULT write_formula(USHORT row, USHORT col, BSTR string, [in, defaultvalue(0)] ULONG format);
[id(10), helpstring("method insert_image")] HRESULT insert_image(USHORT row, USHORT col, [in] BSTR filename, [in, defaultvalue(0)] ULONG format);
[id(8), helpstring("method write_comment")] HRESULT write_comment(ULONG row, USHORT col, BSTR string);
[id(9), helpstring("method write_formula")] HRESULT write_formula(ULONG row, USHORT col, BSTR string, [in, defaultvalue(0)] ULONG format);
[id(10), helpstring("method insert_image")] HRESULT insert_image(ULONG row, USHORT col, [in] BSTR filename, [in, defaultvalue(0)] ULONG format);
};
[
object,

View File

@@ -1,6 +1,6 @@
// Zorg dat versies alfabetisch altijd op elkaar volgen!
#define SLNK_MAJOR_VERSION 1
#define SLNK_MINOR_VERSION 00
#define SLNK_MINOR_VERSION 01
#define SLNK_BUILD_VERSION 0
// Define resource strings

View File

@@ -59,15 +59,15 @@ private:
public:
CWorkbook *my_workbook; // waar hij onder valt
STDMETHOD(SetName)(BSTR sheetname);
STDMETHOD(freeze_panes)(USHORT row, USHORT col);
STDMETHOD(write_string)(USHORT row, USHORT col, BSTR string, ULONG format, LONG *pVal);
STDMETHOD(write_number)(USHORT row, USHORT col, DOUBLE number, ULONG format);
STDMETHOD(write_unixtime)(USHORT row, USHORT col, LONG64 unixtime, ULONG format);
STDMETHOD(write_vardate)(USHORT row, USHORT col, DATE date, ULONG format);
STDMETHOD(freeze_panes)(ULONG row, USHORT col);
STDMETHOD(write_string)(ULONG row, USHORT col, BSTR string, ULONG format, LONG *pVal);
STDMETHOD(write_number)(ULONG row, USHORT col, DOUBLE number, ULONG format);
STDMETHOD(write_unixtime)(ULONG row, USHORT col, LONG64 unixtime, ULONG format);
STDMETHOD(write_vardate)(ULONG row, USHORT col, DATE date, ULONG format);
STDMETHOD(set_column_width)(USHORT col, DOUBLE number, ULONG format);
STDMETHOD(write_comment)(USHORT row, USHORT col, BSTR string);
STDMETHOD(write_formula)(USHORT row, USHORT col, BSTR string, ULONG format);
STDMETHOD(insert_image)(USHORT row, USHORT col, BSTR path, ULONG format);
STDMETHOD(write_comment)(ULONG row, USHORT col, BSTR string);
STDMETHOD(write_formula)(ULONG row, USHORT col, BSTR string, ULONG format);
STDMETHOD(insert_image)(ULONG row, USHORT col, BSTR path, ULONG format);
};
OBJECT_ENTRY_AUTO(__uuidof(Worksheet), CWorksheet)

View File

@@ -1,5 +1,6 @@
oAbout = new ActiveXObject("SLNKXLSX.About");
WScript.Echo(oAbout.DLLPath);
WScript.Echo(oAbout.VersionString);
var oExcel = new ActiveXObject("SLNKXLSX.Excel");
@@ -40,4 +41,7 @@ oWs.set_column_width(2, len / 10, 1);
//var oWs = oWb.add_worksheet("Sheet2");
oWs.insert_image(6, 0, "fa-coffee 16x16.png");
oWs.write_string(65536, 0, "Deze cell moet ook beschrijfbaar zijn");
oWb.workbook_close();