long ABLFile::create (char* fName) { if (fName) { fileName = (char*)ABLSystemMallocCallback(strlen(fName)+1); strcpy(fileName,fName); return(createCB(&file, fileName)); } return(-1); }
int32_t ABLFile::create(PSTR fName) { if (fName) { fileName = (PSTR)ABLSystemMallocCallback(strlen(fName) + 1); strcpy(fileName, fName); return (createCB(&file, fileName)); } return (-1); }
// // FUNCTION: InitInstance (HINSTANCE, int) // // PURPOSE: Saves instance processing and creates the main window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { hInst = hInstance; // Save the instance handle in a global variable hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); if (!hWnd) { return FALSE; } LV LVSettings = { 15, // X position 45, // Y position 210, // width 500, // height 3, // amount of columns { TEXT("N"), TEXT("X"), TEXT("Y") }, // name of columns 70 // width of column }; hwndListView = createLV(LVSettings); CB CBSettings = { 15, // X position 15, // Y position 100, // width 200, // height 3, // amount of items { TEXT("sin"), TEXT("x^2"), TEXT("ln") }, // name of items }; hwndComboBox = createCB(hWnd, CBSettings); EDIT EDITSettings; EDITSettings = { 125, // X position 15, // Y position 100, // width text 40, // width field 24, // height TEXT(" Start:"), // Name ID_EDITBEGINX // Edit ID }; createEditField(EDITSettings); EDITSettings = { 260, // X position 15, // Y position 100, // width text 15, // width field 24, // height TEXT(" Polynom:"), // Name ID_POLYNOM // Edit ID }; createEditField(EDITSettings); EDITSettings = { 370, // X position 15, // Y position 130, // width text 45, // width field 24, // height TEXT(" Search X:"), // Name ID_SEARCHX // Edit ID }; createEditField(EDITSettings); CreateWindowW(TEXT("BUTTON"), TEXT("Apply"), WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 510, 15, 50, 24, hWnd, (HMENU)ID_BUTTONAPPLY, hInstance, NULL); Array = createSequence(); TCHAR buf[10]; SearchX = _wtof(valueFromTextField(ID_SEARCHX, buf)); Polynom = _wtoi(valueFromTextField(ID_POLYNOM, buf)); newtonY = newton_method(SearchX, Polynom); splinesY = splines_method(SearchX); RealY = myFunc()(SearchX); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; }