头文件doc.h
class doc
{
private:
int x,y;
public:
int GetX(){return x;};
int GetY(){return y;};
public: void Locate(int x,int y,COLORREF crColor );
}
doc.cpp
#include "stdafx.h"
#include "doc.h"
void doc::Locate(int x,int y,COLORREF crColor)
{
CDC dc;
CPen pen(PS_DOT,PS_COSMETIC,crColor);
dc.SelectObject(pen);
dc.MoveTo(x,y);
dc.LineTo(x,y);
return;
}
提示
E:\mywork\study\dot.cpp(8) : error C2628: 'doc' followed by 'void' is illegal (did you forget a ';'?)
E:\mywork\study\dot.cpp(9) : error C2556: 'class doc __thiscall doc::Locate(int,int,unsigned long)' : overloaded function differs only by return type from 'void __thiscall doc::Locate(int,int,unsigned long)'
E:\mywork\study\doc.h(18) : see declaration of 'Locate'
E:\mywork\study\dot.cpp(9) : error C2371: 'Locate' : redefinition; different basic types
E:\mywork\study\doc.h(18) : see declaration of 'Locate'
这是怎么回事啊!!!
解决方案 »
- 能不能在单文档中,画出一个圆,而在ondraw()调用后画出一个别的图形后,这个圆还在?
- 在线急等:CListControl列显示问题
- 我做的類似VC++的界面,現在我想把它改成將下面的信息窗口直接不要顯示在整個下面,而是在右邊窗口區域的下面??左邊直接就為一個樹列
- VC资源编辑器的问题。
- 100分求字典的算法
- 放分:萦绕在心头的一个礼拜之久的问题,终于一扫而空!欢迎看过《COM原理与应用》的各位CSDN朋友,对自己理解第四章的接口聚合的实现机
- MemDc是否有大小限制,memdc是否可以自已控制开辟内存的大小
- 请问OpenGL内视角的选择法,如何使物体绕某一条线段旋转和放大缩小的问题
- 老问重提,请问如何调用蓝屏,不是自己画的,就像调用一种系统服务一样,可以吗,听说是藏在一个未公开的API中?
- CReBar添加多个Dialogbar后的位置问题。
- 大学退学了,想找个地方边学边工作。
- 谁有媒体播放器所有接口函数的帮助?
{
private:
int x,y;
public:
int GetX(){return x;};
int GetY(){return y;};
public: void Locate(int x,int y,COLORREF crColor );
};//这里有没有分号呀?
不用预编译
谢谢!!谢谢!!谢谢!!谢谢!!谢谢!!
谢谢!!谢谢!!谢谢!!
我还问一下,我加拉分号后出现
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Release/study.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
这有是怎么搞的?