如何在VCL表单应用程序中创建和调用函数
How to make and call a function in VCL form application
我正在使用C++生成器,并且需要一些帮助才能为某些表单操作创建一个函数。我已经尝试了下面的代码,但没有运气。
这是我的代码:
int calculateAndDisplayImportantAppointments()
{
int integerNumberOfImportantAppointments = calCalendar.getNumberOfImportantAppointments();
if (integerNumberOfImportantAppointments > 0)
{
// itoa is not standard (like any of this is)
WCHAR strN[32];
swprintf(strN, L"%d", integerNumberOfImportantAppointments);
// not familiar with ShowMessage(), but I *think* this will work.
ShowMessage("You have " + UnicodeString(strN) + " important appointments. Do you wish to view them?");
}
return integerNumberOfImportantAppointments;
}
我收到以下错误:尝试调用此函数时调用未定义的函数calculateAndDisplayImportantAppointments
。
我可以在解决此问题方面获得一些帮助吗?
抱歉,非常简单的解决方案。
该函数需要写在声明它的代码部分上方。
相关文章:
- 使用Qt框架在c ++类中创建API调用
- 我使用向量来创建类对象列表.初始化向量时如何使用参数调用构造函数?
- GLEW/GLUT:调用init并创建一个窗口后,取消初始化并重新初始化?
- 是否可以创建一个从不同类调用函数的线程?
- 如何从Windows控制台调用.exe(C++)以在不同的目录(或任何目录)中创建文件夹?
- 在 C++ 的 Switch Case 中创建对象后对对象调用方法
- 如何创建一个对象创建函数,该函数将由与其关联的名称调用?
- 隐藏由 WinAPI 调用创建的窗口
- 使用在堆栈上创建的对象调用虚拟函数
- 亲.InsertAtHead() 调用创建程序崩溃
- 创建一个C++DLL以从C#DLL调用方法
- 调用boost.asio的异步函数时,线程是什么时候创建的
- 在 c++ 中创建 dll 并在 delphi 中调用的标准方法
- C ++:如何在不创建对象的情况下在主函数中调用方法
- 将非左值作为常量引用参数传递.临时是在本地作用域还是在调用方作用域中创建的?
- 在创建对象向量时,不为每个对象唯一调用默认对象构造函数
- 调用函数来创建 WinAPI 按钮不会执行任何操作
- 从 PHP 调用已编译的C++可执行文件来创建套接字
- 如何调用从 QML 中C++创建的对象的方法?
- 从可调用可变参数元组中的函数结果创建元组