I don't know what is wrong with me. After testing SQL ODBC connect I started to develop main application. I generated MDI app. with wizard. Iz compiled well until i added SQLAllocHandle. Below is code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <winuser.h>
#include <sql.h>
#include <sqlext.h>
#include <stdio.h>
#include "main.h"
#include "statusbar.h"
#include "toolbar.h"
HINSTANCE g_hInst; // instance handle
HWND g_hWndFrame; // main window handle
HWND g_hWndClient; // mdi client window handle
HWND g_hWndToolBar; // toolbar window handle
HWND g_hWndStatusBar; // statusbar window handle
HBITMAP g_hBmp; // toolbar button's bitmap
int numParts = 4; // number of sections for statusbar
// ODBC connection to Mafips30 database *************************************************************************
static void extract_error(
char *fn,
SQLHANDLE handle,
SQLSMALLINT type);
SQLHENV env;
SQLHDBC dbc;
SQLHSTMT stmt;
SQLRETURN ret; /* ODBC API return status */
SQLCHAR outstr[1024];
SQLSMALLINT outstrlen;
/* Allocate an environment handle */
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
// End od ODBC connect **********************************************************************************************
This line produced following errors:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <winuser.h>
#include <sql.h>
#include <sqlext.h>
#include <stdio.h>
#include "main.h"
#include "statusbar.h"
#include "toolbar.h"
HINSTANCE g_hInst; // instance handle
HWND g_hWndFrame; // main window handle
HWND g_hWndClient; // mdi client window handle
HWND g_hWndToolBar; // toolbar window handle
HWND g_hWndStatusBar; // statusbar window handle
HBITMAP g_hBmp; // toolbar button's bitmap
int numParts = 4; // number of sections for statusbar
// ODBC connection to Mafips30 database *************************************************************************
static void extract_error(
char *fn,
SQLHANDLE handle,
SQLSMALLINT type);
SQLHENV env;
SQLHDBC dbc;
SQLHSTMT stmt;
SQLRETURN ret; /* ODBC API return status */
SQLCHAR outstr[1024];
SQLSMALLINT outstrlen;
/* Allocate an environment handle */
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
// End od ODBC connect **********************************************************************************************
This line produced three errors (line 48)
D:\Pelles_Razvoj\MaFiP'S 3.0\mafips30\main.c(48): warning #2099: Missing type specifier.
D:\Pelles_Razvoj\MaFiP'S 3.0\mafips30\main.c(48): error #2001: Syntax error: expected ')' but found 'integer constant'.
D:\Pelles_Razvoj\MaFiP'S 3.0\mafips30\main.c(48): error #2120: Redeclaration of 'SQLAllocHandle' previously declared at C:\Program Files\PellesC\Include\Win\sql.h(433): found 'int __cdecl function()', expected 'short int __stdcall function(short int, void *, void * *)'.
D:\Pelles_Razvoj\MaFiP'S 3.0\mafips30\main.c(147): warning #2168: Operands of = have incompatible types 'int __stdcall function(HWND, long int)' and 'int __cdecl function(HWND, long int)'.
D:\Pelles_Razvoj\MaFiP'S 3.0\mafips30\main.c(534): warning #2030: = used in a conditional expression.
*** Error code: 1 ***
It would also be very helpful if someone could explain last two warning messages.