본문 바로가기

Code

(117)
Display Number on Tray Icon LRESULT CMainFrame::OnUserTray(WPARAM wParam, LPARAM lParam) { CMenu menu, *pSubMenu; if (LOWORD(lParam) == WM_LBUTTONDOWN) { CString str("369048"); CString str1 = str.Left(3); CString str2 = str.Right(3); LPTSTR pstr1 = str1.GetBuffer(str1.GetLength()); LPTSTR pstr2 = str2.GetBuffer(str2.GetLength()); LPWSTR wstr1 = new WCHAR[4]; LPWSTR wstr2 = new WCHAR[4]; int len1 = MultiByteToWideChar(CP_AC..
[C++/CLI] Marshalling : System::String^ <-> const char* #include #include using namespace System; using namespace msclr::interop; int main(array ^args) { { // System::String^ to const char* marshal_context^ context = gcnew marshal_context(); String^ message = gcnew String("System::String^ to const char*"); const char* result = context->marshal_as(message); puts(result); delete context; } { // const char* to System::String^ const char* message = "cons..
[C++] polymorphism.h #pragma once #include #include #include #ifdef _UNICODE #define tcout wcout #define tcin wcin #else #define tcout cout #define tcin cin #endif #ifdef _UNICODE #define tstring wstring #else #define tstring string #endif #ifdef _UNICODE #define tregex wregex #define tcmatch wcmatch #define tsmatch wsmatch #else #define tregex regex #define tcmatch cmatch #define tsmatch smatch #endif
[Hybrid] C#, C++/CLI, Win32 DLL Lib C# Console C++/CLI DLL Win32 Console Win32 DLL Win32 Static Lib C#, C++/CLI, Win32 DLL Lib 을 사용하는 Hybrid Programming 예제입니다.
[C++/CLI] Marshaling in C++ Overview of Marshaling in C++ http://msdn.microsoft.com/library/bb384865.aspx marshal_context Class http://msdn.microsoft.com/library/bb384854.aspx marshal_as http://msdn.microsoft.com/library/bb384859.aspx How to: Extend the Marshaling Library http://msdn.microsoft.com/library/bb531313.aspx
[C++] How to: Convert Between Various String Types 'CString' to 'std::string': CString cs("Hello"); std::string s((LPCTSTR)cs); 'std::string' to 'CString': std::string s("Hello"); CString cs(s.c_str()); 1. CString -> std::string CString str = "hello"; std::string stdStr = str.GetBuffer(0); 2. std::string -> CString std::string stdStr = "hello"; CString str = stdStr.c_str(); How to: Convert Between Various String Types http://msdn.microsoft.com/l..
[C++] Win32 DLL Lib Project Sample Win32 Console Win32 DLL Win32 Static Lib Win32 DLL Lib Project Sample 입니다. 안에 내용을 보시고 참고하시기 바랍니다.
[C++] vector shared_ptr sample #include #include #include #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { vector svec; svec.push_back(shared_ptr(new string("aaa"))); svec.push_back(shared_ptr(new string("bbb"))); svec.push_back(shared_ptr(new string("ccc"))); for(vector::iterator it = svec.begin(); it != svec.end(); it++) cout