Subversion Repositories spk

Rev

Rev 298 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 298 Rev 300
Line 6... Line 6...
6
using namespace System::Drawing;
6
using namespace System::Drawing;
7
 
7
 
8
#define CONNECTERROR_UNKNOWN	-1
8
#define CONNECTERROR_UNKNOWN	-1
9
enum {CONNECTERROR_NONE, CONNECTERROR_TIMEOUT, CONNECTERROR_NOFILE, CONNECTERROR_FAILED};
9
enum {CONNECTERROR_NONE, CONNECTERROR_TIMEOUT, CONNECTERROR_NOFILE, CONNECTERROR_FAILED};
10
 
10
 
11
inline Utils::String _S(System::String^ str)
-
 
12
{
-
 
13
	if (!str || !str->Length)
-
 
14
		return "";
-
 
15
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
-
 
16
	std::string s = chars;
-
 
17
	Marshal::FreeHGlobal(IntPtr((void*)chars));
-
 
18
	return s;
-
 
19
}
-
 
20
inline Utils::WString _WS(System::String^ str)
11
inline Utils::WString _WS(System::String^ str)
21
{
12
{
22
	if (!str || !str->Length)
13
	if (!str || !str->Length)
23
		return L"";
14
		return L"";
24
	const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(str)).ToPointer();
15
	const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(str)).ToPointer();