This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include "CGetLastError.h" | |
void main() | |
{ | |
// snip | |
SetLastError(111); // create a error 111 (ERROR_BUFFER_OVERFLOW) for demo | |
// Message Box with a text associated to 111(ERROR_BUFFER_OVERFLOW) appears. | |
// In English: "The file name is too long." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern void MyOpen(LPCSTR name); | |
void MyFunc(CStringW name){ | |
MyOpen(CW2A(name)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int Sum1(const int in) { | |
printf("Sum1 input=%d\n", in); | |
return in; | |
} | |
int Sum2(const int in) { | |
printf("Sum2 input=%d\n", in); | |
return in; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int p = 0; | |
int sum; | |
char buff[128]; | |
sum = (p++) + (p++); | |
printf("sum=%d p=%d\n", sum, p); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int Sum(const int in) { | |
printf("input=%d\n", in); | |
return in; | |
} | |
int main() | |
{ | |
int p = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CChangeFileNameGUIDlg::GetDirName(CEdit* pEdit) | |
{ | |
IFileDialog *pDialog=NULL; | |
HRESULT hr; | |
DWORD options; | |
// インスタンス生成 | |
hr = CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDialog)); | |
if (FAILED(hr)) | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef WINVER // Windows Vista 以降のバージョンに固有の機能の使用を許可します。 | |
#define WINVER 0x0600 // これを Windows の他のバージョン向けに適切な値に変更してください。 | |
#endif | |
#ifndef _WIN32_WINNT // Windows Vista 以降のバージョンに固有の機能の使用を許可します。 | |
#define _WIN32_WINNT 0x0600 // これを Windows の他のバージョン向けに適切な値に変更してください。 | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CImage img; | |
cv::Mat tmp; | |
int i; | |
size_t matPitch; | |
uchar *pTmpData; | |
BYTE *pImgData; | |
matPitch = tmp.cols*tmp.elemSize(); | |
pTmpData = tmp.data + (img.GetHeight()-1)*matPitch; | |
pImgData = (BYTE*)img.GetBits(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CRect targetRect; | |
CImage img; | |
cv::Mat tmp; | |
pWnd->GetClientRect(&targetRect); | |
img.Create(targetRect.Width(), targetRect.Height(), 24); | |
/* snip some codes */ | |
// 画像イメージ変換 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matchTemplate(src, ptn, dst, CV_TM_CCOEFF_NORMED); | |
minMaxLoc(dst, NULL, &max_val, NULL, &max_loc); | |
if(max_val>0.98){ // srcとptnがほぼ一致してたら、何かする | |
} |