问题标签 [borland-c++]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
963 浏览

c++ - 声明一个类类型的数组(Borland C++ 有问题)

我有一堂课,比如说

我想声明该类的全局对象数组,例如

但是,例如,我在 xxx.h 文件(类的头文件)中声明:

在 xxx.cpp 文件中我做:

但是,Borland C++ 给出了以下错误:

找不到默认构造函数来初始化“XXX”类型的数组元素

当我在 xxx.cpp 文件中声明以下内容时

XXX* arr[50];

我在其他 cpp 文件中收到一些错误消息,例如

未定义符号 arr;

所以,总而言之,我如何声明我的这个数组?

更新:我有一个带有 3 个参数的构造函数,我不希望它们具有默认值。

另外,我在一个宏中“声明”了构造函数,如下所示:

所以,IVT ivt##num(evInt##num,num,c); 是 IVT 类的构造函数,我想声明一个带有 X 元素的全局指针数组。

0 投票
1 回答
4856 浏览

c++builder - Builder C++/Turbo C++ WebBrowser。如何访问收到的 HTML 代码

我使用 Borland Turbo C++(类似于 Builder c++,但组件较少)。

当我执行 Webbrowser1->Navigate(MyURL) 时,我会正确收到所需的网站。就我而言,它只是一个文本网站,甚至不是 html 代码。我可以在 Webbrowser 的窗口中看到它。

如何访问接收到的文本以便能够对其进行操作、计算字符数等?最好的情况是如果我能把它变成一个 Ansistring。

我不知道该怎么做。我使用哪个类或尝试转换为什么类型。

0 投票
2 回答
585 浏览

c++ - 除以零会导致 Borland C++ 中的内存泄漏

我只是在 Borland C++ Builder 版本 6 中运行以下代码;

在运行此循环时,我在任务管理器(内存列)中看到它正在泄漏内存。知道为什么吗?

当我尝试除以零时,我在项目中的计算模块上工作时遇到内存泄漏,并且在我的头撞了好几个小时后,内存泄漏在哪里,我意识到它也在上述简单循环中泄漏内存。项目中没有发现问题。

0 投票
1 回答
770 浏览

c++ - How to call a method that returns an array of strings in Borland C++?

I've created a COM wrapper in C# with a method that returns an array of strings:

In VB6 I'm calling that method and presenting strings in a list like this:

Does anyone know how to call that method from Borland C++ and get all elements in the returning array?

0 投票
2 回答
1975 浏览

c++ - apientry dllmain 出错

我尝试在 Borland c++ 5.02 中创建 *.dll 文件,我对这个函数有疑问

我尝试编译我的项目,但编译器显示错误。这个函数有什么问题,或者这个编译器与另一个编译器有不同的类型风格吗?

0 投票
1 回答
299 浏览

c++ - Borland C++ 5.02 不能调用带参数的构造函数

我从网上复制的头文件中有以下类定义

在实现文件中我有`

现在的问题是,当调用带参数的构造函数时出现以下错误。

信息:建筑...

信息:编译 C:\Users...\Desktop\main.cpp

信息:链接 C:\Users...\Desktop\main.exe

错误:错误:未解析的外部 'A2DD::A2DD(int,int)' 从 C:\USERS...\DESKTOP\MAIN.OBJ 引用

但是,当A2DD add();在没有参数的情况下调用时,程序可以正常工作。

现在你可能想知道为什么我从互联网上复制代码,嗯,我有一些涉及课程的电气工程课程的编程作业,我们只能使用 Borland,是的,代码在 Visual C++ 中工作......请帮助

0 投票
3 回答
620 浏览

c - What C compiler matches Borland Turbo Link 5.1?

We have an environment built upon Borland Turbo Assembler 5.3 and Turbo Link 5.1. We have to maintain some hereditary code in it, so throwing them away is out of the question. Now I want to introduce some C into it.

Neither GCC, nor Microsoft C/C++ compiler provide object file in Borland format. That's understandable. But somehow even Borland C++ 5.5 and Turbo C 2.0 don't. I mean, linker does link these objects with no warnings or errors, but the executable linked just crashes. Tried this with mere hello world, still crashes or does nothing visible and exits.

Looks like there is severe difference between versions and there should be specific C compiler for Turbo Link 5.1. Is is so? If it is, what compiler should I take?

Or, which came to mind just now, maybe I should rather do some TASM translation with, for instance, BCC instead and then just TASM it?

0 投票
0 回答
570 浏览

c++ - 错误:未解决的外部

这些是我在编译第二个模块即(Errlib)时遇到的链接错误,它依赖于第一个模块lib文件即(barlib.lib)。第一个模块已经编译,它生成了 dll 和 .lib 文件。

第一个模块制作文件(barlib)

第二个模块制作文件(errlib)

barlib的定义文件

请帮助解决这些链接错误。谢谢!

0 投票
2 回答
1198 浏览

c++ - 在borland graphics c ++中为球制作动画

我正在尝试为使用 borland 图形界面 (BGI) 绘制的足球制作动画。将采用用户输入来确定球的位置。到目前为止,我已经画出了球,但不确定如何编写第二个函数来改变用户输入的球的位置。

我只想在笛卡尔平面的 x 方向上移动球。为此,我尝试将用户输入添加到包含 x 坐标的球的任何方面,但我似乎无法让它工作。

这是绘制足球的函数:

0 投票
3 回答
1067 浏览

c++ - Borland C++ - 多线程 TCPServer 问题

[我可能对这些有误] TIdTCPServer Server在 Borland C++ builder 中是多线程的。它在单独的线程上处理所有客户端。这是在 Borland c++ 的帮助下编写的。

现在是我的问题和问题。例如,ShowMessage(String ..)方法应该在主(gui)线程上调用。但正如我上面所说,TCPServer 是多线程的,并且OnExecute在不同的线程上处理事件。当我在 OnExecute 事件中使用 ShowMessage 方法(在与主线程不同的线程上处理)时,我得到了奇怪的结果。有时会ShowMessage()按预期工作,有时会以不同的框大小(无限长、很长、正常等)显示没有任何文本。其他用户界面更改没有问题(更新TEdit,TMemo。ShowMessage()现在只有问题)

我认为这个问题是ShowMessage()不是在主(gui)线程上调用方法的结果,而是在 TIdTCPServer 内部为客户端连接创建的 TCPServer 线程上调用方法的结果。那么我该如何解决呢?