'할거리/VC'에 해당되는 글 6건

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

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!