Not able to track error

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.
ConnectionThread is declared inside CTIMSStreamerDlg class.

CreateThread(NULL,0, (LPTHREAD_START_ROUTINE)CTIMSStreamerDlg::ConnectionThread, this, 0, &ThreadId3); should work.

And please, use [code][/code] tags when posting code.
Last edited on
Topic archived. No new replies allowed.