MAKEINTRESOURCE and managed extensions

  • Thread starter Thread starter Stu Smith
  • Start date Start date
S

Stu Smith

In upsizing some old VC6 code, I've come across the following problem
regarding MAKEINTRESOURCE.

In the old version, there was code along the lines of:

m_pListBox.AddString(CString(MAKEINTRESOURCE(IDS_TESTSTRING)));

If you however turn on managed extensions, this code fails. (A workaround is
to use LoadString).

Is this behaviour deliberate, or is it a bug in CString?

(I have a VC7.1 MFC project which demonstrates this if anyone is interested,
but the easiest way is simply to make a dialog with a listbox on, and add
that line somewhere).

Stu
 
In upsizing some old VC6 code, I've come across the following problem
regarding MAKEINTRESOURCE.

In the old version, there was code along the lines of:

m_pListBox.AddString(CString(MAKEINTRESOURCE(IDS_TESTSTRING)));

If you however turn on managed extensions, this code fails. (A workaround is
to use LoadString).

Is this behaviour deliberate, or is it a bug in CString?

There's certainly a problem here, as to whether it's "by design" or a
bug, I don't know.

Let's see if anyone else knows.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top