我建立了MFC Wizard工程,里面添加了两个文件stock.h, stock.cpp
////////stock.h////////////////////
#define n 5struct Block
{
int    layer;
int    centre;
int    length;
int    stock;
CRect  rect;
};class Stock
{
public:
Block b[n];
int ;
int layer;
CPen pen;
Stock() {layer=0;=0;}
// void Move(Stock t,CDC* pDC);
void drawstock(int _,CDC* pDC);
};
//////////////stock.cpp/////////////////////
#include"stock.h"void Stock::drawstock(int _,CDC* pDC)  {  };
但是总出现题目说的错误,请各位指点

解决方案 »

  1.   

    #include "stdafx.h"
    #include"stock.h"
      

  2.   

    找你的改了,又出现了新错误
    C:\ohnii\stock.cpp(4) : error C2653: 'Stock' : is not a class or namespace name
    我找不到错误的原因
      

  3.   

    另外#include "stdafx.h"文件中是其什么作用,自己定义的类,如果以后要加到***view.h中,
    CDC指针是不是可以直接作为参数。
      

  4.   

    #include "stdafx.h"文件中使它支持MFC,
    可以用CDC* pDC指针做参数
      

  5.   

    stdafx.h 将包含预编译头文件。
    CDC指针 可以作为参数
    你全部重建一次试试。
      

  6.   

    还是那个错误
    C:\ohnii\stock.cpp(4) : error C2653: 'Stock' : is not a class or namespace name
    我如果直接在类Stock中定义函数就没有错误。
    但是我的程序不小,这样写太不好看了,请诸位帮忙了
      

  7.   

    已经从新建立了(把debug给删除了),但是没有起色。我把两个文件中都加入了#include "stdafx.h"
      

  8.   

    #include "stdafx.h"        //注意这两行的顺序不能交换。
    #include"stock.h"
      

  9.   

    #include "stdafx.h"以前的所有代码都不会被编译。