I'm in a similar situation, as a math major, I generally get Cs or B-s in my mathematics courses, but in my physics courses (my minor) I generally get As or Bs. I also tend to get As and Bs in my non-major courses (arts/humanities electives since I'm in the school of arts and sciences, rather than the school of engineering). I've considered changing majors, but I've found that I really only enjoy the math part of physics.
A question to consider is this: are you doing anything aside from schoolwork with your time, such as work or an excess of extracurricular responsibilities? I ask because that's sort of the case with me, I work 25 hours a week to pay bills and I work 2-3 nights a week as a professional musician to supplement my income.
If you feel that poor performance in previous courses is contributing to a poor performance currently because of the effect on your attitude, consider talking to your advisor or a counselor if your school offers that. It may help more than you'd expect.