7#ifndef CHAISCRIPT_WINDOWS_HPP_
8#define CHAISCRIPT_WINDOWS_HPP_
12#ifdef CHAISCRIPT_WINDOWS
14#if !defined(WIN32_LEAN_AND_MEAN)
15#define WIN32_LEAN_AND_MEAN
30 return std::wstring(t_str.begin(), t_str.end());
36 return std::string(t_str.begin(), t_str.end());
39#if defined(_UNICODE) || defined(UNICODE)
55 typedef LPTSTR StringType;
57#if defined(_UNICODE) || defined(UNICODE)
58 std::wstring retval =
L"Unknown Error";
60 std::string retval =
"Unknown Error";
62 StringType lpMsgBuf =
nullptr;
65 FORMAT_MESSAGE_ALLOCATE_BUFFER |
66 FORMAT_MESSAGE_FROM_SYSTEM |
67 FORMAT_MESSAGE_IGNORE_INSERTS,
70 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
71 reinterpret_cast<StringType
>(&lpMsgBuf),
72 0,
nullptr ) != 0 && lpMsgBuf)
83 explicit DLModule(
const std::string &t_filename)
109 :
m_symbol(reinterpret_cast<
T>(GetProcAddress(t_mod.m_data, t_symbol.c_str())))
127 DLSym<Create_Module_Func>
m_func;
Classes and functions reserved for internal use. Items in this namespace are not supported.
Namespace chaiscript contains every API call that the average user will be concerned with.
std::shared_ptr< Module > ModulePtr
Convenience typedef for Module objects to be added to the ChaiScript runtime.
Definition dispatchkit.hpp:263
Definition chaiscript_posix.hpp:17
~DLModule()
Definition chaiscript_windows.hpp:97
DLModule(const DLModule &)=delete
DLModule(DLModule &&)=default
void * m_data
Definition chaiscript_posix.hpp:37
DLModule & operator=(const DLModule &)=delete
DLModule & operator=(DLModule &&)=default
DLModule(const std::string &t_filename)
Definition chaiscript_windows.hpp:83
Definition chaiscript_posix.hpp:42
DLSym(DLModule &t_mod, const std::string &t_symbol)
Definition chaiscript_windows.hpp:108
T m_symbol
Definition chaiscript_posix.hpp:52
Definition chaiscript_posix.hpp:15
DLModule m_dlmodule
Definition chaiscript_posix.hpp:61
ModulePtr m_moduleptr
Definition chaiscript_posix.hpp:63
Loadable_Module(const std::string &t_module_name, const std::string &t_filename)
Definition chaiscript_windows.hpp:120
static std::wstring to_wstring(const T &t_str)
Definition chaiscript_windows.hpp:28
static std::string to_string(const T &t_str)
Definition chaiscript_windows.hpp:34
DLSym< Create_Module_Func > m_func
Definition chaiscript_posix.hpp:62
static std::string get_error_message(DWORD t_err)
Definition chaiscript_windows.hpp:53
static std::string to_proper_string(const T &t_str)
Definition chaiscript_windows.hpp:47
Thrown if an error occurs while attempting to load a binary module.
Definition chaiscript_common.hpp:138