Subversion Repositories spk

Rev

Rev 191 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 191 Rev 242
Line 8... Line 8...
8
#include "../../common/InputBox.h"
8
#include "../../common/InputBox.h"
9
 
9
 
10
using namespace System;
10
using namespace System;
11
using namespace System::Runtime::InteropServices;
11
using namespace System::Runtime::InteropServices;
12
 
12
 
-
 
13
 
13
inline CyString CyStringFromSystemString( System::String ^str)
14
inline CyString CyStringFromSystemString( System::String ^str)
14
{
15
{
15
	if ( !str || !str->Length )
16
	if ( !str || !str->Length )
16
		return NullString;
17
		return NullString;
17
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
18
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
Line 29... Line 30...
29
inline System::String^ _US(const Utils::WString& str)
30
inline System::String^ _US(const Utils::WString& str)
30
{
31
{
31
	System::String^ Str = gcnew System::String(str.c_str());
32
	System::String^ Str = gcnew System::String(str.c_str());
32
	return Str;
33
	return Str;
33
}
34
}
-
 
35
 
-
 
36
inline Utils::WString _WS(System::String^ str)
-
 
37
{
-
 
38
	if (!str || !str->Length)
-
 
39
		return L"";
-
 
40
	const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(str)).ToPointer();
-
 
41
	std::wstring s = chars;
-
 
42
	Marshal::FreeHGlobal(IntPtr((void*)chars));
-
 
43
	return s;
-
 
44
}