Search found 1795 matches

by rlebeau
Wed Apr 14, 2021 1:59 pm
Forum: Technical
Topic: Sort TList of structures
Replies: 9
Views: 11218

Re: Sort TList of structures

It is a topic, that of reordering, which I have not yet explored very well as, I happen to use it very rarely. You have to know is that you have a container of items, and an interface is provided by that container for sorting its items. As I said in my very first reply, for the examples given, that...
by rlebeau
Wed Apr 14, 2021 8:49 am
Forum: Technical
Topic: Criteque my code please
Replies: 2
Views: 91

Re: Criteque my code please

theLizard wrote: Tue Apr 13, 2021 9:18 pm Is it possible to distribute the bpl without the header files?
If you intend to use the classes in other C++ projects, then no.
by rlebeau
Tue Apr 13, 2021 3:25 pm
Forum: Technical
Topic: Sort TList of structures
Replies: 9
Views: 11218

Re: Sort TList of structures

sorry Remy, what if I want to reorder the list for a, c, e? Is there something about my previous examples that doesn't make sense to you, that is preventing you from sorting the list items however you want ? Try this: int __fastcall SortMyStructByAandCandE(void * Item1, void * Item2) { MyStruct *my...
by rlebeau
Thu Apr 08, 2021 7:30 pm
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

I have compiled the component and installed without issues but when I drop the component on a form I get lots of unresolved external errors, I have set all the paths for includes, libs etc. I don't know what to tell you. It has been many years since the last time I wrote a usable component in C++ i...
by rlebeau
Thu Apr 08, 2021 6:11 pm
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

Ok, had a couple of errors but I got your code to compile, and installed the component but when I went to compile the test project with components on the form I get this error, tried to see what was going on but lost. All of those failing symbols are from the standard C++ library, which you were al...
by rlebeau
Wed Apr 07, 2021 9:12 pm
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

the following are still global, all other vars have been moved to the class or made local to the method, hop this is ok. std::vector<TDBRecords*> qr; //for database table records std::vector<TDBRecords*> qp; //for field properties called by pragma std::vector<TDBRecords*> tn; //used to get table na...
by rlebeau
Wed Apr 07, 2021 10:19 am
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

If you have a moment, could you point to an area where this is an issue and suggest a fix so that I can learn a bit more, always willing.. Here we go (there are a LOT of them): TDBRecords* q; TBaseRecord* r; char *_ident; std::vector<TBaseRecord*> rc; std::vector<TDBRecords*> qr; //for database tab...
by rlebeau
Tue Apr 06, 2021 7:01 pm
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

The following is th .h file for the other component You have a circular dependency problem. TSqliteAgent.h #include's TSqliteComponent.h, and TSqliteComponent.h #include's TSqliteAgent.h. So you end up in a situation where the TSQLite class has not actually been defined yet when the compiler tries ...
by rlebeau
Tue Apr 06, 2021 5:31 pm
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

Not sure what you mean by this "is TSQLite a complete type before it is used in the" Do you know what a forward-declaration is? And the difference between a complete class type vs a forward-declared class type? OK, let me put it to you this way - preceding the offending __property declaration, does...
by rlebeau
Tue Apr 06, 2021 9:44 am
Forum: Technical
Topic: __property Not an allowed type in __published: section
Replies: 17
Views: 234

Re: __property Not an allowed type in __published: section

Pointers to TComponent-derived types are perfectly valid for __published properties, so you can link components to each other at design-time. I've written plenty of components with such properties, in both Delphi and C++. The code you have shown looks fine, so I have to think the error is related to...
by rlebeau
Fri Apr 02, 2021 10:41 am
Forum: Technical
Topic: TScene control raise exception on TControlsList.Create !!!
Replies: 3
Views: 156

Re: TScene control raise exception on TControlsList.Create !!!

Ahmed Sayed wrote: Mon Mar 29, 2021 6:10 pm It always raises exception ... even this raises exception ... does creating TControls List always raises exception ... only in c++ it raises that exception
What is the ACTUAL exception that is being raised?
by rlebeau
Thu Apr 01, 2021 6:29 pm
Forum: Technical
Topic: Multithreading with more reading than write. How?
Replies: 8
Views: 386

Re: Multithreading with more reading than write. How?

But there is no way for me like to favor Writes over reads. Right? No. for example if multiple read started before a write operation, is there a way to force it to execute the write first even if the reads threads where created first? This has nothing to do with the order in which the threads are c...
by rlebeau
Mon Mar 29, 2021 5:27 pm
Forum: Technical
Topic: Multithreading with more reading than write. How?
Replies: 8
Views: 386

Re: Multithreading with more reading than write. How?

Now, I know that in a multithreaded app I must surround the static variable with Critical section like this, in order to prevent creating more than one users list. That example does not offer any multi-threaded protection whatsoever for the reading/writing of the list's entries, only for the creati...
by rlebeau
Mon Mar 29, 2021 9:49 am
Forum: Technical
Topic: Multithreading with more reading than write. How?
Replies: 8
Views: 386

Re: Multithreading with more reading than write. How?

But let's say that 50 are reading from the users list to validate the token at that same time a user is trying to login that means that this user will have to wait for the other 50 to finish. Right? Yes. Which should be fine, because when writing thread-safe data access, the sections you want to pr...
by rlebeau
Fri Mar 26, 2021 4:36 pm
Forum: Technical
Topic: Multithreading with more reading than write. How?
Replies: 8
Views: 386

Re: Multithreading with more reading than write. How?

For now I use TCriticalSection only when add/remove a user to the map list. But when I read from the list I do it in the connection thread normally without using any critical sections. That is not thread-safe. A thread could be altering the map while other threads are trying to read from it. You mu...