i have problem with this code here
C++ DLL
#include <iostream>
#include <windows.h>
#include <boost/filesystem.hpp>
#include <boost/thread/thread.hpp>
using namespace std;
using namespace boost::filesystem;
extern "C"
{
__declspec(dllexport) void IMSS_GetDirs(LPCSTR *value)
{
directory_iterator iterator(string("D:\\"));
for(; iterator != directory_iterator(); ++iterator)
{
*value = iterator->path().filename().string().c_str(); // Thats don't work , the c_str() convert to LPCSTR
MessageBoxA(NULL,iterator->path().filename().string().c_str(),"TEST",MB_OK); // Thats also work
}
*value = "Test"; // Thats Work
}
}
And the VB.NET Part
Private Declare Sub IMSS_GetDirs Lib "IMSS_SDFCCore.dll" _
(ByRef value As String)
Private Sub Button1_Click() Handles Button1.Click
IMSS_GetDirs(Label1.Text)
End Sub
So why when its get the value directly its work and when its get it by the directory_iterator does not work ?