Subversion Repositories spk

Rev

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

Rev 242 Rev 298
Line 1... Line 1...
1
// stdafx.h : include file for standard system include files,
1
// stdafx.h : include file for standard system include files,
2
// or project specific include files that are used frequently, but
2
// or project specific include files that are used frequently, but
3
// are changed infrequently
3
// are changed infrequently
4
#pragma once
4
#pragma once
5
 
5
 
-
 
6
#ifdef _WIN32
6
#include <CyString.h>
7
#include <windows.h>
-
 
8
#endif
7
#include <Utils/WString.h>
9
#include <Utils/WString.h>
8
#include "../../common/InputBox.h"
10
#include "../../common/InputBox.h"
9
 
11
 
10
using namespace System;
12
using namespace System;
11
using namespace System::Runtime::InteropServices;
13
using namespace System::Runtime::InteropServices;
12
 
14
 
13
 
-
 
14
inline CyString CyStringFromSystemString( System::String ^str)
-
 
15
{
-
 
16
	if ( !str || !str->Length )
-
 
17
		return NullString;
-
 
18
	const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(str)).ToPointer();
-
 
19
	std::string s = chars;
-
 
20
	Marshal::FreeHGlobal(IntPtr((void*)chars));
-
 
21
	return CyString(s);
-
 
22
}
-
 
23
 
-
 
24
inline System::String ^SystemStringFromCyString ( CyString str )
-
 
25
{
-
 
26
	System::String ^Str = gcnew System::String(str.c_str());
-
 
27
	return Str;
-
 
28
}
-
 
29
 
15
 
30
inline System::String^ _US(const Utils::WString& str)
16
inline System::String^ _US(const Utils::WString& str)
31
{
17
{
32
	System::String^ Str = gcnew System::String(str.c_str());
18
	System::String^ Str = gcnew System::String(str.c_str());
33
	return Str;
19
	return Str;