Click here to Skip to main content
15,895,815 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionConverse of measurestring Pin
deletethisprofile17-Apr-06 6:18
deletethisprofile17-Apr-06 6:18 
AnswerRe: Converse of measurestring Pin
Guffa17-Apr-06 6:42
Guffa17-Apr-06 6:42 
QuestionASP.NET not working Pin
Petals16-Apr-06 19:59
Petals16-Apr-06 19:59 
AnswerRe: ASP.NET not working Pin
Ravi Bhavnani16-Apr-06 20:12
professionalRavi Bhavnani16-Apr-06 20:12 
GeneralRe: ASP.NET not working Pin
Kevin McFarlane22-Apr-06 5:21
Kevin McFarlane22-Apr-06 5:21 
Questionvisual studio.net 2003 script engine error on parsing script file Pin
Shahid_78615-Apr-06 6:25
Shahid_78615-Apr-06 6:25 
AnswerRe: visual studio.net 2003 script engine error on parsing script file Pin
Dave Kreskowiak16-Apr-06 1:58
mveDave Kreskowiak16-Apr-06 1:58 
QuestionAbout MFC Compilation! Pin
fheinstein14-Apr-06 13:35
fheinstein14-Apr-06 13:35 
Smile | :) Hello,

I am a new gay on MFC
And follow a tutorial to create my first MFC program but when a compile i have to deal with the following problem:

Compiling...
HelloMFCDlg.cpp
c:\documents and settings\propriétaire\mes documents\visual studio 2005\projects\hellomfc\hellomfc\hellomfcdlg.cpp(158) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [42]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Build log was saved at "file://c:\Documents and Settings\Propriétaire\Mes documents\Visual Studio 2005\Projects\HelloMFC\HelloMFC\Debug\BuildLog.htm"
HelloMFC - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Please your help!

see the file content!


// HelloMFCDlg.cpp : implementation file
//

#include "stdafx.h"
#include "HelloMFC.h"
#include "HelloMFCDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
enum { IDD = IDD_ABOUTBOX };

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

// Implementation
protected:
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()


// CHelloMFCDlg dialog




CHelloMFCDlg::CHelloMFCDlg(CWnd* pParent /*=NULL*/)
: CDialog(CHelloMFCDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CHelloMFCDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_MESSAGE, m_MessageST);
}

BEGIN_MESSAGE_MAP(CHelloMFCDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDOK, &CHelloMFCDlg::OnBnClickedOk)
END_MESSAGE_MAP()


// CHelloMFCDlg message handlers

BOOL CHelloMFCDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

void CHelloMFCDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CHelloMFCDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, reinterpret_cast<wparam>(dc.GetSafeHdc()), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CHelloMFCDlg::OnQueryDragIcon()
{
return static_cast<hcursor>(m_hIcon);
}


void CHelloMFCDlg::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
//OnOK();
m_MessageST.SetWindowText("Hello from the world of MFC by Heinstein.");

}



Heinstein
AnswerRe: About MFC Compilation! Pin
Dave Kreskowiak14-Apr-06 14:22
mveDave Kreskowiak14-Apr-06 14:22 
Questionhotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 2:08
TAREQ F ABUZUHRI14-Apr-06 2:08 
GeneralRe: hotmail account Pin
Guffa14-Apr-06 2:50
Guffa14-Apr-06 2:50 
AnswerRe: hotmail account Pin
Colin Angus Mackay14-Apr-06 3:04
Colin Angus Mackay14-Apr-06 3:04 
GeneralRe: hotmail account Pin
TAREQ F ABUZUHRI14-Apr-06 3:06
TAREQ F ABUZUHRI14-Apr-06 3:06 
GeneralRe: hotmail account Pin
Paul Watson14-Apr-06 3:21
sitebuilderPaul Watson14-Apr-06 3:21 
AnswerRe: hotmail account Pin
Don Miguel14-Apr-06 3:24
Don Miguel14-Apr-06 3:24 
GeneralRe: hotmail account Pin
Judah Gabriel Himango14-Apr-06 4:45
sponsorJudah Gabriel Himango14-Apr-06 4:45 
GeneralRe: hotmail account Pin
super_ttd15-Apr-06 7:00
super_ttd15-Apr-06 7:00 
QuestionHow to get the language type of the OS? Pin
rushing14-Apr-06 0:47
rushing14-Apr-06 0:47 
AnswerRe: How to get the language type of the OS? Pin
alexey N14-Apr-06 1:14
alexey N14-Apr-06 1:14 
QuestionConfigure .NET Framework? Pin
hung_ngole13-Apr-06 17:07
hung_ngole13-Apr-06 17:07 
AnswerRe: Configure .NET Framework? Pin
Dave Kreskowiak14-Apr-06 4:41
mveDave Kreskowiak14-Apr-06 4:41 
QuestionSecurity: Registry write access through impersonation Pin
User 12301613-Apr-06 14:00
User 12301613-Apr-06 14:00 
AnswerRe: Security: Registry write access through impersonation Pin
User 12301614-Apr-06 2:15
User 12301614-Apr-06 2:15 
GeneralFramework dependence Pin
roachman13-Apr-06 13:15
roachman13-Apr-06 13:15 
GeneralRe: Framework dependence Pin
Luis Alonso Ramos13-Apr-06 13:25
Luis Alonso Ramos13-Apr-06 13:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.