Boost logo

Boost Users :

From: Christian Hoffmann (Christian.Hoffmann_at_[hidden])
Date: 2004-07-21 12:25:06


Hello...

We have problems here passing the boost::filesystem::native function as
a checker on
WIN32 platform, eg. like this
...
        boost::filesystem::path path ("d:\hello\hello",
boost::filesystem::native);
...

When we take the address of the function
"boost::filesystem::native(...)" in dll A and the pass it to boost
filesystem dll,
the various comparisons with "native" inside
path_posix_windows.cpp:m_path_append ( const std::string & src,
name_check checker ) fail, and
and the code throws an invalid name exception.

(e.g. line 242: if ( (checker == no_check || checker == native) &&
src.size() >= 2 )
 fails as checker != native)

The microsoft compiler takes the address into an internal function
table,
instead of the adress of the "real" boost::filesystem::native ()
function, so the comparison can never be true.

Anybody got an idea what to do?

PS: Getting the address of the native function like this works:

path ("d:\hello\hell",
reinterpret_cast<boost::filesystem::path::name_check>
                                      (GetProcAddress
(GetModuleHandle("boost_filesystem-vc71-mt-gd-1_31"),
        
"?native_at_filesystem@boost@@YA_NABV?$basic_string_at_DU?$char_traits_at_D@std@@
V?$allocator_at_D@2@@std@@@Z")));

But is not really an option...

--
Christian Hoffmann
This message, including any attachments, is intended only for the person(s) to whom it is addressed. If you received it in error, please let us know and delete the message from your system. This message may be confidential and may fall under the duty of non-disclosure. Any use by others than the intended addressee is prohibited. Trema shall not be liable for any damage related to the electronic transmission of this message, such as failure or delay of its delivery, interception or manipulation by third parties, or transmission of viruses or other malicious code.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net