코드/c/c++39 [C/C++] 가변 인자 사용하기 int vsprintf_s( char *buffer, size_t sizeInBytes, const char *format, va_list argptr ); // crt_vsprintf_s.c // This program uses vsprintf_s to write to a buffer. // The size of the buffer is determined by _vscprintf. #include #include void test( char * format, ... ) { va_list args; int len; char * buffer; va_start( args, format ); len = _vscprintf( format, args ) // _vscprintf doesn't count + 1;.. 2008. 11. 4. 함수 확실하게 사용하자. DeskHandle = GetDesktopWindow(); FindWindowEx( DeskHandle , SubHandle , ClassName, NULL); Msdn엔 'If hwndParent is NULL, the function uses the desktop window as the parent window.' 이렇게 나와있으나.. Winapi을 몇일 밖에 안만져본 나로써.. Null로 사용했을 sub 핸들을 못찾는 문제의 빈도가 종종 생긴다. 왜 그런지..ㅡㅡ;; 이왕 사용할 함수 확실하게 사용하자.!! 2008. 10. 31. [WIN32] INI 파일 관련 함수들 - 읽기- 2008. 10. 29. ZwQuerySystemInformation Function ZwQuerySystemInformation Function [ZwQuerySystemInformation may be altered or unavailable in subsequent versions of Windows. Applications should use the alternate functions listed in this topic.] Retrieves the specified system information. Syntax NTSTATUS WINAPI ZwQuerySystemInformation( __in SYSTEM_INFORMATION_CLASS SystemInformationClass, __inout PVOID SystemInformation, __in ULONG SystemInfor.. 2008. 10. 24. [MFC] 메세지 윈도우 함수들 CWnd::GetDlgItemText int GetDlgItemText( int nID, LPTSTR lpStr, int nMaxCount ) const; int GetDlgItemText( int nID, CString& rString ) const; 리턴 버퍼로 복사된 바이트의 수를 리턴, 복사된 텍스트가 없으면 0을 리턴한다. 단, 마지막 NULL 문자는 포함되지 않는다. 인수 nID : 타이틀이 검색되어지는 컨트롤의 정수형 식별자 lpStr : 컨트롤의 타이틀 혹은 텍스트를 받기 위한 버퍼 nMaxCount : lpStr으로 복사되는 스트링의 최대 길이(바이트), 만약, 스트링이 nMaxCount 보다 길다면 잘려버린다. rString : CString으로의 참조 설명 대화상자에서 컨트롤과 관련된.. 2008. 10. 23. [MFC] 디렉토리 창 띄우기.. int CALLBACK MyBrowseCallbackProc( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData ) { switch (uMsg) { case BFFM_INITIALIZED: ::SendMessage( hwnd, BFFM_SETSELECTION, TRUE, lpData ); break; } return 0; } void CEmptyMFCDlg::DirectoryBrowerFunction() { // Folder 찾기 LPITEMIDLIST pidl; BROWSEINFO bi; char root[MAX_PATH] = {0,}; char defaultd[MAX_PATH] = {0,}; memcpy( defaultd , "c:\\WinDDK\\" , MA.. 2008. 10. 14. 이전 1 2 3 4 5 6 7 다음