mercredi 25 février 2015

Error: missing type specifier

I'm trying to do my first application on C++ using MVC pattern. So, I have a view class, ClientTsFrm, and the ClientTS class, the controller. To notify to the view class, I decided to use the Observer pattern, so ClienTS heritages from Subject.h.


ClientTsFrm has a member called ClientTS in order to do a communication, but when I build the project, it shows this error:



Error 51 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (src\lib\ClientTS.cpp) TeamTranslate


Error 50 error C2143: syntax error : missing ';' before '*' (src\lib\ClientTS.cpp)



ClientTsFrm.h



class ClientTsFrm : public wxFrame
{
private:
DECLARE_EVENT_TABLE();
double conta;
void askForSaving();
void WxButton1Click(wxCommandEvent& event);
void btnsendClick(wxCommandEvent& event);
void txtchatClick(wxRichTextEvent& event);
void txtchatEnter(wxCommandEvent& event);
void OnTimerTimeout(wxTimerEvent& event);
void WxTimer1Timer(wxTimerEvent& event);
void txtmsgEnter(wxCommandEvent& event);
void RefreshChat();
void btnspeechClick(wxCommandEvent& event);
void ClientTsFrmActivate(wxActivateEvent& event);
void WxButton2Click(wxCommandEvent& event);
void WxTimer2Timer(wxTimerEvent& event);
void gridchatCellLeftClick(wxGridEvent& event);
void Debug(wxCommandEvent& event);
void Wizard(wxCommandEvent& event);
void WxBitmapButton1Click(wxCommandEvent& event);
void Mail(wxCommandEvent& event);
void SettingMail(wxCommandEvent& event);
void Save(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);

void notifyMsg(MessagePTR msg);

public:

ClientTsFrm(LoginWarnings *warn, wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("TeamTranslate"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX | wxRESIZE_BORDER);

virtual ~ClientTsFrm();

//void ClientTsFrm::notify(ClientTsFrm fn);

private:
Session* session;
ConfigPTR config;
NationList *nations;
int REFRESHTIMER = 0;
uint64 _sclogID;
wxTimer *WxTimer2;
wxTimer *WxTimer1;
wxButton *btnspeech;
wxRichTextCtrl *txtclient;
wxTextCtrl *txtlingua;
wxStaticText *lbllingua;
wxStaticText *lblnick;
wxTextCtrl *txtnick;
wxRichTextCtrl *txtchat;
wxButton *btnsend;
wxTextCtrl *txtmsg;
wxGrid *gridchat;
wxGrid *gridclient;
wxBoxSizer *sizer;
wxGridSizer *gridsizer;
wxMenuBar *WxMenuBar1;
wxMenu *ID_MNU_FILE_1001_Mnu_Obj;
wxMenu *ID_MNU_OPZIONI_1004_Mnu_Obj;
wxBitmapButton *WxBitmapButton1;
ClientTS clientts;
};


ClientTS.h



class ClientTS : public Subject<EventTS>{
static Session* session;
static ConfigPTR config;
static bool flagSave;
static char LANG_MSG_SRC[500];
static char MSG_SRC[500];

public:
ClientTS(){
session = Session::Instance();
config = session->getConfig();
}
~ClientTS(){}

static char* getLANG_MSG_SRC(){ return LANG_MSG_SRC; }

static char* getMSG_SRC(){ return MSG_SRC; }

static bool getFlagSave(){ return flagSave; }

static void setFlagSave(bool flg){ flagSave = flg; }

static void speak(char *LANG, char*MSG);
static void Print(char*word);
static size_t read_callback(static void *ptr, size_t size, size_t nmemb, static void *userp);
static void writeWaveFile(const char* filename, SAudioStreamFormat format, static void* data);
static void SetupColor();
static void onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber);
static void onNewChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID);
static void onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier);
static void onDelChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier);
static void onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage);
static void onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility);
static void onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* timeoutMessage);
static void onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, anyID clientID);
static void onIgnoredWhisperEvent(uint64 serverConnectionHandlerID, anyID clientID);
static void onServerErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage);
static void onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString);
static void onCustomPacketEncryptEvent(char** dataToSend, unsigned int* sizeOfData);
static void onCustomPacketDecryptEvent(char** dataReceived, unsigned int* dataReceivedSize);
static void onEditMixedPlaybackVoiceDataEvent(uint64 serverConnectionHandlerID, short* samples, int sampleCount, int channels, const unsigned int* channelSpeakerArray, unsigned int* channelFillMask);
static void showChannels(uint64 serverConnectionHandlerID);
static void showChannelClients(uint64 serverConnectionHandlerID, uint64 channelID);
static void onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message);
static void showClients(uint64 serverConnectionHandlerID);
static void createChannel(uint64 serverConnectionHandlerID, const char *name);
static void deleteChannel(uint64 serverConnectionHandlerID);
static void renameChannel(uint64 serverConnectionHandlerID);
static void switchChannel(uint64 serverConnectionHandlerID);
static void toggleVAD(uint64 serverConnectionHandlerID);
static void setVadLevel(uint64 serverConnectionHandlerID);
static void requestWhisperList(uint64 serverConnectionHandlerID);
static void requestClearWhisperList(uint64 serverConnectionHandlerID);
static void toggleRecordSound(uint64 serverConnectionHandlerID);
static int readIdentity(char* identity);
static int writeIdentity(const char* identity);
static uint64 enterChannelID();
static void createDefaultChannelName(char *name);
static void enterName(char *name);
};


Hope someone could help me. If you need more code, just let me know please.


Thank you for your time.


Aucun commentaire:

Enregistrer un commentaire