본문 바로가기

VisualStudio.C++.C#/코딩팁,함수활용,단편   ( 160 )


MFC. Animation Control (CAnimateCtrl Class). AVI 파일 비디오만 재생. 개요. MFC Animation Control Animation Control 은 AVI 파일 오픈하여 비디오만 재생가능한 컨트롤. AVI 파일내의 오디오 재생못함. 주용도 : 통상 프로그램에서 간단한 애니메이션 표현하고 싶을 때 AVI파일 오픈하여 플레이 하는 용도. Toolbox 에서 대화상자로 배치시켜서 사용. CAnimateCtrl ClassFor the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.Provides the functionality of the Windows common animation control.SyntaxCopy class CAnimateCtrl : public C.. 2017. 3. 28.
error LNK2001: unresolved external symbol __imp_sprintf, symbol __imp_printf 해결방법. 오류증상. - error LNK2001 Visual C++ 최신버전 (2010이후 모든 버전) 에서 과거에 제작된 라이브러리 임포팅 시켜서 컴파일 하면, 아래와 같은 오류가 나오는 경우 있다. error LNK2001: unresolved external symbol __imp_sprintf error LNK2001: unresolved external symbol __imp_printf 원인 과거에 만들어진 라이브러리의 함수를 최신버전의 Visual C++ 에서 지원하지 않기때문.해결책.과거 라이브러리 지원 위한 legacy_stdio_definitions.lib 를 프로젝트 설정 Link 의 Input 에 추가하든지 코드상에서 아래 구문 추가한다. #pragma comment(lib,"legacy_s.. 2017. 3. 19.
Delay Loading DLL 개요 DLL 의 Implicit Linking 시 Delay Load 되게 하는 설정. 설명. Application에서 Immplicit Linking 방식으로 DLL 로딩하게되면 , Application 구동초기 해당 DLL로딩처리가 이뤄진다. Implicit Linking 에 부가하여 Delay Loading 방식 적용하면 DLL 의 함수가 첫 호출되는 시점에 로딩처리 이뤄진다. 관련. Implicit Linking 방식 DLL로딩 : http://igotit.tistory.com/471 Delay Loading DLL 통상 Implicit Linking 으로 DLL로딩시키는 아래 구문에서 파랑색 부분 추가하면 됨. #pragma comment(lib, "delayimp.lib") // delayim.. 2017. 3. 17.
AddDllDirectory Adds a directory to the process DLL search path. DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory( _In_ PCWSTR NewDirectory ); ParametersNewDirectory [in]An absolute path to the directory to add to the search path. For example, to add the directory Dir2 to the process DLL search path, specify \Dir2. For more information about paths, see Naming Files, Paths, and Namespaces.Return valueIf the function .. 2017. 3. 17.
SetDllDirectory Adds a directory to the search path used to locate DLLs for the application. BOOL WINAPI SetDllDirectory( _In_opt_ LPCTSTR lpPathName ); ParameterslpPathName [in, optional]The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is NULL, the function restores the default se.. 2017. 3. 17.
dll 파일로 lib 만들기. def 파일 만들고 그 다음 lib 파일 생성. dll 파일 이용하여 lib 파일 만드는 법. dll 파일로 def 파일 부터 먼저 만들고, def 파일로 lib 파일 만드는 2단계를 거치게 된다. 1. dll 파일로 def 파일 만들기. 본글의 예에서 사용된 dll 파일 : SLABHIDDevice.dll Visual Studio 실행하여 "메뉴 -> Tools -> Visual Studio Command Prompt" 클릭하여 실행된 커맨드 창에 아래 푸른색 라인처럼 구문 기록하여 엔터치면 동일폴더에 SLABHIDDevice.def 파일이 만들어진다. 2. def 파일을 이용하여 lib 파일 만들기. 별도 정리 -> http://igotit.tistory.com/1014 의 방법대로 하면 lib 파일 만들어진다. dumpbin MS제공정보 : ht.. 2017. 3. 13.
MFC. png 이미지 파일 읽기. CImage image; image.Load(_T("C:\\image.png")); // just change extension to load jpg CBitmap bitmap; bitmap.Attach(image.Detach()); from : http://stackoverflow.com/questions/2490661/how-to-load-png-jpeg-images-using-mfc ///1218. 2017. 2. 21.
MFC. 마우스. 마우스 커서 모양변경- 기본 제공되는 마우스 커서 모양 적용 시 아래 함수 호출. 기본 제공되는 마우스 모양 적용시. SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZENS)); 인자값에 따른 마우스 커서 모양. IDC_ARROW Standard arrow cursorIDC_IBEAM Standard text-insertion cursorIDC_WAIT Hourglass cursor used when Windows performs a time-consuming taskIDC_CROSS Cross-hair cursor for selectionIDC_UPARROW Arrow that points straight upIDC_SIZE Obsolete and unsuppor.. 2016. 11. 21.
MFC. picture control Picture Control 활용기본. Bitmap 표현하기. 1. 대화상자에 ToolBox 에서 Picture Control 선택하여 배치. 2. 배치된 Picture Control 의 속성창에서 ID 값 지정하기. 3. BMP 를 표현하기 위하여 Picture Control 속성중 Type 을 Bitmap 으로 선택. - Bitmap 으로 선택하면 대화상자에 배치한 Picture Control 의 모양이 아래처럼 변경된다. 4. Picture Control 속성창의 Image 에서 비트맵 아이디 선택한다. - 비트맵 아이디란 프로젝트 Resource View 의 Bitmap 으로 등록된 것의 아이디를 의미한다. 상세정보 : MFC 프로젝트 리소스에 Bitmap 추가하기 -> http://igotit... 2016. 11. 19.
def 파일로 lib 파일 만들기. DLL의 def 파일 이용하여 lib 파일 만들기. 예 : SQlite3.def 파일로 SQlite.lib 파일 만들기. Visual Studio 실행하여 "메뉴 -> Tools -> Visual Studio Command Prompt" 클릭하여 실행된 커맨드 창에 구문( lib /def:sqlite3.def /machine:x86 ) 타이핑하고 엔터하면 동일폴더에 sqlite3.lib파일이 만들어진다. ///1014. 2016. 10. 15.
memmove. 배열 시프트. memove(*dest, *src, bytesize) 1. 메모리 주소 *src 부터 bytesize만큼의 데이터를 주소 *dest 에 복사한다. - 내부동작 : *src 부터 bytesize만큼의 데이터 를 별도의 메모리에 옮겨뒀다가 *dest 지점 부터 복사 2. 상기 1의 특성 때문에 배열 요소의 시프트 처리시 유용. 배열 시프트 처리. 배열 int arr[100], 요소값들은 모두 오른쪽으로 1칸 이동시키는 경우, 1. for 루프를 사용하는 경우, for(i=0; i 2016. 10. 14.
MFC. User Interface Thread 구현. 개요. Visual C++ 에서 User Interface Thread 구현방법. 상황예. 프로젝트 CyFinAPI 에 2개의 클래스 CCyDevice2_Market_UIT (CWinThread를 베이스클래스로함), CCyDevice2_Market_UITDlg(CDialogEx를 베이스 클래스로 함) 신규생성. 상세. 단계1. 프로젝트에 CWinThread를 베이스로 하는 클래스 추가. 클래스 위저드에서 MFC Class 추가 선택하여, CWinThread를 베이스로 하는 CCyDevice2_Market_UIT 추가한다. 단계2. 프로젝트에 대화상자 추가. 상세방법 : http://igotit.tistory.com/480 과 동일하며 베이스클래스를 CDialogEx로하고, 클래스이름을 CCyDevice2.. 2016. 9. 22.
MFC.C/C++. 전역변수 선언방법. 모든 소스코드에서 인클루드 되는 헤더파일 ( 예 기본생성되어있는 stdafx.h 나 직접 추가한 global.h 등. ) 에 아래처럼 변수 선언하고, extern CString gFullPath_CyFinAPIDLL_FOLDER; cpp파일(예. 기본생성되어있는 stdafx.cpp 혹은 직접 추가한 global.cpp ) 에 아래처럼 선언한다. CString gFullPath_CyFinAPIDLL_FOLDER = _T(""); 개념명확화.전역변수 선언방법이라기 보다는 전역변수를 다른 소스에서 편하게 활용하기 설정이라는 표현이 정확하다. 즉, 상기 설명은 cpp 에 전역변수를 선언한 것이며, 다른 소스영역에서 전역변수를 사용하기 위해서는 해당 cpp 파일에서 아래처럼 extern 부착하여 해당변수 를 표식.. 2016. 9. 22.
MFC. CDialogEx, CDialog 개요 CDialogEx 는 CDialog 에서 파생된 클래스이며, 대화상자 배경색변경, 배경이미지 추가가 간편해진것이므로 기존 CDialog 로 생성하던 것을 CDialogEx 로 생성하는 것은 아무 문제 일으키지 않음. Public MethodsName Description CDialogEx::SetBackgroundColor Sets the background color of the dialog box. CDialogEx::SetBackgroundImage Sets the background image of the dialog box. Dialog box images are stored in a resource file. The framework automatically deletes any imag.. 2016. 9. 22.
VC++. ActiveX 활용하기. 멤버변수 연결하기. ActiveX 컨트롤 컨테이너. 1. ActiveX 컨트롤. ActiveX 컨트롤은 지속성, 연결 지점 및 호스팅과 관련된 표준 인터페이스를 지원하는 COM 구성 요소입니다. 이러한 표준 인터페이스는 컨트롤 컨테이너에서 컨트롤을 호스팅할 수 있는 프로토콜을 정의하고 메시지를 교환하고 이벤트를 처리합니다. ActiveX 컨트롤은 COM 서버로서 다음과 같은 요소를 포함합니다. 용어 설명 properties 컨트롤에는 내부 상태를 나타내는 멤버 변수가 있으며 Get 및 Set 접근자 함수로 구현됩니다. Get 함수는 .idl 파일에서 propget 태그가 있는 각 접근자 메서드에 대해 생성됩니다. Set 함수는 propput이나 propputref IDL 태그가 있는 각 접근자 메서드에 대해 생성됩니다. 접근자 함수를 정의하는 방법을 확인.. 2016. 9. 20.
CoCreateInstance 개요. COM 인스턴스 생성 함수. - 인자로 지정한 CLSID 에 해당하는 COM 개체 1개(초기화 되지 않은 상태) 생성한다. CoCreateInstance functionCreates a single uninitialized object of the class associated with a specified CLSID.Call CoCreateInstance when you want to create only one object on the local system. To create a single object on a remote system, call the CoCreateInstanceEx function. To create multiple objects based on a single CLS.. 2016. 9. 19.
C++ AMP. 예제 프로젝트들. N-body simulationBinomial options pricing modelConvolutionMatrix multiplicationTransitive closureOcean simulationBitonic sorterFast Fourier Transform (FFT) test appPassing pointers through C++ AMPMersenne twisterUsing C++ AMP from a CLR app Using C++ AMP in a CLR projectUsing C++ AMP from a C# appUsing C++ AMP from a C# Windows 8 metro-style appMeasuring performance of C++ AMP2D triangle rotatio.. 2016. 9. 14.
C++ AMP. Math Libraries for C++ AMP C++ AMP Math libraryC++ AMP Algorithms Library (STL-style Algorithms)C++ AMP RNG Library (Random Number Generator)C++ AMP FFT Library (Fast Fourier Transform)C++ AMP BLAS Library (Basic Linear Algebra Subroutines)C++ AMP LAPACK Library (Linear Algebra Package) from : https://blogs.msdn.microsoft.com/nativeconcurrency/2012/05/19/libraries-for-c-amp/ ///964. 2016. 9. 14.


비트코인




            암호화폐/외환/나스닥/골드          
       
현물 |선물 인버스 |선물 USDT , bybit MT5               프랍 트레이딩. MT4,MT5