Jun 12, 2012 at 4:59pm UTC
Its mine Pmain.h
#ifndef Pmain_H
#define Pmain_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
#include<conio.h>
// Need to link with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")
#pragma comment (lib, "AdvApi32.lib")
class CTIMSStreamerDlg
{
public:
//DWORD ConnectToServer(char* wServerIP,int wServerPort,BOOL ResetMessQueue = TRUE);
protected:
//extern HANDLE m_hNewMsg;
//DWORD ConnectToServer(char* wServerIP,int wServerPort,BOOL ResetMessQueue = TRUE);
public:
//Threads
static DWORD WINAPI MessageHandleThread(CTIMSStreamerDlg* pStreamerDlg);
static DWORD WINAPI VideoStatusThread(CTIMSStreamerDlg* pStreamerDlg);
static DWORD WINAPI ConnectionThread(CTIMSStreamerDlg* pStreamerDlg);
static DWORD WINAPI MessageReplyThread(CTIMSStreamerDlg* pStreamerDlg);
void StartConnectionThread();
};
#endif
Its mine Pmain.cpp
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
#include<conio.h>
#include"Pmain.h"
#include"FINetCom.h"
#include<iostream>
#include"Log.h"
#include<string.h>
#include <atlstr.h>
int main()
{
Createini();
StartConnectionThread();
}
void StartConnectionThread()
{
printf("StartConnectionThread() Entering into StartConnectionThread.\n");
DWORD ThreadId3;
m_hConnectionThread = CreateThread(NULL,0, (LPTHREAD_START_ROUTINE)ConnectionThread , this, 0, &ThreadId3);
if(m_hConnectionThread == NULL)
{
printf("Error: StartConnectionThread() Unable to create connection thread.\n");
}
m_bConnectionFlag = false;
printf("Info: StartConnectionThread() Leaving from StartConnectionThread.\n");
}
DWORD WINAPI CTIMSStreamerDlg::ConnectionThread(CTIMSStreamerDlg* pStreamerDlg)
{
}
The problem is that the visual studio says that ConnectionThread is undeclared although i have declared it in the Pmain.h and included the Pmain.cpp
I don't know why am i getting this error.
Jun 12, 2012 at 5:13pm UTC
ConnectionThread
is declared inside CTIMSStreamerDlg
class.
CreateThread(NULL,0, (LPTHREAD_START_ROUTINE)CTIMSStreamerDlg:: ConnectionThread, this , 0, &ThreadId3);
should work.
And please, use [co de][/code] tags when posting code.
Last edited on Jun 12, 2012 at 5:15pm UTC