标签: borland-c++

当我使用Borland C++构建光标时,为什么这段代码没有正确定位光标?

我发现此代码仅用于gotoxy()使用C标准库的替换函数.显然它编译使用GCC和工作方式类似于gotoxy()中发现的conio.h.

但是我只有用Borland C++编译器V5.5,该编译罚款,但不会重新像光标gotoxy()conio.h做.任何人都可以在使用GCC时验证这是否有效,或者告诉我为什么使用Borland不起作用?

#include<stdio.h>
#include<stdlib.h>

void gotoxy(int x, int y)
{
    printf("%c[%d;%df", 0x1B, y, x);
}

int main()
{
    gotoxy(10, 10);
    printf("hello world");
}
Run Code Online (Sandbox Code Playgroud)

c gcc c++builder c99 borland-c++

1
推荐指数
1
解决办法
780
查看次数

Borland C++ 编译器中的链接 DLL

我使用 freecommandlinetools 编译器 bcc32。我需要在我的程序中使用第三方 dll。我不想调用LoadLibraryand GetProcAddress,而是在我的程序中链接 dll 以直接调用 dll 函数。

#include "somelibrary.h"

int main() {
  somefunction(); // defined in somelibrary.dll
}
Run Code Online (Sandbox Code Playgroud)

我在尝试编译时看到未解析的外部对象。如何说服链接器与 somelibrary.dll 链接?

c dll borland-c++

1
推荐指数
1
解决办法
1389
查看次数

0
推荐指数
1
解决办法
1731
查看次数

Borland C++ - 多线程TCPServer问题

[我可能错了] TIdTCPServer Server在Borland C++构建器中是多线程的.它在单独的线程上处理所有客户端.这是在Borland c ++的帮助下编写的.

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

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

c++ multithreading indy c++builder borland-c++

0
推荐指数
1
解决办法
923
查看次数

使用它是否需要注册一个dll

使用dll需要注册dll吗?我听说16位dll不需要注册,那么32位dll呢?我将使用borland c++ 4.52开发的16位dll转换为使用borland c++ 5.02开发的32位dll。我的问题是我是否需要注册?当我尝试使用 regsvr32 注册时,出现错误“模块已加载,但未找到入口点 DllRegistryServer。请确保它是有效的 Dll 或 OCX,然后重试”

提前致谢...

c++ dll dllregistration borland-c++

0
推荐指数
1
解决办法
687
查看次数

为什么预处理器用Borland C ++标识枚举值,而不能用Visual C ++标识枚举值?

我正在尝试将项目从迁移Borland C++Visual C++

我注意到如本例所述在处理枚举方面存在差异

档案:Test_enum.cpp

    #ifdef  _MSC_VER
        #include <iostream>
    #else
        #include <iostream.h>
    #endif
    #include <conio.h>

    using namespace std;

    enum {

        ENUM_0 =0,
        ENUM_1,
        ENUM_2,
        ENUM_3
        } ;

     int main(int argc, char* argv[])
    {
        #ifdef  _MSC_VER
        cout << "Microsoft Visual compiler detected!" << endl;
        #elif defined(__BORLANDC__)
        cout << "Borland compiler detected!" << endl;
        #elif
        cout << "Other compiler detected!" << endl;
        #endif
        #if ENUM_1 > 0
        cout << "ENUM_1 is well defined at preprocessing time" << endl;
        #else …
Run Code Online (Sandbox Code Playgroud)

c++ enums visual-c++ c-preprocessor borland-c++

0
推荐指数
1
解决办法
212
查看次数

c ++中声明错误的类型太多

我想使用大数字是我的数据,所以我尝试了这个.

#include<iostream.h>
#include<conio.h>

struct DataType{
    unsigned long long int i,j;
}a;

int main(){
    a.i=1;a.j=1;
    while(a.j>0){
        a.i=a.j;
        a.j++;
    }
    cout << a.i;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

注意:编译器:Borland 5.02

c++ numbers borland-c++

-2
推荐指数
1
解决办法
853
查看次数

在C++中编译和执行此代码的问题

我正在尝试在TurboC++ 3.0中编译此代码.但是,我收到了这些错误:

DOS.H 77: Too many types in declaration
DOS.H 77: { expected
DOS.H 77: Declaration does not specify a tag or an identifier
SARSAL.CPP 72: Cannot cast from 'int' to 'time'
Run Code Online (Sandbox Code Playgroud)

我检查了库的目录,我在BorlandC++ 5.02中运行了代码(不幸的是,我得到了图形错误或错误:Constructor cannot have a return type specification在方法中void Agente::Agente),DevC++和Code :: Blocks没有成功.

代码由我们的AI老师提供,据说工作正常.如何编译?

谢谢您的帮助.

c++ borland-c++

-3
推荐指数
1
解决办法
371
查看次数

声明终止不正确

完整的代码是正确的,但我在第28行只得到了这一个错误:declaration terminated incorrectly.

#include<fstream.h>
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<iostream.h>
class Rail
{
private:
char GetYN();
struct Train
{
    int tno, nop;
    char tname[50];
    char dest[50];
    float dist, fare;
}t;
public:
void Input();
void CreateFile();
void Display();
void Search();
void Modify();
void Delete();
void AddRecord();
}R;
void introduction();
{                         \\This is where the error is (error: declaration terminated incorrectly)
clrscr()
cout << "\n\n";
cout << "\t  =============================================================\n";
cout << "\t  **                                                         **\n";
cout << "\t  **                       WELCOME TO                        **\n"; …
Run Code Online (Sandbox Code Playgroud)

c++ turbo-c++ borland-c++

-6
推荐指数
1
解决办法
8139
查看次数