WG: AW: [Acdk-developer] Compiling problem
Brought to you by:
kommer
|
From: Roger R. K. <ko...@ar...> - 2005-06-13 07:11:03
|
Hi,
The problem with the code you send:
class ACDK_CORE_PUBLIC NewObjects : extends acdk::lang::Object=20
The macro ACDK_CORE_PUBLIC is reserved to acdk_core library to export =
the
symbols of acdk_core.
When you declare objects in executable, you don't need any export/import
macros:
class NewObjects : extends acdk::lang::Object=20
> This code can't be runned:
> RStringBuffer sb1 =3D new StringBuffer("M");
> RStringBuffer sb2 =3D sb1->clone();
This code should even not be compiled.
The clone() method returns a Robject and you should receive an error =
like
that:
error C2440: 'initializing' : 'class RefHolder<class =
acdk::lang::Object>'
cannot be converted into 'class RefHolder<class =
acdk::lang::StringBuffer>'.
You have to cast the Robject result:
RStringBuffer sb2 =3D (RStringBuffer)sb1->clone();
See also:
http://acdk.sourceforge.net/acdk/docs/hb/lang/acdk_hb_lang_casting.html
> System::out->println(this->getClass()->getName());
> The result of this is "acdk::lang::Object".
ACDK uses metainfo / extented runtime type information generated by the
acdkmc compiler:
The first step is to modify the header:
ACDK_DECL_CLASS(NewObjects);
class NewObjects : extends acdk::lang::Object {
ACDK_WITH_METAINFO(NewObjects) // THIS is for the metainfo
private:
int myValue;
=20
public:
NewObjects(int intParam);
virtual ~NewObjects();
static int acdkmain(RStringArray args);
void showValues();
};
acdkmc works for complete modules/directories. It also expects an header
file with the exact name of the directory. In this case acdktest1.h.
Then execute the metacompiler acdkmc:
C:\d\artefaktur\extern>ls
acdktest1 acdktest1.rar acdkx_servlet
C:\d\artefaktur\extern>..\acdk\bin\acdkmc_d acdktest1
I: Analyse file: C:\d\artefaktur\extern\acdktest1\acdktest1.h
I: Analyse file: C:\d\artefaktur\extern\acdktest1\NewObjects.h
C:\d\artefaktur\extern>
This will generate 2 cpp files. Add the files to the project.
Then you will receive the results you expected.
See also:=20
http://acdk.sourceforge.net/acdk/docs/hb/lang/acdk_hb_dmi_server_objects.=
htm
l
And
http://acdk.sourceforge.net/acdk/docs/hb/lang/acdk_hb_mi.html
The corrected version is included in this mail.
Hope this helps.
Roger
-----Urspr=FCngliche Nachricht-----
Von: acd...@li...
[mailto:acd...@li...] Im Auftrag von =
Miroslav
Nachev
Gesendet: Freitag, 10. Juni 2005 14:58
An: Roger Rene Kommer
Cc: acd...@li...
Betreff: Re: AW: [Acdk-developer] Compiling problem
Dear Roger,
Can you check the attached code with the project settings? I try your
suggestions but without success. Just 1st, the 2nd I can't understand.=20
When I start the same application I found the following problems:
1. System::out->println(this->getClass()->getName());
The result of this is "acdk::lang::Object".
I expect to be "NewObjects".
2. This code can't be runned:
RStringBuffer sb1 =3D new StringBuffer("M");
RStringBuffer sb2 =3D sb1->clone();
=20
Best Regards,
Miroslav Nachev
|