1/31/2017

Including VTK when building opencv

First, we download VTK and build it.
http://www.vtk.org/download/

and
We set the path where VTK is built, when we build opencv.


Note that, we need to include the build path, not the installed path.

http://cvlecture.marearts.com/2016/12/opencv-build-shared-opencv.html
If you go to the above address, I have built VTK 7.1.
And new content will continue to be added.

Good luck!

1/11/2017

MFC, CIPAddressCtrl ctrol, ip address set, get, using BYTE and CString


usage for CIPAddressCtrl  in mfc

< gist code >

< end >

1/03/2017

In MFC, File exist check and delete the file, example source code.



If file exist then delete the file, example source code in MFC

< github code >
___

MFC Encode / Decode example souce code



WtoC function code is here
http://study.marearts.com/2017/01/unicode-cstring-convert-to-char.html

And refer to GetMacAddress code
http://study.marearts.com/2017/01/get-mac-address-in-mfc.html

Encode code
//

..

Decode code
//

..

Unicode CString convert to char *

The returned char * will need to be freed after use.


< gist code start >

< gist code end >


#tags
wchar_t, WtoC, WideCharToMultiByte, WideCharToMultiByte

useful site for CString converting


http://www.flounder.com/cstring.htm#Converting%20a%20CString%20to%20an%20integer


Get Mac Address in MFC


GetMacAddress in MFC

Get by using GetAdaptersInfo function
//

..
Get by using ip address
//If localhost -> GetMacAddress(_T("*"));
//if have ip -> GetMacAddress(_T("192.168.1.1"));//

..


1/02/2017

CString to string


..
string CstringToString(CString str)
{
    CT2CA pszConvertedAnsiString(str);
    std::string s(pszConvertedAnsiString);

    return s;
}
..