파일오픈에 관해 질문드립니다. vc++ 6.0 에서 되던 것이 visual studio 2008에선 돌아가지 않네요.

2cminor의 이미지

fp = fopen(pIndex ->fileName, "rt") 여기서 계속 널이 리턴되네요. ㅠㅠ
vc++에선 돌아갔었는데...
찾아보다가 잘 모르겠어서 질문드립니다.

제가 오늘 처음 2008을 써보고 있어서 잘 모르겠네요ㅠㅠ
일단 프로젝트 요소에 파라미터에 오픈할 파일 이름 test.txt로 넣었구요.
그 외에는 별다른 것이 없어보여서 그대로 돌려봤습니다.

답변 부탁드려요~^_^;

void LoadFile(linePoint *pIndex)
{
	FILE *fp;
	char buf[256]; //fgets()은 
	line *t;
 
	<span>if((fp = fopen(pIndex ->fileName, "rt")) == NULL)</span> //assert(fp != NULL)로 따로 빼줘도 된다.
	{
		printf("\n Error : can't read that file.");
		exit(1); //#define   EXIT_FAILURE    1    /* Failing exit status.*/
	}
	pIndex ->totalLine = 0;
	printf("\n file loadoing...");
	while(!feof(fp))
	{
		fgets(buf, 255, fp); //개행or255문자째까지나 화일의 끝까지 읽어들임.
		if(strlen(buf) > 80)
		{
			buf[80] = 0;
		}
		if((t = (line *)malloc(sizeof(line))) == NULL)
		{
			printf("\n Error : out of Memory.");
			exit(1); //실패했을 시의 종료. 성공시는 exit(0)
		}
		if((t ->buf = (char *)malloc(strlen(buf))) == NULL)
		{
			printf("\n Error : Out of Memory");
			exit(1);
		}
		strcpy(t ->buf, buf);
		t ->prev = pIndex ->tail ->prev;
		t ->next = pIndex ->tail;
		pIndex ->tail ->prev ->next = t;
		pIndex ->tail ->prev = t;
		pIndex ->totalLine++;
	}
	fclose(fp);
}