From b31ce95b3315c2b6567ed96c3e424e5c2a5e67f4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 1 Aug 2014 18:30:07 -0400 Subject: [PATCH] Fixed up more LPCWSTR->LPWSTR conversion, including some code simplification. --- redo/comctl32_windows.go | 11 +++-------- redo/table_windows.go | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/redo/comctl32_windows.go b/redo/comctl32_windows.go index 8d5e62e..f4a7620 100644 --- a/redo/comctl32_windows.go +++ b/redo/comctl32_windows.go @@ -6,12 +6,13 @@ import ( "fmt" "io/ioutil" "syscall" - "unsafe" ) // #include "winapi_windows.h" import "C" +// TODO possibly rewrite the whole file access bits in C + // pretty much every constant here except _WM_USER is from commctrl.h, except where noted /* @@ -39,19 +40,13 @@ func initCommonControls() (err error) { var errmsg *C.char - errcode := C.initCommonControls(C.LPWSTR(unsafe.Pointer(syscall.StringToUTF16Ptr(filename))), &errmsg) + errcode := C.initCommonControls(toUTF16(filename), &errmsg) if errcode != 0 || errmsg != nil { return fmt.Errorf("error actually initializing comctl32.dll: %s: %v", C.GoString(errmsg), syscall.Errno(errcode)) } return nil } -// Common Controls class names. -const ( - // x (lowercase) prefix to avoid being caught by the constants generator - x_PROGRESS_CLASS = "msctls_progress32" -) - var manifest = []byte(`