24小时热门版块排行榜    

查看: 2124  |  回复: 4
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

hathain

银虫 (初入文坛)

[求助] function does not take 1 parameters怎么改 已有2人参与

创建的类MyIplClass下的成员函数:
void MyIplClass::GetIplData(IplImage* ipl)
{
        memcpy(m_Ipl->imageData,m_Ipl->imageData,m_Ipl->imageSize);
}

void MyIplClass::LoadBMP(CString FileName)
{
        m_Ipl=cvLoadImage(FileName,1);
}

按钮处理部分:
void CMymfcDlg::OnProcess()
{
        // TODO: Add your control notification handler code here
        MyIplClass* Img=new MyIplClass;
        CString filename;
        filename="C:\\Program Files\\OpenCV\\samples\\Lena.jpg";
        Img->LoadBMP(filename);
        Img->GetIplData(TheImage);
        delete Img;
        RedrawWindow(NULL,NULL,RDW_INVALIDATE);
}
报错:
:\VC++\MSDev98\MyProjects\mymfc\mymfcDlg.cpp(268) : error C2660: 'LoadBMP' : function does not take 1 parameters
D:\VC++\MSDev98\MyProjects\mymfc\mymfcDlg.cpp(269) : error C2660: 'GetIplData' : function does not take 1 parameters
MyIplClass.cpp
D:\VC++\MSDev98\MyProjects\mymfc\MyIplClass.cpp(31) : error C2511: 'GetIplData' : overloaded member function 'void (struct _IplImage *)' not found in 'MyIplClass'
        d:\vc++\msdev98\myprojects\mymfc\myiplclass.h(20) : see declaration of 'MyIplClass'
D:\VC++\MSDev98\MyProjects\mymfc\MyIplClass.cpp(36) : error C2511: 'LoadBMP' : overloaded member function 'void (class CString)' not found in 'MyIplClass'
        d:\vc++\msdev98\myprojects\mymfc\myiplclass.h(20) : see declaration of 'MyIplClass'
Generating Code...
执行 cl.exe 时出错.

mymfc.exe - 1 error(s), 0 warning(s)

求解释~~~~
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hathain

银虫 (初入文坛)

引用回帖:
2楼: Originally posted by rbs at 2014-06-30 00:33:46
把C原生字符串手动转换成CString。另外第一个函数是不是写错了?

我是按照oencv基础篇上面写的来的,不知道为什么就是不对~~~
3楼2014-06-30 09:21:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 5 个回答

rbs

木虫 (小有名气)

【答案】应助回帖

感谢参与,应助指数 +1
把C原生字符串手动转换成CString。另外第一个函数是不是写错了?
2楼2014-06-30 00:33:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

绿遍山原

铜虫 (小有名气)

【答案】应助回帖

感谢参与,应助指数 +1
把CString改成const char*试下。
要夢遊,不要催眠。
4楼2014-06-30 09:45:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hathain

银虫 (初入文坛)

引用回帖:
4楼: Originally posted by 绿遍山原 at 2014-06-30 09:45:44
把CString改成const char*试下。

试了之后还是错误:overloaded member function 'void (struct _IplImage *)' not found in 'MyIplClass'。怎么回事呢?
5楼2014-06-30 15:52:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +31 医学老男孩 2026-08-13 69/3450 2026-08-16 00:16 by mo_mo_mo_mo
[基金申请] 时间戳又变了8-15 +12 archvillain 2026-08-15 23/1150 2026-08-15 20:47 by foyo404
[基金申请] filecode=后面第一个是大写字母 +6 wangze12014 2026-08-14 7/350 2026-08-15 20:12 by gltch
[基金申请] filecode +8 cratir 2026-08-14 12/600 2026-08-15 18:08 by zyfgau
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +12 Tide man 2026-08-10 13/650 2026-08-15 16:34 by 氺木
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +7 Ldrop2023 2026-08-13 7/350 2026-08-15 15:57 by mzhh2000
[基金申请] 关于Filecode分析方法 +10 majunge000 2026-08-10 13/650 2026-08-15 12:26 by hanpeng972
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 22/1100 2026-08-14 23:45 by Noways
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +8 布布和一二 2026-08-10 11/550 2026-08-14 14:58 by Equinoxhua
[硕博家园] 读博的好处 +4 lnee 2026-08-11 4/200 2026-08-14 10:20 by ahsoarli
[基金申请] filecode +15 documentary 2026-08-10 17/850 2026-08-14 10:08 by kissu88
[基金申请] FileCode能看出啥? +10 要乐观耀哥 2026-08-10 32/1600 2026-08-14 09:37 by 要乐观耀哥
[基金申请] 我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人 +10 家与远方 2026-08-10 15/750 2026-08-14 02:08 by 绵羊哥哥
[文学芳草园] 阿姨 +4 汪汪锅 2026-08-09 4/200 2026-08-13 19:43 by arzu_hma
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 什么时候出结果,有咨询渠道??? +3 Tide man 2026-08-11 3/150 2026-08-11 17:54 by kudofaye
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
信息提示
请填处理意见