Board index » cppbuilder » Property Editor member variable problem

Property Editor member variable problem

I have a private member variable of std::wstring in my property editor. It
does not seem to ever get instantiated. How is the property editor
constructed ? All my first attempts to access this vraibale via a "if
(mywideval.empty()) // etc." leads to access violations. Does anybody have
any idea what I am missing here ?
 

Re:Property Editor member variable problem


What does your actual code look like?

Property Editors are classes like any ohter, they are constructed the same
way as any other class.  It's just that the IDE itself, not your own code,
is who is instantiating them, that's all.

Gambit

Quote
"Edward Diener" <eddie...@tropicsoft.com> wrote in message

news:3cdd4e08$1_2@dnews...
Quote
> I have a private member variable of std::wstring in my property editor.
> It does not seem to ever get instantiated. How is the property editor
> constructed ? All my first attempts to access this vraibale via a "if
> (mywideval.empty()) // etc." leads to access violations. Does anybody
> have any idea what I am missing here ?

Re:Property Editor member variable problem


"Remy Lebeau [TeamB]" <gambi...@yahoo.com> wrote in message
news:3cdd7600$1_1@dnews...

Quote
> What does your actual code look like?

> Property Editors are classes like any ohter, they are constructed the same
> way as any other class.  It's just that the IDE itself, not your own code,
> is who is instantiating them, that's all.

Actually not as far as the constructor goes. Because of another one of those
OP quirks, with the fact that property editors use the virtual constructor
syntax, if I don't manually supply a constructor to my property editor, it
seems as if my internal members never get constructed but only zeroed out. I
solved the problem by adding a

__fastcall MyPropertyEditor::MyPropertyEditor(const _di_IFormDesigner
ADesigner, int APropCount);

constructor to the class, after which my internal std::wstring default
constructor gets properly initialized. Without this, the default constructor
for std::wstring never gets called.

Once again I congratulate Borland on another OP stupidity ! Besides virtual
functions that get called before the constructor completes and after the
destructor completes I can now add constructors never being called to the OP
Hall of Shame. No wonder Hejlsberg moved on to MS. He didn't have another
language at Borland which he could royally{*word*222}up and MS has given him 2
already.

Other Threads