Page 1 of 1

ODAC custom field types not working at design-time in C++Builder

Posted: Wed 15 Aug 2007 07:40
by tuasal
Whether usage of components

Code: Select all

TCursorField
TBFileField
TOraDataSetField
TOraReferenceField
TOraTimeStampField
TOraIntervalField
TOraNumberField
TOraXMLField
at design-time in C++Builder (version 6, and possible others) was tested? Or it should work only "theoretically"? :(

After I have added to dataset the field of type TOraTimeStampField such form does not wish to open by IDE (C++Builder 6); though it is compiled successfully. At careful studying the possible reasons it has been found, that ODAC library does not register any types of fields which list is resulted above.

All ODAC packages (.bpl) have been registered by me as is specified in a installation instructions. Only one version of ODAC library (6.10.1.10) is installed in system, and paths to packages are checked carefully, and also any "conflicts" should not be (with old or packages of another versions).

I have registered the specified fields classes "manually", i.e. have executed (for IDE):

Code: Select all

RegisterClass(TCursorField);
RegisterClass(TBFileField);
RegisterClass(TOraDataSetField);
RegisterClass(TOraReferenceField);
RegisterClass(TOraTimeStampField);
RegisterClass(TOraIntervalField);
RegisterClass(TOraNumberField);
RegisterClass(TOraXMLField);
After that the form with fields of type TOraTimeStampField (and others) opens successfully!

The same problem seems was described in the message "Class TOraNumberField not found. Ignore the error and continue?" and till now has not been solved (since December 2005)...

Posted: Wed 15 Aug 2007 11:44
by Plash
We could not reproduce the problem. Please specify the build number of your C++Builder.

Posted: Thu 16 Aug 2007 06:07
by tuasal
We are using C++Builder 6 build 10.166.

You wish to tell, that projects with fields of type (for example) TOraTimeStampField are normally open at you in C++Builder 6? Are you sure??? Whether it is possible to know, how exactly you checked it?

Then a question: Whether ODAC call the "RegisterClass(TOraTimeStampField)", or carries out similar actions in order to "register" the class TOraTimeStampField (and other fileds classes) in IDE?

I had to address to the one who has access to source code of ODAC (v6.10.1.10). And we have discovered that the call "RegisterClass(TOraTimeStampField)" is made only in one place. And before this call there is a check of a kind " if not IsLibrary then... " is made... But in case of .bpl (in which the ODAC components resides) this check ("not IsLibrary") returns (and always should return) "false". Because "IsLibrary variable is true if the module is a DLL", and .bpl IS a .dll library. And therefore the RegisterClass(TOraTimeStampField) should not be carried out, and the forms with TOraTimeStampField fileds (and others) not loaded by IDE in design-time - always, irrespective of C++Builder version or build number.

Posted: Thu 16 Aug 2007 07:53
by Plash
In our tests forms with a TOraTimeStampField are normally openning in C++Builder 6. IsLibrary is True for DLL but it is False for packages. So the RegisterClass procedure is called for all ODAC custom field types.

Posted: Thu 16 Aug 2007 08:57
by tuasal
Plash wrote:IsLibrary is True for DLL but it is False for packages
hmmm.... how it can be?.... :shock:

I have found some IsLibrary-related info: here "IsLibrary problem - false in DLL" and here "DLL and VCL problems".

...possibly, you are compiling the ODAC packages with runtime packages?

Posted: Thu 16 Aug 2007 11:45
by tuasal
It was discovered that the value of IsLibrary (at least in case of unit Ora.pas) can depend on: whether some IDE experts are used. For example, if any expert from the JCL/JVCL library used then IsLibrary returns true - as it occured at me. The same thing occured if GExperts is used. If specified experts disabled - then IsLibrary always contains value false (during the check in unit Ora.pas)!

Similar, it is impossible to rely on value of variable IsLibrary reliably... It can be possible to use any other method instead of check of value of the given variable?

Posted: Fri 17 Aug 2007 08:15
by Plash
We have added calls to the RegisterClass procedure in the Register procedure of ODAC design-time package. This fix will be included in the next ODAC build.