Using CFile & CString in non-MFC app


I am trying to write a program that uses Driect X for display. I have a early version working, but I wanted to use CFile and CString to access the filesystem. I can't make htis an MFC project since DirectX will fight over control of the event loop. (If I am wrong, please correct me)
        I tried including afx.h which seemed to work OK, except that the linker complains that __beginthreadex and __endthreadex were unresolved externals. I tried changing the libraries and compiler defentitions, but it always made things worse. What do I need to add to comile my program with CString?

-John Huebner
jh6pAsked:
Who is Participating?
 
vmanochaConnect With a Mentor Commented:
you can force the linker to produce the exe file. since you are not using mfc for anything else, these unresolved symbols should not cause any problems while running. to force an exe to be generated, go to Build->Settings. click on the Link Tab. selectCustomize from the Category combo-box. check the 'Force file output' check-box. click on the OK button to dismiss the dialog. you will still get the link errors while building, but the linker will also generate an exe file, which should work just fine.
0
 
jh6pAuthor Commented:
Thanks! you got me over a major hurdle. I'm still having a lot of trouble integrating the two, but now I'm not stuck.

0
 
jh6pAuthor Commented:
I got a better answer through usenet a week after I got the answer from experts exchange:
--------------------------------------------------------
 Usually linker complains about  __beginthreadex and __endthreadex when
in your project settings option "Not Using MFC" is choosen.
Change it (Build | Settings | General).

Viktor Artemov

0
 
vmanochaCommented:
yes, that's another way to solve this problem. but i thought that you could not make this a mfc project (as mentioned in your initial question) and that is why i did not suggest this alternative.
0
All Courses

From novice to tech pro — start learning today.