This is unbelievable! But, then again, I suppose I have had the same experience with java before. I'm sure it is a lack of experience in C++. So I hope you can help.
I created a class to keep a record of the employees:
-------------class Employees----------------
class Employees {
public:
Employees ();
void addEmployees(string employee);
};
void Employees::addEmployees(string employee) {
//Just to check if it is getting here
MessageBox(hwnd, "addEmployee", "here",
MB_OK | MB_ICONINFORMATION);
}
-------------End class Employees----------------
So I created a new .h file, since I did not want to use the main.h file that is used for most of the interface utilities.
-------Employee.h---------
#include <windows.h>
#define Employees
-------End Employee.h----------------------
And in my main implementation.........
#include <windows.h>
#include "main.h"
#include <string>
#include "Employee.h"
/*
I did actually name the . h file as Employee instead of Employees, in case you were wondering if the problem was that
*/
using namespace std;
/* Declare WindowsProcedure */
/*Not applicable................from here to....*/
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
void FileBox(HWND hwnd, HWND hListBox);
/* Make the classname into a global variable */
char szClassName[] = "Schedule";
HINSTANCE hThisInstance;
HWND hListBox;
/*Not applicable... ............here */
//on the following line I get an error(see #1 below)
Employees employ;
So, when I try to compile, I get:
#1
{
18 C:\Dev-Cpp\myProject\main.cpp
ISO C++ forbids declaration of `employ' with no type
}
I have followed many different tutorials to find a solution but have not yet found one. Hmmm...what to do........what to do.....