Ok, I tried creating a DLL,but still have same issue.
The only way I was able to correct the linking errors was installing c+
+ express 2008.
When I googled the original issue, there was a a few people having
issues with 2010.
Now my question is different.
What is your suggestion for converting C to xblite syntax.
Ex:
[code]
enum cli_var_type {
cli_oid,
cli_bool,
cli_int1,
cli_int2,
cli_int4,
cli_int8,
cli_real4,
cli_real8,
cli_decimal,
cli_asciiz, /* zero terminated string */
cli_pasciiz, /* pointer to zero terminated string */
cli_cstring, /* string with counter */
cli_array_of_oid,
cli_array_of_bool,
cli_array_of_int1,
cli_array_of_int2,
cli_array_of_int4,
cli_array_of_int8,
cli_array_of_real4,
cli_array_of_real8,
cli_array_of_decimal,
cli_array_of_string, /* array of pointers to zero terminated
strings */
cli_any, /* use the same type for column as stored in the
database */
cli_datetime, /* time in seconds since 00:00:00 UTC, January 1,
1970. */
cli_autoincrement, /* column of int4 type automatically assigned
value during record insert */
cli_rectangle,
cli_unknown
};
typedef struct cli_field_descriptor {
enum cli_var_type type;
int flags;
char_t const* name;
char_t const* refTableName;
char_t const* inverseRefFieldName;
} cli_field_descriptor;
int cli_create_table(int session, char_t const* tableName, int
nColumns,
cli_field_descriptor* columns)
[code]
I created a .dec file with the following types
[code]
TYPE cli_field_descriptor
USHORT .type
XLONG .flags
ULONG .name
ULONG .refTableName
ULONG .inverseRefFieldName
END TYPE
EXTERNAL CFUNCTION SLONG cli_create_table(XLONG
session,tableName,ULONG nColumns,ANY)
[code]
The sample code that came from the author of the C code is using it
like this.
[code]
static cli_field_descriptor person_descriptor[] = {
{cli_asciiz, cli_hashed|cli_unique, _T("name")},
{cli_int4, cli_indexed, _T("salary")},
{cli_pasciiz, 0, _T("address")},
{cli_real8, 0, _T("rating")},
{cli_array_of_string, 0, _T("pets")},
{cli_array_of_oid, 0, _T("subordinates"), _T("person")}
rc = cli_create_table(session, _T("person"), sizeof(person_descriptor)/
sizeof(cli_field_descriptor),
person_descriptor);
[code]
I am able to correctly run a different C call in xblite client no
problem from this same Dll, but I am having issue with either the C
struct or the passing of the array of cli_field_descriptor struct;
because the application will crash.
Any guidance is appreciated.
Michael