본문 바로가기

전체 글73

[C]Fucntion comment Fucntion Descript /*============================================================ FUNCTION isTrue DESCRIPTION This function is determine that true or not Example: if(isTrue() == FALSE) { EXIT CODES TO HERE. } GO TO NEXT STEP. RETURNS returns TRUE(1), otherwise returns FALSE(0). SIDE EFFECTS None ============================================================*/ 2009. 5. 27.
[C]file divide 합쳐졌던 파일을 나누기 *. 이 파일과 다른 파일을 병합(Merge)한 후, Merge된 파일을 실행시킬때, 뒤에 합쳐진 원래 파일을 분리해 내도록 구현 01: #define checkApp_size 123456 // this program size(byte) 02: #define FILEREAD ((1024)*(4)) 03: 04: /* 05: * divideBinary() - 다른 파일 생성 06: */ 07: void divideBinary(void) 08: { 09: FILE *fpMerged, *fpExe; 10: char buff[FILEREAD]; 11: int len; 12: 13: fpMerged = fopen("merged.exe","rb"); 14: fpExe = fopen("out... 2009. 5. 27.
[WinApi]ShellExecute() 현재 드라이브의 최상위 디렉토리에 있는 test.exe 파일을 실행 01: #include "stdafx.h" 02: #include 03: #include 04: #include 05: 06: int APIENTRY WinMain(HINSTANCE hInstance, 07: HINSTANCE hPrevInstance, 08: LPSTR lpCmdLine, 09: int nCmdShow) 10: { 11: int curDrive; 12: char exeCmd[256]; 13: 14: memset(exeCmd, NULL, sizeof(exeCmd)); 15: 16: // 현재 드라이브 할당 17: curDrive = _getdrive(); 18: 19: // Execute current drive:\tes.. 2009. 5. 27.
[WinApi]CreateFile() CreateFile 사용 예 1: HANDLE hFile; 2: 3: hFile = CreateFile("test.txt", // pointer to name of the file 4: GENERIC_WRITE, // access (read-write) mode 5: 0, // share mode 6: NULL, // pointer to security attributes 7: CREATE_ALWAYS, // how to create 8: FILE_ATTRIBUTE_NORMAL, // file attributes 9: NULL); // handle to file with attributes to copy 2009. 5. 27.
반응형