| | |
| | | <ClInclude Include="..\project\viewobject\saleorder.view.hpp" /> |
| | | <ClInclude Include="..\project\viewobject\shoppingcart.view.hpp" /> |
| | | <ClInclude Include="..\project\viewobject\supplier.view.hpp" /> |
| | | <ClInclude Include="..\xframe\adt\xarray.hpp" /> |
| | | <ClInclude Include="..\xframe\kobject\kapp.hpp" /> |
| | | <ClInclude Include="..\xframe\kobject\kbase.hpp" /> |
| | | <ClInclude Include="..\xframe\kobject\kcachemgr.hpp" /> |
| | |
| | | <ClInclude Include="..\xframe\vbusiness\vframe\maint.vframe.vbusiness.hpp" /> |
| | | <ClInclude Include="..\xframe\vbusiness\vframe\responsewin.vframe.vbusiness.hpp" /> |
| | | <ClInclude Include="..\xframe\vbusiness\vutil\publiccode.vutil.vbusiness.hpp" /> |
| | | <ClInclude Include="..\xframe\win32\win.hpp" /> |
| | | <ClInclude Include="..\xframe\win32\xfile.hpp" /> |
| | | <ClInclude Include="..\xframe\wobject\xapp.hpp" /> |
| | | <ClInclude Include="..\xframe\wobject\xaserver.hpp" /> |
| | | <ClInclude Include="..\xframe\wobject\xaserverarg.hpp" /> |
| | |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\quote.enquiry.cpp" /> |
| | | <ClCompile Include="..\project\business\quote.enquiry.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
| | | </ClCompile> |
| | | <ClCompile Include="..\project\business\Quote3.list3.cpp"> |
| | | <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild> |
| | | </ClCompile> |
| | |
| | | } |
| | | |
| | | //ç¦ç¹æ¿æ´»å¤ç彿° |
| | | int OnSetFocus(ref TEvent evt, int param) |
| | | int OnSetFocus(TEvent* evt, LPARAM param) |
| | | { |
| | | //é置工å
·æ¡ |
| | | SetAgent(); |
| | |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/TO/template/param", L"TemplateID", id); |
| | | |
| | | xml sheet ; |
| | | sheet.setNativePointer(x.CreateInstance()); |
| | | sheet.loadXML(x.selectSingleNode(L"data/*").xml); |
| | | |
| | | dw_cell.LoadTemplate(sheet); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | static stdcall int GetModuleFileName(int hModule, xstring lpFileName, int nSize) native from "kernel32.dll" alias "GetModuleFileNameW"; |
| | | static stdcall int PathRemoveFileSpec(xstring lpFileName) native from "shlwapi.dll" alias "PathRemoveFileSpecW"; |
| | | |
| | | xstring GetModulePath() |
| | | { |
| | | xstring str = L""; |
| | | str = str.space(255); |
| | | GetModuleFileName(0, str, 250); |
| | | PathRemoveFileSpec(str); |
| | | return str; |
| | | } |
| | | |
| | | xstring GetModuleTmpPath() |
| | | { |
| | | xstring str = L""; |
| | | str = str.space(255); |
| | | GetModuleFileName(0, str, 250); |
| | | PathRemoveFileSpec(str); |
| | | xstring tmp = str + L"\\Temp"; |
| | | xaserver::CreateDirectory(tmp); |
| | | return tmp; |
| | | } |
| | | |
| | | xstring UploadImage(xstring guid) |
| | | { |
| | | return UploadImage(guid, L""); |
| | |
| | | { |
| | | xstring name = guid + L".jpg"; |
| | | xstring str = name.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | int ret = 1; |
| | | if (filename != L"") |
| | | ret = xaserver::Upload(L"product" + str, name, filename, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, filename, GetHWND(), L"", false); |
| | | else |
| | | ret = xaserver::Upload(L"product" + str, name, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name.c_str(), GetHWND(), L"", false); |
| | | if (ret == -1) return L""; |
| | | if (ret == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | xutil::SmallImage(appPath+L"\\"+name,appPath+L"\\"+L"x_"+name,120,120); |
| | | int ret_1 = xaserver::Upload(L"product"+str, L"x_"+name,appPath+L"\\x_"+name, this.GetHWND(),L"",false); |
| | | int ret_1 = xaserver::Upload(L"product"+str, L"x_"+name,appPath+L"\\x_"+name, GetHWND(),L"",false); |
| | | //xaserver::DeleteFile(appPath+L"x_"+name); |
| | | //xaserver::DeleteFile(appPath+name); |
| | | if(ret_1 != 1) |
| | |
| | | { |
| | | xstring name = guid + L".jpg"; |
| | | xstring str = name.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | int ret = 1; |
| | | if (filename != L"") |
| | | ret = xaserver::Upload(L"product" + str, name, filename, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, filename, GetHWND(), L"", false); |
| | | else |
| | | ret = xaserver::Upload(L"product" + str, name, this.GetHWND(), L"", false); |
| | | ret = xaserver::Upload(L"product" + str, name, GetHWND(), L"", false); |
| | | if (ret == -1) return L""; |
| | | if (ret == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | xutil::SmallImage(appPath + L"\\" + name, appPath + L"\\" + L"x_" + name, 120, 120); |
| | | int ret_1 = xaserver::Upload(L"product" + str, L"x_" + name, appPath + L"\\x_" + name, this.GetHWND(), L"", false); |
| | | int ret_1 = xaserver::Upload(L"product" + str, L"x_" + name, appPath + L"\\x_" + name, GetHWND(), L"", false); |
| | | //xaserver::DeleteFile(appPath+L"x_"+name); |
| | | //xaserver::DeleteFile(appPath+name); |
| | | if (ret_1 != 1) |
| | |
| | | // "JPEG æä»¶(*.jpg)\0*.jpg;*.jpeg;*.png;*.gif;*.bmp\0å
¨é¨æä»¶(*.*)\0*.*\0", |
| | | // "jpg"); |
| | | |
| | | char[] szFileName = new char[4096]; |
| | | char[] szPath = new char[4096]; |
| | | wchar_t szFileName[4096]; |
| | | wchar_t szPath[4096]; |
| | | szFileName[0] = 0; |
| | | szPath[0] = 0; |
| | | |
| | | if (initFileName != L"") |
| | | { |
| | | int len = initFileName.length(); |
| | | char[] tmp = initFileName; |
| | | const wchar_t* tmp = initFileName.c_str(); |
| | | for (int i = 0; i < len + 1; i++) |
| | | { |
| | | //szFileName[i] = tmp[i]; |
| | | szPath[i] = tmp[i]; |
| | | } |
| | | } |
| | | |
| | | int nFilterIndex = 1; |
| | | ref OPENFILENAMEW ofn = new OPENFILENAMEW; |
| | | OPENFILENAMEW ofn; |
| | | |
| | | ofn.lStructSize = 88;//sizeof(ofn); |
| | | ofn.hwndOwner = 0; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellSelectChanged(ref TNotifyEvent evt, int p) |
| | | int OnCellSelectChanged(TEvent*, LPARAM p) |
| | | { |
| | | /*ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | xstring colname=hdr.colname; |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnItemChanged(ref TNotifyEvent evt, int p) |
| | | int OnItemChanged(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | xstring colname = hdr.colname; |
| | |
| | | xstring res = L"/sale/data/productlibrary3/pref/picture/imagelistskuno"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | ClearImageTerm(row, L"customer-photo"); |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | int lenp = nlistp.length(); |
| | | int ip = 0; |
| | |
| | | xstring res = L"/sale/data/ProductLibrary3/pref/picture/imagelistItemNo"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | ClearImageTerm(row, L"customer-photo"); |
| | | //alert(xp.GetXml()); |
| | | //alert(xp.xml()); |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | int lenp = nlistp.length(); |
| | | int ip = 0; |
| | |
| | | xstring GetExchangeRate(xstring pcur, xstring pdate) |
| | | { |
| | | |
| | | if (pcur.upper() == L"RMB") return L"1"; |
| | | if (pcur.toUpper() == L"RMB") return L"1"; |
| | | xstring exchangeRate = L""; |
| | | if (exchangeRate == L"") { |
| | | xml x = ViewObject::RetrieveData(L"/sale/data/GDN3/profit/param", L"item", L"cryrate"); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | int OnRowChanged(ref TNotifyEvent evt, int p) |
| | | int OnRowChanged(TEvent* evt, LPARAM p) |
| | | { |
| | | ref DWNMHDR hdr = trust(evt.pnmh as ref DWNMHDR); |
| | | DWNMHDR& hdr = *(DWNMHDR * )evt->notify.pnmh; |
| | | int row = hdr.row; |
| | | |
| | | return OnQuoteLineChanged(row); |
| | |
| | | int OnQuoteLineChanged(int row) |
| | | { |
| | | ximageview im = GetControl(L"im1"); |
| | | im.ResetEx(); |
| | | im.Reset(); |
| | | //xstring skuno = dw_goods.GetItemString(row,L"SKUNo"); |
| | | //OnShowImage(skuno,row); |
| | | //im.Redraw(); |
| | |
| | | ximageview im = GetControl(L"im1"); |
| | | |
| | | xml xp ; |
| | | xp.setNativePointer(xml::CreateInstance()); |
| | | xaserverarg arg_pic ; |
| | | arg_pic.setNativePointer(arg_pic.CreateInstance()); |
| | | arg_pic.AddArg(L"SKUNo", skuno); |
| | | |
| | | xstring res = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo"; |
| | |
| | | bool hasIamge = false; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | |
| | | res = L"/sale/data/ProductLibrary3/pref/picture/imagelistSKUNo"; |
| | | if (xurl::get(res, arg_pic.GetString(), xp) != 1) |
| | | { |
| | | trace(xp.GetXml()); |
| | | trace(xp.xml()); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | nlistp = xp.selectNodes(L"ImageList/image"); |
| | | lenp = nlistp.length(); |
| | | for (ip = 0; ip < lenp; ip++) |
| | | KXMLDOMNodeList nlistp = xp.selectNodes(L"ImageList/image"); |
| | | long lenp = nlistp.length(); |
| | | for (int ip = 0; ip < lenp; ip++) |
| | | { |
| | | xitem = nlistp.item(ip); |
| | | picname = xitem.selectSingleNode(L"PicPath").text(); |
| | | goodno = xitem.selectSingleNode(L"GoodsNo").text(); |
| | | KXMLDOMNode xitem = nlistp.item(ip); |
| | | xstring picname = xitem.selectSingleNode(L"PicPath").text(); |
| | | xstring goodno = xitem.selectSingleNode(L"GoodsNo").text(); |
| | | if (picname == L"/business/products/Thumbs//") |
| | | picname = L"/business/products/Thumbs/00/00000000-0000-0000-0000-000000000000.jpg"; |
| | | im.AddImages(picname, goodno); |
| | |
| | | int OnUpdateProcessed() |
| | | { |
| | | int ret = ProcessSendMessage(L"/task/quote/update-processed", taskid, L"", L"", false); |
| | | win32::PostMessage(GetFrameWindow().GetHWND(), 0x401, L"xmRefreshTask", 0); |
| | | PostMessage(GetFrameWindow().GetHWND(), 0x401, (WPARAM)L"xmRefreshTask", 0); |
| | | return ret; |
| | | } |
| | | |
| | |
| | | if (filename == L"" || saveas) |
| | | { |
| | | xaserverarg arg ; |
| | | |
| | | arg.AddArg(L"src", myurl); |
| | | OpenWindow(L"dev:xpage[trade.document.saveas.vx]", cast(arg as int)); |
| | | OpenWindow(L"dev:xpage[trade.document.saveas.vx]", arg); |
| | | if (arg.GetArgString(L"result") == L"ok") |
| | | { |
| | | sfilename = arg.GetArgString(L"filename"); |
| | |
| | | xstring sguid = publiccode::GetGuid(); |
| | | xstring sname = sguid; |
| | | xstring str = sname.mid(0, 2); |
| | | str = str.upper(); |
| | | str = str.toUpper(); |
| | | xstring suri = L"attachment" + str; |
| | | int ret = xaserver::UploadData(suri, sguid + L".jpg", content); |
| | | if (ret < 0) |
| | |
| | | } |
| | | |
| | | xml x ; |
| | | |
| | | xaserverarg args ; |
| | | args.setNativePointer(args.CreateInstance()); |
| | | args.AddArg(L"myurl", myurl); |
| | |
| | | else |
| | | { |
| | | filename = sfilename; |
| | | win32::SetWindowText(GetHWND(), L"æ¥ä»·æä»¶:" + filename); |
| | | SetWindowText(GetHWND(), L"æ¥ä»·æä»¶:" + filename); |
| | | alert(x.text()); |
| | | } |
| | | |
| | |
| | | |
| | | int SendCtrlCmd(xcontrol xc, xstring cmd) |
| | | { |
| | | win32::SendMessage(xc.GetId(), 0x401, cmd, 0); |
| | | SendMessage(xc.GetHWND(), 0x401, cmd, 0); |
| | | return 1; |
| | | } |
| | | |
| | | int OnCellClicked(ref TNotifyEvent evt, int p) |
| | | int OnCellClicked(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | int row = dwhdr.row; |
| | |
| | | } |
| | | |
| | | |
| | | int OnCellClicked1(ref TNotifyEvent evt, int p) |
| | | int OnCellClicked1(TEvent*, LPARAM p) |
| | | { |
| | | ref DWNMHDR dwhdr = cast(evt.pnmh as ref DWNMHDR); |
| | | int row = dwhdr.row; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | |
| | | #include "system/base.hpp" |
| | | #include "wobject/xobject.hpp" |
| | | #include "wobject/xstring.hpp" |
| | | |
| | | template<class T> |
| | | class xarray : public xobject |
| | | { |
| | | public: |
| | | xarray(length_(0), capacity_(0),itemms(nullptr){ |
| | | } |
| | | public: |
| | | xarray*push_back(T t) |
| | | { |
| | | sure_space(); |
| | | |
| | | items[length_] = t; |
| | | ++length_; |
| | | return this; |
| | | } |
| | | |
| | | xarray* pop_back() |
| | | { |
| | | if (length() > 0) |
| | | erase(length() - 1); |
| | | return this; |
| | | } |
| | | |
| | | xarray* erase(int index) |
| | | { |
| | | if (index < 0 || index > length_ - 1) |
| | | { |
| | | //throw("..."); |
| | | return this; |
| | | } |
| | | //move data |
| | | for (int i = index; i < length_ - 1; i++)items[i] = items[i + 1]; |
| | | --length_; |
| | | return this; |
| | | } |
| | | |
| | | xarray* insert_before(int index, T t) |
| | | { |
| | | sure_space(); |
| | | |
| | | if (index < 0) |
| | | { |
| | | for (int i = 0; i < length_ - 1; i++)items[i] = items[i + 1]; |
| | | items[0] = t; |
| | | return this; |
| | | } |
| | | if (index >= length_) |
| | | { |
| | | items[length_] = t; |
| | | ++length_; |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | xarray* insert_after(int index, T t) |
| | | { |
| | | return insert_before(index + 1, t); |
| | | } |
| | | |
| | | T back() |
| | | { |
| | | if (length_) |
| | | return items[length_ - 1]; |
| | | return 0; |
| | | } |
| | | |
| | | T front() |
| | | { |
| | | if (length_) |
| | | return items[0]; |
| | | return 0; |
| | | } |
| | | |
| | | int length() |
| | | { |
| | | return length_; |
| | | } |
| | | |
| | | T item(int index) |
| | | { |
| | | if (index >= 0 && index < length_) return items[index]; |
| | | return 0; |
| | | } |
| | | |
| | | int find(T t) |
| | | { |
| | | for (int i = 0; i < length_; i++) |
| | | { |
| | | if (items[i] == t) return i; |
| | | } |
| | | return -1; |
| | | } |
| | | private: |
| | | bool sure_space() |
| | | { |
| | | if (length_ == capacity_) |
| | | { |
| | | if (!items) |
| | | { |
| | | items = new T[2]; |
| | | capacity_ = 2; |
| | | } |
| | | else |
| | | { |
| | | capacity_ = capacity_ * 2; |
| | | T* temp = new T[capacity_]; |
| | | //å¯ä»¥ä¼å为æ·è´æä½ |
| | | for (int i = 0; i < length_; ++i) |
| | | { |
| | | temp[i] = items[i]; |
| | | } |
| | | delete items; |
| | | items = temp; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | private: |
| | | T* items; |
| | | int length_; |
| | | int capacity_; |
| | | }; |
| | |
| | | static int trace(LPCTSTR pstr); |
| | | public: |
| | | int Run(); |
| | | |
| | | }; |
| | | }} |
| | |
| | | |
| | | #define WINAPI __stdcall |
| | | |
| | | #define SendMessage SendMessageW |
| | | #define PostMessage PostMessageW |
| | | #define GetWindowLong GetWindowLongW |
| | | #define SetWindowLong SetWindowLongW |
| | | #define MessageBox MessageBoxW |
| | | |
| | | extern "C" |
| | | { |
| | | void WINAPI SysFreeString(BSTR str);//OleAut32.dll |
| | |
| | | |
| | | int WINAPI GetTempPathW(int NAME_LEN,string & OutPath) ;//native from "kernel32.dll" alias "GetTempPathW"; |
| | | int WINAPI GetModuleHandleW(string lpModuleName) ;//native from "kernel32.dll" alias "GetModuleHandleW"; |
| | | int WINAPI GetModuleFileName(int hModule ,string & lpFileName ,int nSize ) ;//native from "kernel32.dll" alias "GetModuleFileName"; |
| | | int WINAPI GetModuleFileNameW(int hModule ,string lpFileName, int nSize);//native from "kernel32.dll" alias "GetModuleFileNameW"; |
| | | void WINAPI GetLocalTime(SYSTEMTIME& lpSystemTime) ;//native from "kernel32.dll" alias "GetLocalTime"; |
| | | int WINAPI PathRemoveFileSpecW(xstring lpFileName);// native from "shlwapi.dll" alias "PathRemoveFileSpecW"; |
| | | |
| | | } |
| | | #define SendMessage SendMessageW |
| | | #define PostMessage PostMessageW |
| | | #define GetWindowLong GetWindowLongW |
| | | #define SetWindowLong SetWindowLongW |
| | | #define MessageBox MessageBoxW |
| | | #define GetModuleFileName GetModuleFileNameW |
| | | #define PathRemoveFileSpec PathRemoveFileSpecW |
| | | #define SetWindowText SetWindowTextW |
| | | #define GetWindowText GetWindowTextW |
| | | |
| | | #if 0 |
| | | namespace win32 |
| | |
| | | int GetModuleHandleW(string lpModuleName) ;//native from "kernel32.dll" alias "GetModuleHandleW"; |
| | | int GetModuleFileName(int hModule ,string & lpFileName ,int nSize ) ;//native from "kernel32.dll" alias "GetModuleFileName"; |
| | | void GetLocalTime(SYSTEMTIME& lpSystemTime) ;//native from "kernel32.dll" alias "GetLocalTime"; |
| | | |
| | | } |
| | | #endif |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #pragma once |
| | | |
| | | #include "system/base.hpp" |
| | | #include "win.hpp" |
| | | |
| | | #define CALLBACK __stdcall |
| | | #define MAX_PATH 260 |
| | | typedef unsigned short WORD; |
| | | typedef unsigned int UINT; |
| | | typedef char CHAR; |
| | | typedef unsigned char BYTE; |
| | | typedef wchar_t WCHAR; |
| | | typedef void* HANDLE; |
| | | typedef const char* LPCSTR; |
| | | typedef void* LPVOID; |
| | | typedef DWORD* LPDWORD; |
| | | typedef const void* LPCVOID; |
| | | |
| | | typedef void* LPSECURITY_ATTRIBUTES; |
| | | typedef UINT_PTR(CALLBACK* LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM); |
| | | struct OPENFILENAMEW |
| | | { |
| | | DWORD lStructSize; |
| | | HWND hwndOwner; |
| | | HINSTANCE hInstance; |
| | | LPCWSTR lpstrFilter; |
| | | LPWSTR lpstrCustomFilter; |
| | | DWORD nMaxCustFilter; |
| | | DWORD nFilterIndex; |
| | | LPWSTR lpstrFile; |
| | | DWORD nMaxFile; |
| | | LPWSTR lpstrFileTitle; |
| | | DWORD nMaxFileTitle; |
| | | LPCWSTR lpstrInitialDir; |
| | | LPCWSTR lpstrTitle; |
| | | DWORD Flags; |
| | | WORD nFileOffset; |
| | | WORD nFileExtension; |
| | | LPCWSTR lpstrDefExt; |
| | | LPARAM lCustData; |
| | | LPOFNHOOKPROC lpfnHook; |
| | | LPCWSTR lpTemplateName; |
| | | |
| | | void* pvReserved; |
| | | DWORD dwReserved; |
| | | DWORD FlagsEx; |
| | | }; |
| | | |
| | | //FILETIMEç»æææç64使 符å·çæä»¶çæ¥æåæ¶é´å¼ã头æä»¶: WINDEF.H |
| | | struct FILETIME |
| | | { |
| | | int dwLowDateTime; // ä½ 32 ä½ |
| | | int dwHighDateTime; // é« 32 ä½ |
| | | }; |
| | | |
| | | #if 0 |
| | | struct fileinfo : public xstruct |
| | | { |
| | | char[128] szFileTitle; //æä»¶çæ é¢å |
| | | int dwFileAttributes; //æä»¶ç屿§ |
| | | FILETIME ftCreationTime; //æä»¶çå建æ¶é´ |
| | | FILETIME ftLastAccessTime; //æä»¶çæåè®¿é®æ¶é´ |
| | | FILETIME ftLastWriteTime; //æä»¶çæåä¿®æ¹æ¶é´ |
| | | int nFileSizeHigh; //æä»¶å¤§å°çé«ä½åå |
| | | int nFileSizeLow; //æä»¶å¤§å°çä½ä½åå |
| | | int dwReserved0; //ä¿çï¼ä¸º0 |
| | | int dwReserved1; //ä¿çï¼ä¸º0 |
| | | }; |
| | | #endif |
| | | |
| | | typedef struct _WIN32_FIND_DATAW { |
| | | DWORD dwFileAttributes; |
| | | FILETIME ftCreationTime; |
| | | FILETIME ftLastAccessTime; |
| | | FILETIME ftLastWriteTime; |
| | | DWORD nFileSizeHigh; |
| | | DWORD nFileSizeLow; |
| | | DWORD dwReserved0; |
| | | DWORD dwReserved1; |
| | | WCHAR cFileName[MAX_PATH]; |
| | | WCHAR cAlternateFileName[14]; |
| | | } WIN32_FIND_DATAW; |
| | | |
| | | typedef struct _OVERLAPPED { |
| | | ULONG_PTR Internal; |
| | | ULONG_PTR InternalHigh; |
| | | union { |
| | | struct { |
| | | DWORD Offset; |
| | | DWORD OffsetHigh; |
| | | } DUMMYSTRUCTNAME; |
| | | LPVOID Pointer; |
| | | } DUMMYUNIONNAME; |
| | | |
| | | HANDLE hEvent; |
| | | } OVERLAPPED, * LPOVERLAPPED; |
| | | |
| | | |
| | | #define OFS_MAXPATHNAME 128 |
| | | typedef struct _OFSTRUCT { |
| | | BYTE cBytes; |
| | | BYTE fFixedDisk; |
| | | WORD nErrCode; |
| | | WORD Reserved1; |
| | | WORD Reserved2; |
| | | CHAR szPathName[OFS_MAXPATHNAME]; |
| | | } OFSTRUCT; |
| | | |
| | | extern "C" |
| | | { |
| | | bool WINAPI GetSaveFileNameW(OPENFILENAMEW &);//native from "comdlg32.dll" alias "GetSaveFileNameW"; |
| | | bool WINAPI GetOpenFileNameW(OPENFILENAMEW&);//native from "comdlg32.dll" alias "GetOpenFileNameW"; |
| | | |
| | | HANDLE WINAPI FindFirstFileW(const WCHAR * lpFileName, WIN32_FIND_DATAW& lpFindFileData); //native from "kernel32.dll" alias "FindFirstFileW"; //æ ¹æ®æä»¶åæ¥æ¾æä»¶,䏿¦ä¸åéè¦ï¼åºè¯¥ç¨FindClose彿°å
³éè¿ä¸ªå¥æ |
| | | HANDLE WINAPI FindNextFileW(HANDLE hFindFile, WIN32_FIND_DATAW& lpFindFileData); //native from "kernel32.dll" alias "FindNextFileW"; //ç»§ç»æ¥æ¾FindFirstFile彿°æç´¢åçæä»¶ ,HANDLE hFindFileæç´¢çæä»¶å¥æ 彿°æ§è¡çæ¶åæç´¢çæ¯æ¤å¥æçä¸ä¸æä»¶ãéé¶è¡¨ç¤ºæåï¼é¶è¡¨ç¤ºå¤±è´¥ãå¦ä¸åæä¸æå®æ¡ä»¶ç¸ç¬¦çæä»¶ï¼ä¼å°GetLastError设置æERROR_NO_MORE_FILES |
| | | bool WINAPI FindClose(HANDLE hFindFile); //native from "kernel32.dll" alias "FindClose"; //å
³éç±FindFirstFile彿°å建çä¸ä¸ªæç´¢å¥æãè¿åéé¶è¡¨ç¤ºæåï¼é¶è¡¨ç¤ºå¤±è´¥ãä¼è®¾ç½®GetLastError |
| | | |
| | | int WINAPI CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); //native from "kernel32.dll" alias "CreateFileW"; |
| | | int WINAPI OpenFile(LPCSTR lpFileName, OFSTRUCT lpReOpenBuff, UINT wStyle); //native from "kernel32.dll" alias "OpenFile"; |
| | | int WINAPI SetFilePointer(HANDLE hFile, LONG lDistanceToMove, LONG* lpDistanceToMoveHigh, DWORD dwMoveMethod); //native from "kernel32.dll" alias "SetFilePointer"; |
| | | int WINAPI ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); //native from "kernel32.dll" alias "ReadFile"; |
| | | int WINAPI WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); //native from "kernel32.dll" alias "ReadFile"; |
| | | int WINAPI CloseHandle(HANDLE hFile); //native from "kernel32.dll" alias "CloseHandle"; |
| | | int WINAPI GetFileSize(HANDLE hFile, int lpFileSizeHigh); //native from "kernel32.dll" alias "GetFileSize"; |
| | | int WINAPI GetKeyState(HANDLE nVirtKey); //native from "user32.dll" alias "GetKeyState"; |
| | | } |
| | | |
| | | class xfile |
| | | { |
| | | bool WINAPI GetSaveFileName(OPENFILENAMEW& OpenFileName) |
| | | { |
| | | return GetSaveFileNameW(OpenFileName); |
| | | } |
| | | bool WINAPI GetOpenFileName(OPENFILENAMEW& SaveFileName) |
| | | { |
| | | return GetOpenFileName(SaveFileName); |
| | | } |
| | | |
| | | HANDLE WINAPI FindFirstFile(const WCHAR* lpFileName, WIN32_FIND_DATAW& lpFindFileData) |
| | | { |
| | | return FindFirstFileW(lpFileName, lpFindFileData); |
| | | } |
| | | |
| | | HANDLE WINAPI FindNextFile(HANDLE hFindFile, WIN32_FIND_DATAW& lpFindFileData) |
| | | { |
| | | return FindNextFileW(hFindFile, lpFindFileData); |
| | | } |
| | | bool WINAPI FindClose(HANDLE hFindFile) |
| | | { |
| | | return FindClose(hFindFile); |
| | | } |
| | | |
| | | int WINAPI CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) |
| | | { |
| | | return CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); |
| | | } |
| | | |
| | | int WINAPI OpenFile(LPCSTR lpFileName, OFSTRUCT lpReOpenBuff, UINT wStyle) |
| | | { |
| | | return OpenFile(lpFileName, lpReOpenBuff, wStyle); |
| | | } |
| | | int WINAPI SetFilePointer(HANDLE hFile, LONG lDistanceToMove, LONG* lpDistanceToMoveHigh, DWORD dwMoveMethod) |
| | | { |
| | | return SetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod); |
| | | } |
| | | int WINAPI ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) |
| | | { |
| | | return ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped); |
| | | } |
| | | int WINAPI WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) |
| | | { |
| | | return WriteFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped); |
| | | } |
| | | int WINAPI CloseHandle(HANDLE hFile) |
| | | { |
| | | return CloseHandle(hFile); |
| | | } |
| | | int WINAPI GetFileSize(HANDLE hFile, int lpFileSizeHigh) |
| | | { |
| | | return GetFileSize(hFile, lpFileSizeHigh); |
| | | } |
| | | int WINAPI GetKeyState(HANDLE nVirtKey) |
| | | { |
| | | return GetKeyState(nVirtKey); |
| | | } |
| | | }; |
| | |
| | | return kxaserver::UploadEx((LPTSTR)pUri, (LPTSTR)pName,m_hWnd, (LPTSTR)pSource,bCompress); |
| | | |
| | | } |
| | | static int Upload(LPTSTR pUri,LPTSTR pName,HWND m_hWnd,LPTSTR pSource=NULL,BOOL bCompress=false) |
| | | static int Upload(LPCTSTR pUri,LPCTSTR pName,HWND m_hWnd,LPCTSTR pSource=NULL,BOOL bCompress=false) |
| | | { |
| | | return kxaserver::Upload(pUri,pName,m_hWnd,pSource,bCompress); |
| | | return kxaserver::Upload((LPTSTR)pUri,(LPTSTR)pName,m_hWnd, (LPTSTR)pSource,bCompress); |
| | | } |
| | | |
| | | static int Upload(LPCTSTR pUri,LPCTSTR pName,LPCTSTR pPath,HWND m_hWnd,LPCTSTR pSource=NULL,BOOL bCompress=false) |
| | |
| | | { |
| | | return kxaserver::UploadFile((LPTSTR)pUri,(LPTSTR)pName,m_hWnd,(LPTSTR)pSource,bCompress); |
| | | } |
| | | static int __DeleteFile(LPTSTR pName) |
| | | static int DeleteFile(LPTSTR pName) |
| | | { |
| | | return kxaserver::__DeleteFile(pName); |
| | | } |
| | | static int __CreateDirectory(LPCTSTR pName) |
| | | static int CreateDirectory(LPCTSTR pName) |
| | | { |
| | | return kxaserver::__CreateDirectory((LPTSTR)pName); |
| | | } |
| | |
| | | public: |
| | | operator int() { return value; } |
| | | double toDouble() { return (double)value; } |
| | | xstring toString() { return (xstring(value); } |
| | | xstring toString() { return xstring(value); } |
| | | }; |
| | |
| | | return Hxsoft::XUtil::FormatDecimalString(str, format, bfree); |
| | | } |
| | | |
| | | public: |
| | | static xstring GetModulePath() |
| | | { |
| | | wchar_t buf[255]; |
| | | GetModuleFileName(0, buf, 255); |
| | | PathRemoveFileSpec(buf); |
| | | return xstring(buf); |
| | | } |
| | | |
| | | static xstring GetModuleTmpPath() |
| | | { |
| | | xstring tmp = GetModulePath() + L"\\Temp"; |
| | | xaserver::CreateDirectory(tmp); |
| | | return tmp; |
| | | } |
| | | |
| | | }; |