'Visual Studio'에 해당되는 글 7건

  1. 2016.03.29 Python 설치
  2. 2015.08.11 CString to const char*
  3. 2015.07.20 C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
  4. 2015.06.24 VC : Find Results not displaying Results
  5. 2015.06.24 OpenCV warning C4819 current code page (949)
  6. 2015.06.10 OpenCV 3.0 extra module C2589: '(': token not valid to the right error
  7. 2015.05.22 CFileDialog cannot convert const char [22] to LPCTSTR

Python 설치

할거리/Python 2016. 3. 29. 13:23

Python

1. 우선 나무위키를 읽어보고

- 누가 만들었는지

- 어떤 특징이 있는지

- 어느 정도 사용되고 있는지


2. 파이썬 공식홈에 가서 다운

- 버전 2와 버전 3가 있는데 호환성이 없어서 선택해야 한다.

- 아직 잘 모르니까 3으로 일단 간다

- 3부터 Unicode 지원. 2에서 3으로 가는 추세라고 하니까....


3. 다운 받은 것 설치

- 설치 폴더

C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\

여기에 설치되는데 띄어쓰기를 하면,

C: / Users / Administrator / AppData / Local / Programs / Python / Python35-32 / Python.exe

- 당연히 path 도 추가해주어야 한다.


4. 개발 환경?

여기 참조 : http://yaraba.tistory.com/173




- VC에서 사용할 수 있단다 : PTVS ( Python Tools for Visual Studio )

https://github.com/Microsoft/PTVS/releases/v2.2


5. PTVS 설치

- PTVS 2.2 VS 2015.msi 파일 설치한다


6. VC 실행해서 새 프로젝트 열면

좌측에 Python 메뉴가 추가되고, Python app을 만들수 있게 된다.


error C2664: cannot convert argument 1 from 'CString' to 'const char *'


CString str = ---

int nLen = str.GetLength();

char *ch = new char[nLen];

  WideCharToMultiByte(CP_ACP, 0, str, -1, ch, nLen + 1, NULL, NULL);

  --- << ch 사용 >> ---

delete[] ch;

C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

solution :

http://stackoverflow.com/questions/6167609/some-problem-with-afxmessagebox-mfc-function


(1)

You may, although I doubt this, have to scope it globally. To do that, try

::AfxMessageBox("Camera have no connection",MB_OK|MB_ICONSTOP);


(2)

The other is that use are building for unicode and it thinks the string is multi-byte. To do that, try

AfxMessageBox( L"Camera have no connection",MB_OK|MB_ICONSTOP);

I'm out of town, on my Mac, so I can't test this. But I have been stuck in the office on weekends so I figured I'd offer up two things to try.



VC에서 Find 했는데, 결과 표시가 되지 않는다면?


해결 : 

http://stackoverflow.com/questions/13386856/find-results-not-displaying-results


[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]

여기 가면, 아마 빈칸이 있을것.

@="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\TextMgrP.dll"

이 항목 추가하면 된다.



opencv2/core/mat.hpp(1965): 

warning C4819: 

The file contains a character that cannot be represented in the current code page (949).

Save the file in Unicode format to prevent data loss



Solution: 

File Save As...

Unicode UTF-8 with signature Codepage 65001


http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

OpenCV v3.0 컴파일 진행중에...

OpenCV\opencv_contrib\modules\text\src\erfilter.cpp  파일에서,

p = std::numeric_limits<double>::min();


C2589: '(': token not valid to the right '::'

이런 에러가 나오고 멈춘다.


http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

min() 이 부분이 

minwindef.h
#define min(a,b)            (((a) < (b)) ? (a) : (b))

위와 같이 연결되니까, 당연히 (a,b)가 없다고 에러가 나올수 밖에.


Solution :

(1) OpenCV\opencv_contrib\modules\text\src\precomp.hpp 파일안에,

// added by Michael : 2015-06-10

#if defined WIN32 || defined WINCE

    #if !defined _WIN32_WINNT

        #ifdef HAVE_MSMF

            #define _WIN32_WINNT 0x0600 // Windows Vista

        #else

            #define _WIN32_WINNT 0x0500 // Windows 2000

        #endif

    #endif


    #include <windows.h>

    #undef small

    #undef min

    #undef max

    #undef abs

#endif

제일 아래쪽에 위 코드 추가한다.
즉, window.h 추가하고나서, #undef min 을 해버리면 된다.



(2) 번째 방법은, 
#NOMINMAX
#include <windows.h>

windows.h 추가하기 전에 #NOMINMAX 해버리면, min, max 정의하지 않으므로 OK


-끝.

CFileDialog *d;

d = new CFileDialog(

                TRUE, NULL,  NULL, 

                OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,

"All Files (*.*)|*.*||" );


Error 7 error C2664: 'CFileDialog::CFileDialog(const CFileDialog &)' : cannot convert argument 5 from 'const char [22]' to 'LPCTSTR' c:\delpapp\app\howto\gerberplot\gerberplotdlg.cpp 454 1 GerberPlot


해결 :


TCHAR szFilter[] = _T("All Files (*.*)|*.*||");

d = new CFileDialog(

                TRUE, NULL,  NULL, 

                OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,

szFilter);

1 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!