
Urgent please help LPSTR Array function passing problem
Hi Everyone,
I have a problem which may be simple to some of you but its
giving me a headache.
I have a function :
/* ExternalFunctions.cpp */
#include "ExternalFunctions.h"
void FillArray(LPSTR Ar[][3], CRecordset * set)
{
int rec, Rows,Cols, c;
CString string;
Rows = set->GetRecordCount();
Cols = (short)set->GetODBCFieldCount();
if(set->Open())
{
for (rec=0; rec < Rows ;rec++)
{
for (c=0; c< Cols ;c++)
{
set->GetFieldValue((short)c,string);
strcat(Ar[rec][c],string.GetBuffer(80));
string.ReleaseBuffer();
}
set->MoveNext();
}
}
set->Close();
delete set;
Quote:
}
This fills an LPSTR array from a CRecordset.
The array has global scope i.e.
/* Ledger.h */
#include "ExternalFunctions.h";
extern LPSTR DDArray[][3];
/* Ledger.cpp */
LPSTR DDArray[][3];
This compiles with an error C2059 syntax error : ']'
on the function calling line in Ledger.cpp
FillArray(DDArray[][3], new CSetDistrictdivision(DB));
if I use:
FillArray(DDArray, new CSetDistrictdivision(DB));
I get another error LNK2001 unresolved external symbol "char * (*
How do I make this work do I change the calling function or is there
something wrong in the FillArray function.
Please help if you can this is delaying my development.
Thanks in advance.
Steven Henthorn
--
TxDOT
Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.