PDA

View Full Version : VC++ question



maes
07-02-2002, 07:03 AM
If you add a class (.cpp + .h file) to your project and you do not call that class. Can it give errors?
I made the class a while ago and it allways worked perfecty

example:
the project contains:
source files:
- mp3.cpp //source file of class
- threadtest.cpp
header files:
-mp3.h // header fiel of class

test.cpp is a small windows program that displays a dialog box, a common dialog box and starts a thread. But does NOT use a single line of code from mp3.cpp, nor is mp3.h included an the test.cpp.

I'll add the project as an attachment. but you'll need the DirectX SDK to compile it.


edit:
The error I get is unhandled exception in threadtest.exe: 0XC0000005: Access Violation

Zeeshan
07-02-2002, 08:34 AM
>> If you add a class (.cpp + .h file) to your project and you do not call that class. Can it give errors?

Only if there is some syntax error in the class code itself....

Infact, we're all adding various MFC classes to our projects all the time...ofcourse we don't use each and every of them .. now do we? it doesn't give any errors

maes
07-02-2002, 11:25 AM
>>Only if there is some syntax error in the class code itself....
That isn't the case. the code compiles without errors or warnings.

(Well there is one warning but it is a test variable. and I've taken care of that)

But it has something to do with the thread I think. because when I leave it out, I have no problems then.