problem with .... const char [10]' to 'LPCTSTR

I have just started programming in MFC and was given a tutorial by my lecturer, unfortunately the very first very simple program is not working. My lecturer is away for a week so im stuck! also i have only 3-4 weeks to start and finish a GUI project!

Anyway here's my main code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 //this is the file lab9.cpp
#include "C:\Documents and Settings\Administrator\My Documents\MFC\lab9\lab9.h"

//define our window constructor
COurWin::COurWin()
{
	//Call CframWnd's creator() function
	Create(NULL, "my_window");
}

BOOL COurApp::InitInstance()
{
	m_pMainWnd = new COurWin;
	m_pMainWnd->ShowWindow(m_nCmdShow);
	m_pMainWnd->UpdateWindow();
	return TRUE;
}

BEGIN_MESSAGE_MAP(COurWin, CFrameWnd)
END_MESSAGE_MAP()

COurApp App;


and this is the header file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This is the file lab9.h 
// Include standard windows functions and classes 
#include <afxwin.h> 
// We always derive classes from the main MFC classes 
// Derive main window class 

class COurWin:public CFrameWnd 
{ 
// We shall want control over construction 
public: 
	COurWin(); 

	// We must declare the message map - no semi-colon 
	DECLARE_MESSAGE_MAP() 
}; 

// Derive application class 
class COurApp : public CWinApp 
{ 
	// We need to override InitInstance() 
	BOOL InitInstance(); 
};

I don't really know a lot about this program but it is giving up the error -
error C2664: 'CFrameWnd::Create' : cannot convert parameter 2 from 'const char [10]' to 'LPCTSTR'

can anyone help?
Last edited on
Try
Create(NULL, TEXT("my_window") );

Also, avoid full paths in #include statements. Better is just:
#include "lab9.h"

Hope this helps.
yeah that worked thanks very much
though got another problem here:
http://www.cplusplus.com/forum/windows/9263/
Topic archived. No new replies allowed.