c++builder

Threads in C++ builder [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-04 06:48:11
I am new to c++ builder and unfamiliar with the threading I was hoping someone could post an example or point me in the right direction. I have a form which loads the formShow() function in c++ builder. It does what I want my program to do but only after that will it display the actual form. For this i need to thread the form and the background running of the program. Can anyone help me atall? It might be simplier to just delay your logic until after the OnShow event has exited, without using a thread at all. For example: const UINT WM_DO_WORK = WM_USER + 1; void __fastcall TForm1::FormShow

How to set my custom values on Y-axis of my chart [duplicate]

谁说胖子不能爱 提交于 2019-12-04 05:31:05
问题 This question already has an answer here : Closed 8 years ago . Possible Duplicate: teechart problem for series label Is There any way to print labels ex. Jan , Feb , Mar.... On Y-axis of tchart In Borland c++ 回答1: I don't have Borland C++, but assuming the TeeChart that comes with it is the same as the ActiveX TeeChart, you'll need to do something like this: chart.Axis.Left.Labels.Clear(); // Clear current labels chart.Axis.Left.Labels.Add(1, "January"); // Repeat for other months 来源: https:

How create an standalone (without DLL file dependencies) C++Builder console application like a Delphi application?

左心房为你撑大大i 提交于 2019-12-04 03:22:23
When I create a Delphi console application, I can deploy the generated EXE file without worrying about external DLL files. But if I create very simple C++Builder (version 2007) console application (no VCL ) the EXE file requires the CC3280MT.dll file to run. How can I avoid which my C++Builder console application requires the CC3280MT.dll file? Even this simple code cause this dependence: #include <iostream.h> #pragma hdrstop #pragma argsused int main(int argc, char* argv[]) { cout << "Hello" << endl; getchar(); return 0; } In the project options, uncheck the linker option "Dynamic RTL". In

TStringGrid - is there a simple way to get the “current/selected” row?

左心房为你撑大大i 提交于 2019-12-04 02:52:55
问题 I can go the long way round, loop over each row, get a TRect from CellRect(col, row) , then query its State for gdSelected ... But isn't there a quicker way to get the row number of the currently selected row, if any? 回答1: .Row for selected row, .Col for selected column 回答2: Please have a look at TStringGrid.Row . 来源: https://stackoverflow.com/questions/2107683/tstringgrid-is-there-a-simple-way-to-get-the-current-selected-row

Loading and Saving vectors to a file

烂漫一生 提交于 2019-12-03 21:32:47
I am using C++ Builder and I have a vector array of Appointment objects. I want to save it to and load it from a file. Currently, I am using ifstream and ofstream with binary files. I have a header that contains the size of the vector that will be saved alongside the data, so as to know its size when loading. Is serilization a better way to do this? If so, do I need to use the boost library, or another way? Here is my current code: class appointment { public: appointment(); appointment(TDateTime aDate, TDateTime aReminderDateTime, string aType, string aLocation, string aComments, bool

How do I debug a difficult-to-reproduce crash with no useful call stack?

怎甘沉沦 提交于 2019-12-03 19:04:51
问题 I am encountering an odd crash in our software and I'm having a lot of trouble debugging it, and so I am seeking SO's advice on how to tackle it. The crash is an access violation reading a NULL pointer: First chance exception at $00CF0041. Exception class $C0000005 with message 'access violation at 0x00cf0041: read of address 0x00000000'. It only happens 'sometimes' - I haven't managed to figure out any rhyme or reason, yet, for when - and only in the main thread. When it occurs, the call

Running VCL in a separate thread

怎甘沉沦 提交于 2019-12-03 17:15:14
I now have a rather rare situation. I have an application which directly interacts with Windows' message queue. This application also runs external Lua scripts with LuaJIT. I wanted to have a debugging facility for these scripts, so I've created a plain VCL application, and then converted it into a DLL library. When the first application starts a debugging session with the library, this DLL creates a separated thread, where the whole VCL facility is initialized and run. procedure TDebuggerThread.Execute; begin Application.Initialize; Application.MainFormOnTaskbar := True; Application

Detecting external content with TEmbeddedWB or TWebBrowser

依然范特西╮ 提交于 2019-12-03 16:37:17
I am trying to block anything external loaded by TEmbeddedWB or TWebBrowser (or TCppWebBrowser). I would like to block anything that is loaded from Internet including images, javascript, external CSS, external [embed] or [object] or [applet] or [frame] or [iframe], executing JavaScript that can load external content etc. This problem consists of 2 parts: putting web browser into "restrict all" (except basic HTML without images) and detecting if such content exists if external content is not present ok, if it is, showing a "download bar" which after click puts web browser into "download all"

HTML Editor for CBuilder/Delphi

时光怂恿深爱的人放手 提交于 2019-12-03 16:03:09
I need to find basic WYSIWYG HTML editor component for C++Builder 5 to let users to create some simple text that I will paste into existing HTML page template. Just a simple support to create links, add images, use headers/bold/italic. You can drop a TWebBrowser on a form and enable designmode on it, like this: // Delphi code.. (WebBrowser1.Document as IHTMLDocument2).designMode := 'on'; After executing the above line, the page will be editable. You can type extra text, delete, etc. If you want to make selections bold or insert images, you're going to have to add some buttons to program that.

Converting COFF lib file to OMF format

老子叫甜甜 提交于 2019-12-03 15:57:02
Is there any way to convert COFF library (lib file) to OMF library for using with C++Builder6 ? This coff is not just import library, it conatians some code. When I try to convert it using borland's coff2omf.exe, I get 1KB file from 15KB file. It's fairly typical for an OMF object file to be a lot smaller than an equivalent COFF object, so what you're getting may well be valid. If you find that it's really not, you can probably break the lib file into individual object files, disassemble the object files, re-assemble them to OMF object files, and put those together into an OMF lib file.