본문 바로가기
반응형

vc++97

[VC++/MFC] CString to char * 와 char * to CString CString -> char * CString str; str = "Hello"; char* ss = LPSTR(LPCTSTR(str)); char * --> CString char ss[] = "Hello"; CString str; str.Format("%s", ss); (Format대신에 GetBuffer()를 써도 됩니다.) 지식인! Environment: Compiled using VC6.0 Sp3 and tested using Win95/98 WinNT4.0 and Win 2000 Here are a few data Conversions with small examples :- PART ONE :- DECIMAL CONVERSIONS Decimal To Hexa :- Use _itoa( ) fu.. 2010. 9. 30.
[VC++] ATL에서 MFC사용, COM관련 확장, MDAC, ADSI사용 1. stdafx.h 파일에 #include 위에 아래와 같이 include 하면 됩니다. 2. 필요에 따라 프로젝트 속성 - 링커 - 입력에 comsvcs.lib activeds.lib adsiid.lib wininet.lib 를 추가합니다. ///////////////////////////////////////////////////////////////////////////// // EOCS_ADD ///////////////////////////////////////////////////////////////////////////// // - MFC 지원 #include // MFC 자동화 클래스입니다. - 코어 및 표준 컴포넌트 #include // MFC 자동화 클래스입니다. - 확장 #incl.. 2010. 9. 29.
[VC++] MultibyteToWideChar int MultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar) 1. CodePage - 변환할 코드 페이지 보통 CP_ACP를 사용합니다. ANSI 코드 페이지를 사용하겠다는 거죠 2. dwFlags - 어떤 캐릭터 형태로 변환할 것인지를 지정합니다. 보통 MB_PRECOMPOSED 를 사용합니다. 완성형으로 변환을 하겠다는 거죠. 3. lpMultiByteStr - 유니코드로 변환할 문자열의 포인터입니다. 4. cbMultiByte - 위의 문자열의 길이입니다. 5. lpWideCharStr - 변환된 문자열을 받아들일 유니코드.. 2010. 9. 28.
[개발] VC++ IWebBrowser2 IHTMLDocument2 상호변환 1. IWebBrowser2 에서 IHTMLDocument2 인터페이스 구하기 IWebBrowser2 *m_pWebFromUnknown; IWebBrowser2 *m_pWebFromDoc; STDMETHODIMP CTestObj::SetSite( IUnknown *pUnkSite ) { IOleClientSite *pClientSite; HRESULT hr; hr = pUnkSite-> QueryInterface( IID_IOleClientSite, (LPVOID *)&pClientSite ); if ( FAILED( hr ) ) return S_OK; IOleContainer *pContainer; hr = pClientSite-> GetContainer( &pContainer ); pClientSit.. 2010. 9. 14.
[개발/웹] VC++ ATL을 이용한 Scriptable ActiveX 제작 A Complete Scriptable ActiveX Web Control Tutorial using ATL By Arif Zaman | 18 Dec 2007 | Unedited contribution An article on Scriptable ActiveX Web Control using ATL Is your email address OK? You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmation email sent so we can confirm your e.. 2010. 9. 13.
[VC++] 문자열변환 CString LPSTR WCHAR* LPCWSTR VC++의 문자열 변환중 CString에 관련된 몇가지를 알아보자. CString LPSTR WCHAR* LPCWSTR CString to LPSTR CollapseCString str = _T("My String"); int nLen = str.GetLength(); LPTSTR lpszBuf = str.GetBuffer(nLen); // here do something with lpszBuf........... str.ReleaseBuffer(); LPTSTR to LPWSTR int nLen = MultiByteToWideChar(CP_ACP, 0, lptStr, -1, NULL, NULL); MultiByteToWideChar(CP_ACP, 0, lptStr, -1, lpwStr, nLen); C.. 2010. 9. 10.
반응형