我试图在内存中构建几棵“树”,然后将其中一棵分配给用户可以与之交互的 TTreeView 控件。但是,如果不传递指向现有 TTreeView 的指针,我就无法构造任何 TTreeNodes 对象。传入 NIL 会导致 AV。
两个问题:- TTreeNodes 和 TTreeViews 之间这种“硬”链接的原因是什么,以及解决该问题的最佳方法是什么?
我可以看到的一些选项是:
..但我还没有权衡这些的利弊。
我正在尝试使用 C++Builder 编写一个“Hello World”示例。这是我的第一个项目,所以我可能犯了一个简单的错误。
我想创建一个调用计算器 Web 服务的控制台应用程序。
我打开 C++Builder 2007 并创建一个控制台应用程序。将出现一个名为 File1.cpp 的 cpp 文件。这是内容:
//---------------------------------------------------------------------------
#include <iostream.h>
#include <vcl.h>
#pragma hdrstop
#include "calculator.h"
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
double a, b;
cout << "Enter the values to sum\n";
cout << "A: ";
cin >> a;
cout << "B: ";
cin >> b;
cout << "\nA+B:";
cout << GetCalculatorSoap()->Add(1,2);
cout << "\n\nPress any key to continue...";
getchar();
return 0;
}
//---------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
另外,我将肥皂代理添加到 New->Other->WebService->WSDL Importer 中。使用 WSDL …
到目前为止,我一直在使用 Indy 10,没有出现任何问题,但最近在安装 TMS 组件包时出现问题后,我正在寻找升级 Indy 的替代方法。TMS 在带有 CB2010 的干净系统上安装良好,但是当我使用以下过程升级 Indy 时,在启动 IDE 时以及 TMS 安装后立即出现错误 - 错误为:The procedure entry point @Idhttp@TidCustomHTTP@GetRequestHeaders$qqrv could not be located in the dynamic link library IndyProtocols140.bpl。显然我这边有一些问题,因为 TMS 确实是在干净安装时安装的,而没有 Indy 升级。
因此,如果我用较新的版本覆盖 Indy 文件,也许它可以正确安装。
以下是我现在使用的 Indy 升级的安装过程(在 TMS 安装之前一直有效):
启动IDE并删除Indy10 Protocols Design Time并Indy10 Core Design Time打包
运行此脚本来删除旧的 Indy 文件:
del /q "c:\Program Files\Embarcadero\RAD Studio\7.0\lib\Indy10\*.*"
del /q "c:\Program Files\Embarcadero\RAD Studio\7.0\lib\debug\Indy10\*.*"
del /q "c:\Program Files\Embarcadero\RAD Studio\7.0\include\Indy10\*.*"
del /q /s "c:\Program Files\Embarcadero\RAD …Run Code Online (Sandbox Code Playgroud)我正在尝试配置FASTMM4,Builder C++ 6我遵循的步骤是:
Project -> Options -> Linker我取消勾选了"Use Dynamic RTL"。C:/tools/FASTMM并将FASTMM4.pas文件添加到我的测试 C++ VCL 项目中。FastMM4.hpp在 FastMM 文件夹中获得一个新文件。FastMM4BCB.cpp在我的项目中,并写#include <FASTMM4.hpp>在顶部。FastMM_FullDebugMode.dll并FastMM_FullDebugMode.lib移动FastMM_FullDebugMode.dll到安装目录Bin中的文件夹Builder C++。{$define FullDebugMode}启用来自 的线路FastMM4Options.inc。我错过了什么吗?为什么我会出现以下错误?

我需要建议创建一个简单的端口扫描器,它需要检测某些特定设备是否从其 IP/MAC 地址连接到网络。
我在 Windows 7 上工作,最好使用 C++ Builder 2010,或者 java 或 Qt。
图书馆必须在公共领域或同等领域,因为我的软件是专有软件。
你会建议什么图书馆?你知道我可以从什么免费软件开始,或者有什么例子吗?
使用 Indy Sockets 或 Synapse TCP/IP 库怎么样?
我正在尝试在 C++ Builder 项目中使用 Delphi 函数(因为 ImageEn 的 IEVision 组件没有可用于提取条形码的 C++ 接口,所以我需要在 Delphi 单元中提取条形码)
我创建了一个C++ Builder项目,并添加了一个Delphi Unit,其完整代码为:
unit Unit2;
interface
implementation
function MyOutput : String ;
begin
Result := 'hello';
end;
end.
Run Code Online (Sandbox Code Playgroud)
我在 C++ 形式中使用该单元:
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
String result = MyOutput();
}
Run Code Online (Sandbox Code Playgroud)
生成的 .hpp 是:
// CodeGear C++Builder
// Copyright (c) 1995, …Run Code Online (Sandbox Code Playgroud) 我的环境是Windows 7 pro(32位)上的RADStudio XE4 Update1。
我发现C++ Builder中有一个System::UnicodeString::Format()静态方法。
Format()可以如下使用。但是,我认为可以通过使用 来执行相同的操作String().sprintf()。
String str;
// --- (1) ---
str = String::Format(L"%2d, %2d, %2d", ARRAYOFCONST((10, 2, 3)));
ShowMessage(str); // 10, 2, 3
// --- (2) ---
str = String().sprintf(L"%2d, %2d, %2d", 10, 2, 3);
ShowMessage(str); // 10, 2, 3
Run Code Online (Sandbox Code Playgroud)
我的问题是在哪种情况下Format()使用该函数比使用其他函数更好?
这只是品味问题吗?
我需要在 bcc32 项目上使用 C++11 库。该库不能用 bcc32 编译,但可以用 bcc32c 编译。
我想防止在 DLL 上公开这个库。该库使用 bcc32c 编译,但我无法在 bcc32 项目上使用 bcc32c 静态库。
我有一个使用 C++ Builder 10.1 Berlin 构建的跨平台 C++ 应用程序,并且在理解对象的生命周期处理时遇到问题,在这种情况下是在类之外声明的字符串。我创建了一个新的表单应用程序并添加了一些代码。cpp 文件如下所示:
#include
#pragma hdrstop
#include "FmrMain.h"
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
const String Hello = "Hello";
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
ShowMessage(Hello);
}
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
ShowMessage(Hello);
}
Run Code Online (Sandbox Code Playgroud)
我使用 CLANG 增强型 C++11 编译器 bcc32c 编译它,运行应用程序并再次关闭表单。当 TForm1::FormDestroy 被调用时,Hello 已经被销毁了。当我使用经典编译器 bcc32 为 win32 编译代码时,字符串在 FormDestroy 之后被销毁。
有人可以解释这一点或提供一些有关我必须寻找的主题的信息吗?为什么基于 CLANG 的编译器在这里表现不同?
编辑
当我使用自定义类而不是字符串时,调试更容易。
class Foo {
public:
Foo(){};
~Foo(){}
};
Foo A;
//--------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//-------------------------------------------------------------------------- …Run Code Online (Sandbox Code Playgroud) 我需要在 Embarcadero RAD Studio XE5 中构建为 BCB6(Borland C++ Builder 6)制作的旧组件。项目是 CPP- 项目,组件代码包含在 *.PAS - 文件中。该项目包含 6 个包:
首先我构建包运行时。之后,我开始构建和安装使用包运行时的包设计时间。并且一个设计时包在安装过程中出现了问题:
我发现了一个导致这个问题的运行时包。我的问题是如何找到并解决以下错误?毕竟,当安装包时,我无法启动调试器,查看堆栈跟踪,什么也没有。有什么选择?谢谢。
c++builder ×10
c++ ×3
delphi ×3
c++11 ×1
clang ×1
debugging ×1
delphi-xe5 ×1
fastmm ×1
firemonkey ×1
indy10 ×1
installation ×1
rad-studio ×1
soap ×1
tcp-ip ×1
tms ×1
tree ×1
ttreenodes ×1
web-services ×1