P
Paul Schouten
Hey,
Currently im working on a project where a dynamic database is created in
memory, the database can be of any size both in the amount of rows aswell as
in the amount of columns. The database is filled with data from a mdb-file.
During this process i use the following lines to copy the data from the
db-file into memory:
case dbInteger:
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new
int;
memcpy((int*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(int*)varValue.intVal, sizeof(int));
case dbLong:
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new
long;
memcpy((long*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(long*)varValue.lVal, sizeof(long));
Im sure there are many other ways to do this, some of which probably much
more efficient and effective, however i've decided (by lack of knowledge
about other methods) to use this one.
Now this all works just fine but when i try this on the double-type i get an
"type cast: cannot convert from 'double' to 'double *'" error message.....
Can someone plz help me with this, i have no idea why this is happening!!!!
This is the code for the double: (nearly the same as the ones above except
for the types)
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new double;
memcpy((double*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(double*)varValue.dblVal, sizeof(double));
Cheers,
Paul
Currently im working on a project where a dynamic database is created in
memory, the database can be of any size both in the amount of rows aswell as
in the amount of columns. The database is filled with data from a mdb-file.
During this process i use the following lines to copy the data from the
db-file into memory:
case dbInteger:
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new
int;
memcpy((int*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(int*)varValue.intVal, sizeof(int));
case dbLong:
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new
long;
memcpy((long*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(long*)varValue.lVal, sizeof(long));
Im sure there are many other ways to do this, some of which probably much
more efficient and effective, however i've decided (by lack of knowledge
about other methods) to use this one.
Now this all works just fine but when i try this on the double-type i get an
"type cast: cannot convert from 'double' to 'double *'" error message.....
Can someone plz help me with this, i have no idea why this is happening!!!!
This is the code for the double: (nearly the same as the ones above except
for the types)
(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value = new double;
memcpy((double*)(((MEMFIELD*)(((MEMROW*)(mRec->Table))[x]).Field)[y]).Value,
(double*)varValue.dblVal, sizeof(double));
Cheers,
Paul