c++builder

Borland C++ Builder 6 and string concatenation

馋奶兔 提交于 2019-12-06 12:39:10
I'm using Borland C++ Builder 6 to try to do some simple string concatenation. However, I have run into what I think is an interesting issue. Everything I am able to find online states that I should be able to do something as simple as this: String word = "a" + "b" + "c"; However, when I try to compile this code, I get an "Invalid pointer addition" error. I could go as far as assigning each part to its own variable and adding each of those together to get the desired output. However, I think that's unnecessary given how simple of an example this is. The only way I have been able to get

WebSocket connect to TIdHTTPServer, handshake issue

喜夏-厌秋 提交于 2019-12-06 11:19:11
I'm using C++Builder 10.1 Berlin to write a simple WebSocket server application, which listens on a port for some commands sent from a web browser, like Google Chrome. On my Form, I have a TMemo, TButton and TIdHTTPServer, and I have this code: void __fastcall TForm1::Button1Click(TObject *Sender) { IdHTTPServer1->Bindings->DefaultPort = 55555; IdHTTPServer1->Active = true; } void __fastcall TForm1::IdHTTPServer1Connect(TIdContext *AContext) { Memo1->Lines->Add(AContext->Binding->PeerIP); Memo1->Lines->Add( AContext->Connection->IOHandler->ReadLn(enUTF8)); Memo1->Lines->Add( AContext->Data-

Winsock bind() failing with WSAEADDRNOTAVAIL for directed broadcast address

一个人想着一个人 提交于 2019-12-06 11:18:40
I am setting up a UDP socket and trying to bind what should be a valid network broadcast address to it (192.168.202.255 : 23456), but bind fails with error 10049, WSAEADDRNOTAVAIL . If I use a localhost broadcast address, 127.0.0.255, it succeeds. WSAEADDRNOTAVAIL 's documentation says that "The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local computer. This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote computer (for

XML Invalid characters when creating CData node from UnicodeString

让人想犯罪 __ 提交于 2019-12-06 09:56:46
问题 IDE: Embarcadero XE5 c++ builder. I'm trying to dump UnicodeStrings in XML CData sections . Small extract of such a string: u"‰PNG\r\n\x1A\n\0\0\0\rIHDR\0\0\0õ\0\0\02\b\x06\0\0\0„\\i\0\0\0\x01sRGB\0®Î\x1Cé\0\0\0\x04gAMA\0\0±\vüa\x05\0\0\0\tpHYs\0\0\x0EÃ\0\0\x0EÃ\x01Ço¨d\0\0\v¼IDATxÚíœypUÕ\x19ÀO\x06…°¤\x04D$ˆ²\b1š\b\x18@...etc" I know a XML document can contain non-ASCII characters and I thought the content of a XML CData section is not parsed by the XML parser( with the exception of the end

How to suppress “There are still active COM objects in this application” error when closing application?

狂风中的少年 提交于 2019-12-06 09:50:39
问题 I've written a few ATL COM objects that are used for drag-and-drop within my C++ Builder application. Due to reasons beyond my control, my application still has active COM objects when the user attempts to close it. This is because other COM clients that use my objects seem to cache my COM objects and don't release them - as a result, my COM objects still have a reference count greater than zero when the user clicks the "X" to close my program. This results in the user getting an unfriendly

Is there a working example of COM event handling in C++ Builder?

依然范特西╮ 提交于 2019-12-06 07:16:57
I am trying to connect a C++ Builder app with a .NET service app, and would like the .NET service app to be able to send events back to the C++ Builder app. Is there a working example of a C++ Builder app which can handle COM events? There was an error in the DocWiki regarding handling COM Events. I was able to collect some examples from various places, and put them together here for reference. The .NET application has the following: using System; using System.IO; using System.Runtime.InteropServices; namespace IPractLib01 { // // GUID's to use for the COM objects. [Guid("ACD03FE3-E506-4D87

How to know and load all images in a specific folder?

痞子三分冷 提交于 2019-12-06 04:47:09
问题 I have an application (C++ Builder 6.0) that needs to know the total of images there are in a specific folder, and then I have to load them: in an ImageList or in a ComboBoxEx... or any other control... How can I do that? I know how to load an image in a control, or to save in a TList, or in an ImageList... but How to know how many files files there are in the directory, and how to load every image in it?? I am Sorry about my English. 回答1: I did something like this yesterday with C++ using

Delphi compiler error E2064 left side cannot be assigned to

荒凉一梦 提交于 2019-12-06 04:43:20
问题 I inherited a Delphi application and I know nothing about object pascal. It's a BPL that I need to compile into the new version of C++ Builder XE . When I run a make I get the error: E2064 left side cannot be assigned to. I've learned enough obj pascal to know I have a constant that is trying to be assigned a value. But, apparently, you can over ride this behanvior; essentially turning constants into vars by going into Build options under the Delphi compiler and turning on "Assignable Typed

“Unable to complete network request” or “connection rejected” for Firebird, on just one machine

安稳与你 提交于 2019-12-06 03:22:23
问题 I've got a seemingly unique issue on just one computer in the company (had to be my boss's). I've got a program from Borland C++ that uses a TSQLConnection . It connects to a local Firebird server 2.1.1.17910 running as an application. The other computers work fine. It will absolutely not connect on this one lappy (local server) for anything . I remember he always had trouble with InterBase when it was installed as well. I think he installed up to 7.5 possibly. It's gone now and I went

WinCheat / WinSpy-like tool for C++ Builder exes

好久不见. 提交于 2019-12-06 03:01:26
问题 I just came back to C++ Builder after 5 or more years away. I seem to remember a nice tool where I could drag its pointer over the GUI of my running application and get lots of info about what was pointed at - handle, size, text, parent, children, etc IIRC, if the exe include debug info I could also get the actual variable name as used in the source. Does anyone know what program I am talking about? Thanks 回答1: There are several options: Winspector This is the program I've used the most of