14 sprintf(strhr,
" HRESULT error code:0x%08x\n ", (
unsigned)hr);
16 dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
17 FORMAT_MESSAGE_FROM_SYSTEM |
18 FORMAT_MESSAGE_IGNORE_INSERTS,
20 MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
21 (LPTSTR)&p_msg, 0,
NULL);
23 dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
24 FORMAT_MESSAGE_FROM_SYSTEM |
25 FORMAT_MESSAGE_IGNORE_INSERTS,
27 (LPTSTR)&p_msg, 0,
NULL);
30 term = p_msg +
strlen(p_msg);
31 while (p_msg < term) {
33 if (*term ==
'\r' || *term ==
'\n')
37 if (p_msg[0] !=
'\0') {
55 err_msg = ole_hresult2msg(hr);
VALUE eWIN32OLERuntimeError
#define va_init_list(a, b)
size_t strlen(const char *)
VALUE rb_exc_new_str(VALUE etype, VALUE str)
void ole_raise(HRESULT hr, VALUE ecs, const char *fmt,...)
VALUE rb_str_cat2(VALUE, const char *)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
typedef HRESULT(STDAPICALLTYPE FNCOCREATEINSTANCEEX)(REFCLSID
void Init_win32ole_error(void)
VALUE rb_vsprintf(const char *, va_list)
VALUE rb_str_append(VALUE, VALUE)