c++.stlsoft - One more bug in 1.8.1
- "Pablo Aguilar" <paguilarg hotmail.com> Oct 05 2004
- "Matthew" <admin.hat stlsoft.dot.org> Oct 08 2004
- "Matthew" <admin stlsoft.dot.dot.dot.dot.org> Feb 02 2005
- "Pablo Aguilar" <paguilarg hotmail.com> Feb 03 2005
I'm using winstl_module and the function module::get_handle() isn't
implemented!
It's a one liner, so I guess it's easy to forget... or is winstl_module not
ready for public use yet?
BTW, I'd done one of these before, and had given it an extra function (extra
as in "besides just loading/unloading"):
template<typename FnType>
bool get_fn(char const* fn_name, FnType& fn) const
{
assert(m_dll != NULL);
fn = reinterpret_cast<FnType>(GetProcAddress(m_dll, fn_name));
return (fn != NULL);
}
So all you do is use:
void (*run)() = NULL;
if( updater.get_fn("run", run) )
run();
Where run can be of any type... it's not that great but it saves you the
typedef or the double typing when getting a function's address.
Oct 05 2004
"Pablo Aguilar" <paguilarg hotmail.com> wrote in message news:cjvfib$13ti$1 digitaldaemon.com...I'm using winstl_module and the function module::get_handle() isn't implemented! It's a one liner, so I guess it's easy to forget... or is winstl_module not ready for public use yet?
Fixed. Silly me, eh?BTW, I'd done one of these before, and had given it an extra function (extra as in "besides just loading/unloading"): template<typename FnType> bool get_fn(char const* fn_name, FnType& fn) const { assert(m_dll != NULL); fn = reinterpret_cast<FnType>(GetProcAddress(m_dll, fn_name)); return (fn != NULL); } So all you do is use: void (*run)() = NULL; if( updater.get_fn("run", run) ) run(); Where run can be of any type... it's not that great but it saves you the typedef or the double typing when getting a function's address.
That's a nice idea.
Oct 08 2004
This is now in winstl::module. I've also enhanced the class so that it can participate in copy construction, by ref-counting the underlying module (via GetModuleFileName and LoadLibrary). This'll be in 1.8.3. "Pablo Aguilar" <paguilarg hotmail.com> wrote in message news:cjvfib$13ti$1 digitaldaemon.com...I'm using winstl_module and the function module::get_handle() isn't implemented! It's a one liner, so I guess it's easy to forget... or is winstl_module not ready for public use yet? BTW, I'd done one of these before, and had given it an extra function (extra as in "besides just loading/unloading"): template<typename FnType> bool get_fn(char const* fn_name, FnType& fn) const { assert(m_dll != NULL); fn = reinterpret_cast<FnType>(GetProcAddress(m_dll, fn_name)); return (fn != NULL); } So all you do is use: void (*run)() = NULL; if( updater.get_fn("run", run) ) run(); Where run can be of any type... it's not that great but it saves you the typedef or the double typing when getting a function's address.
Feb 02 2005
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message news:cts8ud$1p3q$1 digitaldaemon.com...This is now in winstl::module. I've also enhanced the class so that it can participate in copy construction, by ref-counting the underlying module (via GetModuleFileName and LoadLibrary). This'll be in 1.8.3.
Great!
Feb 03 2005









"Matthew" <admin.hat stlsoft.dot.org> 