CFRONTusing C

Hi Guys, I have a problem with cfront using C. I work with 3.60 cronus database and using lccwin32 C compiler (ansi C). I already add the Cfront previllege and using Windows authentication, and i already cfront in my license. It works fine if i run sample.exe with my database server, but when i try to write the code myself (copy and paste from sample.c), then i run executable file, this error message always came up: The instruction at “0x0000000” referenced memory “0x0000000”. Memory could not be read. and the error message comes up when i execute this line : DBL_ConnectServerAndOpenDatabase(NDBCDriverName,ServerName,NetType,DatabaseName,10000,1,1,0,0); Does anyone have an idea ? Ok this is my source code : ----------------------------- #include <stdio.h> #include <string.h> #include “cf.h” typedef struct { DBL_S32 FieldNo; DBL_U8 FieldName; DBL_U16 FieldType; DBL_S16 FieldLen; DBL_S16 FieldSize; DBL_U8 OptionStr; DBL_S16 FieldClass; } FieldDefinitionType; FieldDefinitionType fieldsstruct[] = { { 10, (DBL_U8)“F1”, DBL_Type_S32, 4, 4 , NULL, 0 }, { 20, (DBL_U8)“F2”, DBL_Type_STR, 30, 30+1, NULL, 0 }, { 30, (DBL_U8*)“F3”, DBL_Type_ALPHA, 10, 10+2, NULL, 0 }, { 40, (DBL_U8*)“F4”, DBL_Type_BCD, 12, 12, NULL, 0 }, { 50, (DBL_U8*)“F5”, DBL_Type_O32, 4, 4, (DBL_U8*)“a,b,c,d,e”, 0}, { 60, (DBL_U8*)“F6”, DBL_Type_BOOL, 4, 4, NULL, 0 }, { 70, (DBL_U8*)“F7”, DBL_Type_DATE, 4, 4, NULL, 0 }, { 80, (DBL_U8*)“F8”, DBL_Type_TIME, 4, 4, NULL, 0 }, { 90, (DBL_U8*)“F9”, DBL_Type_BLOB, 8, 8, NULL, 0 }, { 100, (DBL_U8*)“F10”, DBL_Type_DATEFORMULA, 32, 32, NULL, 0 }, { 110, (DBL_U8*)“F11”, DBL_Type_S64, 8, 8, NULL, 0 }, { 120, (DBL_U8*)“F12”, DBL_Type_Duration, 8, 8, NULL, 0 }, { 130, (DBL_U8*)“F13”, DBL_Type_Datetime, 8, 8, NULL, 0 }, { 140, (DBL_U8*)“F14”, DBL_Type_GUID, 16, 16, NULL, 0 } }; int main() { DBL_U8 NDBCDriverName = (DBL_U8)“ndbcn”; DBL_U8 *ServerName = “BN”; DBL_U8 NetType = (DBL_U8)“tcp”; DBL_U8 DatabaseName = (DBL_U8)""; DBL_S16 ExceptionHandlerTest = 0; DBL_U8 NavisionPath = (DBL_U8)""; DBL_HTABLE hMainTable; DBL_U8 *CompanyNamePtr = “CRONUS International Ltd.”; SessionInit(“cfront.dll”); DBL_ConnectServerAndOpenDatabase(NDBCDriverName,ServerName,NetType,DatabaseName,10000,1,1,0,0); return 0; }

From cfront doc example: DBL_ConnectServerandOpenDatabase(“NDBCS”, “TestServer”, “Named Pipes”, “test.fdb”, 0, 0, 1, “”, “”); Use UserID and pass empty string ton null.

Guys… it’s already solved. It’s compiler problem. Yesterday i used the same dll in VB6, and worked nice. About the function call parameters, actually it’s not problem Dalius… you can use that if you want to enter using Database Authentication. Mine using NT authentication so that’s why 7th param is 1 not 0.