Search found 1759 matches

by rlebeau
Mon Jan 11, 2021 11:15 am
Forum: Technical
Topic: Migrating from CBuilder XE to Cbuilder 10.4
Replies: 5
Views: 223

Re: Migrating from CBuilder XE to Cbuilder 10.4

Where should i add this switch ? I don't see a checkbox/toggle for that switch in the Project Options, so you will have to manually add the switch to the IDE's command-line for the compiler. There should be an option somewhere to specify additional user-defined command-line options (sorry, I'm not ...
by rlebeau
Fri Jan 08, 2021 3:15 pm
Forum: Technical
Topic: Problem with TStringGrid
Replies: 6
Views: 197

Re: Problem with TStringGrid

What I want to do is use the String Grid as an array of edit boxes where the user can enter and edit data using the keyboard and mouse whilst the programme can display data to the user. This is not how TStringGrid should be used for that purpose. Don't capture individual keystrokes and populate the...
by rlebeau
Fri Jan 08, 2021 3:08 pm
Forum: Technical
Topic: Embarcadero CoCreateInstance exception 0x40000015
Replies: 22
Views: 914

Re: Embarcadero CoCreateInstance exception 0x40000015

I ask you once again if you see race condition issue if you were to instantiate 100 threads. This is not a hard idea to grasp. If multiple threads are sharing a variable, and at least 1 thread writes to that variable while any of the other threads are still making use of the variable, then you must...
by rlebeau
Thu Jan 07, 2021 10:58 am
Forum: Technical
Topic: Problem with TStringGrid
Replies: 6
Views: 197

Re: Problem with TStringGrid

The code shows that every key press I have tried is actually responded to by the code, just nothing appears in the cell. Are you wanting the text to appear in the currently selected cell? Because right now, you are sending the text to the same cell 1x1 regardless of whether it is actually selected ...
by rlebeau
Thu Jan 07, 2021 10:50 am
Forum: Technical
Topic: Embarcadero CoCreateInstance exception 0x40000015
Replies: 22
Views: 914

Re: Embarcadero CoCreateInstance exception 0x40000015

and if I have this situation: ... and I create 1000 threads, is there still race condition? Yes, because now you have a global variable (threadNumber) that is being shared across thread boundaries, so you need to protect it from concurrent access. The easiest way to do that in this example is to us...
by rlebeau
Thu Jan 07, 2021 10:44 am
Forum: Technical
Topic: Migrating from CBuilder XE to Cbuilder 10.4
Replies: 5
Views: 223

Re: Migrating from CBuilder XE to Cbuilder 10.4

typedef queue< PcPosRec > MsgQueue; i got the following error: [bcc32 Error] cdrv.hpp(53): E2257 , expected If there is no preceding 'using namespace std;' or 'using std::queue;' statement, you will need to fully qualify the class name: typedef std::queue< PcPosRec > MsgQueue; Otherwise, add a 'usi...
by rlebeau
Wed Jan 06, 2021 6:24 pm
Forum: Technical
Topic: String with 0/1 representation of binary to convert
Replies: 3
Views: 116

Re: String with 0/1 representation of binary to convert

Thus far, I have not found a String method that will do the same thing. Because there isn't one, not in the Delphi-based RTL anyway. The RTL has no concept of binary-encoded or octal-encoded strings. It does, however, have functions for decoding hex-encoded strings, via System::Sysutils::StrToInt()...
by rlebeau
Wed Jan 06, 2021 6:12 pm
Forum: General
Topic: Login problems on this forum
Replies: 2
Views: 113

Re: Login problems on this forum

Yes, I noticed that it logs me out between sessions even though I checked the "Remember me" box. It doesn't log me out between sessions. I'll login, do some activity, close the browser without logging out, come back later, and it still knows I'm logged in. OK so far. But then, if I go to post a mes...
by rlebeau
Wed Jan 06, 2021 2:06 pm
Forum: Technical
Topic: Embarcadero CoCreateInstance exception 0x40000015
Replies: 22
Views: 914

Re: Embarcadero CoCreateInstance exception 0x40000015

What I wanted to understand is if there is a race condition calling MyFunction () or does each thread create its own private copy of MuFunction ()? That is not how functions work. There is only 1 copy of the function code in memory. But each thread has its own local call stack with which to use for...
by rlebeau
Wed Jan 06, 2021 12:39 pm
Forum: General
Topic: Login problems on this forum
Replies: 2
Views: 113

Login problems on this forum

Anyone else having problems with this forum's login system? For awhile now, it has trouble remembering that I'm already logged in. Especially after posting a new message, it likes to log me out. I suspect the forum's cookie handling has been broken.
by rlebeau
Wed Jan 06, 2021 12:36 pm
Forum: Technical
Topic: Migrating from CBuilder XE to Cbuilder 10.4
Replies: 5
Views: 223

Re: Migrating from CBuilder XE to Cbuilder 10.4

Ofer G wrote: Mon Jan 04, 2021 10:18 am In the code i use the following:

#include <queue.h>
What are you trying to use from <queue.h> exactly? If you are trying to use the standard std::queue class, you need to include <queue> instead (drop the .h suffix).
by rlebeau
Wed Jan 06, 2021 12:29 pm
Forum: Technical
Topic: String with 0/1 representation of binary to convert
Replies: 3
Views: 116

Re: String with 0/1 representation of binary to convert

Edit1->GetTextBuf(Bin,Edit1->GetTextLen()+1); i1 = (_int64)wcstol(Bin, NULL, 2); will do the job, but it's a bit messy. That can be simplified by getting rid of the character buffer completely. You can use the UnicodeString as-is, eg: __int64 i1 = wcstol(Edit1->Text.c_str(), NULL, 2); However, do n...
by rlebeau
Wed Jan 06, 2021 12:08 pm
Forum: Technical
Topic: Problem with TStringGrid
Replies: 6
Views: 197

Re: Problem with TStringGrid

Entering text into a cell does not result in it showing. Entering HOW exactly? Via code, using the Cells property? Or via user input, using the built-in inplace editor? the characters to not appear in the cell. Do you, by chance, have an OnDrawCell event handler assigned, that is not drawing the te...
by rlebeau
Wed Jan 06, 2021 12:04 pm
Forum: Technical
Topic: Embarcadero CoCreateInstance exception 0x40000015
Replies: 22
Views: 914

Re: Embarcadero CoCreateInstance exception 0x40000015

I think I understand that the first and second solutions are equivalent Yes, they are. and MyFunction () does not generate race conditions if I instantiate 1000 threads, right? No. Both solutions have a very serious race condition - it is NOT safe to access GUI controls in worker threads without sy...
by rlebeau
Mon Jan 04, 2021 9:38 am
Forum: Technical
Topic: Embarcadero CoCreateInstance exception 0x40000015
Replies: 22
Views: 914

Re: Embarcadero CoCreateInstance exception 0x40000015

Every time I call this PlayBufferWasapi () function a number of objects are instantiated, right? Yes. If I never call back: audioClient-> Stop (); audioClient-> Release (); audioRenderClient-> Release (); at some point I'll find my memory full of objects, so to speak, PlayBufferWasapi () right? Yes...