공룡호가 사는 세상 이야기

CMemFile Class

프로그래밍2006. 6. 10. 17:30

::CMemFile Class

메모리에 파일을 생성.
일시적으로 사용할 파일 등을 생성할 때 유용할 것 같아서.
객체를 만들면 바로 사용가능하며, 그 밖에 입출력 함수는 CFile 클래스와 동일.

//Example
void CExFileView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
//Create Object
CMemFile file;

//Write to Memory
int temp = 100;
file.Write(&temp, sizeof(temp));

//Read from Memory
file.SeekToBegin();
file.Read(&temp, sizeof(temp));
TRACE("temp = %d\n", temp);
}

'프로그래밍' 카테고리의 다른 글

MFC - Chatting 기본 컨트롤 관련 및 복습  (1) 2006.07.21
WINSOCK ERROR  (0) 2006.07.19
습관  (0) 2006.06.06
printf() flags  (0) 2006.05.23
fopen() 제발 그만 까먹자.. 제발 좀.  (0) 2006.05.04