X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=dll%2Fwin32%2Foledlg%2Fpastespl.c;h=0b8c8c95a150be7d0c08f005c74d3a6934200cd5;hp=2a5765d16dfcd1b2d332553e923efcf70cc4013a;hb=4abf2277a10d72fa7dc36bf9f4fd0726a94b5bf6;hpb=49ab546ac39e559c2b5b544994e527f6c616a346 diff --git a/dll/win32/oledlg/pastespl.c b/dll/win32/oledlg/pastespl.c index 2a5765d16df..0b8c8c95a15 100644 --- a/dll/win32/oledlg/pastespl.c +++ b/dll/win32/oledlg/pastespl.c @@ -18,7 +18,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#define NONAMELESSUNION + +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wingdi.h" +#include "winuser.h" +#include "winnls.h" +#include "oledlg.h" + #include "oledlg_private.h" +#include "resource.h" + +#include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -165,14 +182,14 @@ static void get_descriptors(HWND hdlg, ps_struct_t *ps_struct) if(ps_struct->source_name == NULL && ps_struct->link_source_name == NULL) { WCHAR buf[200]; - LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_SRC, buf, sizeof(buf)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_SRC, buf, ARRAY_SIZE(buf)); ps_struct->source_name = strdupW(buf); } if(ps_struct->type_name == NULL && ps_struct->link_type_name == NULL) { WCHAR buf[200]; - LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_TYPE, buf, sizeof(buf)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_PS_UNKNOWN_TYPE, buf, ARRAY_SIZE(buf)); ps_struct->type_name = strdupW(buf); } } @@ -211,7 +228,7 @@ static DWORD init_pastelist(HWND hdlg, OLEUIPASTESPECIALW *ps) } /* The native version grabs only the first 20 fmts and we do the same */ - hr = IEnumFORMATETC_Next(penum, sizeof(fmts)/sizeof(fmts[0]), fmts, &fetched); + hr = IEnumFORMATETC_Next(penum, ARRAY_SIZE(fmts), fmts, &fetched); TRACE("got %d formats hr %08x\n", fetched, hr); if(SUCCEEDED(hr)) @@ -414,7 +431,7 @@ static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct) res_id = IDS_PS_PASTE_LINK_DATA; } - LoadStringW(OLEDLG_hInstance, res_id, resource_txt, sizeof(resource_txt)/sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, res_id, resource_txt, ARRAY_SIZE(resource_txt)); if((ptr = strstrW(resource_txt, percent_s))) { /* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropriate type name */ @@ -693,7 +710,7 @@ UINT WINAPI OleUIPasteSpecialW(LPOLEUIPASTESPECIALW ps) HRSRC hrsrc; if(name == NULL) return OLEUI_ERR_LPSZTEMPLATEINVALID; - hrsrc = FindResourceW(hInst, name, MAKEINTRESOURCEW(RT_DIALOG)); + hrsrc = FindResourceW(hInst, name, (LPWSTR)RT_DIALOG); if(!hrsrc) return OLEUI_ERR_FINDTEMPLATEFAILURE; dlg_templ = LoadResource(hInst, hrsrc); if(!dlg_templ) return OLEUI_ERR_LOADTEMPLATEFAILURE;