错误C3767:无法访问候选函数 [英] error C3767: candidate function(s) not accessible
本文介绍了错误C3767:无法访问候选函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我在VC ++中设计计算器我使用自己的DLL并连接表单应用程序。
我想要将操作历史保存为(2 + 3 = 5)到file.txt。
当我尝试在DLL中编写这样的函数时
void setHistory(string a,double b);
表单应用程序中的
我无法将textBox转换为字符串,我试图使用marshal但是不是工作。
System :: String ^ clrString = DisplayOperation-> Text;
myf-> setDisplayHistory(marshal_as< std :: string xmlns:std =#unknown> gt;(clrString),LblDisplay-> Text);
推荐答案
亲爱的谢尔盖,
我在我自己的DLL中的所有声明都不是这样的形式,
DisplayOperation-> Text;和LblDisplay->文字;两个都是textBox
DLL中的函数是
void函数:: setDisplayHistory(字符串a,双b)
{
ofstream readFile(Calculator.txt,fstream :: in);
if(readFile.is_open())
{
readFile<< a<< =<< b<< endl;
readFile.close();
}
}
看起来不是函数::和myf因为有连接项目的名称。
但为什么我不能发送字符串到它上面的函数显示错误。并且它也是正确的
setDisplayHistory((错误类型)* a,双b)
Dear Sergey,
all my declarations in my own DLL not in form that,
DisplayOperation->Text; and LblDisplay->Text; both are textBox
the function in DLL is
void Functions::setDisplayHistory(string a, double b)
{
ofstream readFile("Calculator.txt", fstream::in);
if (readFile.is_open())
{
readFile << a << " = " << b << endl;
readFile.close();
}
}
don't look the Functions:: and myf because there are connect with the name of project.
but why I cannot sent the string to function above it show me the error. and also it right
setDisplayHistory((error-type) *a, double b)
这篇关于错误C3767:无法访问候选函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文