Category : properties

I am using C++ Builder 10.2.3 I am trying to add properties to different classes (about 10). For example in one class I added: __property UnicodeString sdkPath = {read=get_sdkPath, write=set_sdkPath}; ER_PROPERTY(UnicodeString, sdkPath, "") __property UnicodeString algorithm = {read=get_algorithm, write=set_algorithm}; ER_PROPERTY(UnicodeString, algorithm, "") ER_PROPERTY is defined as: #define ER_PROPERTY(TYPE,NAME,DEFAULT); TYPE get_##NAME() const { return NAME; } ..

Read more

I got an assignment from my school, I need to make a script for a management service, and it says 5 requirements: 1:Query regarding service management 2:Query service selection 3:Query regarding correctness of selection or new selection 4:Calibrates service and specifies possible parameters (start, stop,) 5:parameter can be selected, which is then applied to the ..

Read more

Im making a Random Generator with Windows Forms with Images and I use the random pick with resources pictureBox1.Image = Properties.Resources.heart; Now, the "heart" should get removed from the List, to prevent getting "heart" again. Here I thought, that I just use int firstCard = randomCard.Next(cards.Count); and I want to use the int firstCard as ..

Read more

Has anything changed in C++ interpretations, and __property functionality? Trivial example: class TMyLittleClass { private: TDateTime myDateTime; protected: TDateTime getMyDateTime(); void setMyDateTime(TDateTime); public: TMyLittleClass(){myDateTime=Now();}; __property TDateTime MyDateTime = {read = getMyDateTime,write=setMyDateTime}; }; somewhere further down in the code we make a call: // it works ok…. TDateTime dttTemp; dttTemp.Val = 0; however, something like this: ..

Read more

I created a class called property which behaves mostly the same as the C# style properties. The progress is not yet complete but I have an adequate snippet of code here: template <typename T> class property { private: T value; public: property(T& value_) : value{value_} {} // setter property<T>& operator=(const T& value_) { value = ..

Read more

Consider the following code: class MyClass { private: int num; //num has getter and setter, which I will not include here for obvious reasons public: MyClass() { num = 2; } void someFunc(int someVar = num) { //error: a non-static member reference must be relative to a specific object //whatever } } Why is that ..

Read more

I’m trying to develop some MSBUILD skills, and I feel that I should be able to create a user properties file that does what I want. In our propriatary build system, we have a Plug-IN that takes files of type *.foo and creates an itemlist for generated *_foo.cpp modules. However it inherits the global project ..

Read more