How to get to protected member m_nIDHelp

Posted on 1997-05-06
Medium Priority
Last Modified: 2013-11-20
There is a protected member variable m_nIDHelp.  I am
not sure if it is a member of the CWnd class or the
CDialog class.  It shows up as a "protected" member
of my CDialog object in the debugger.

Anyway, the question is, is there an access function
available so that I can get to this from outside the
class?  Or am I going to have to subclass from CDialog
and provide my own access function?

By the way, what do I do when an expert answers a
question that is not sufficient?  My question is tagged
as answered and waiting for a grade so no one looks
at it.  The expert said to get back to him if it was
not sufficient, but the only way I have to do this is
by posting a comment and I have had no response for
quite a while.  The first response was virtually
immediate, but now it sits.
Question by:solomon021499
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

MarkusLoibl earned 140 total points
ID: 1301364
In afxwin.h you find the definition of CDialog, included the member:
        UINT m_nIDHelp;
There you also find:
      void SetHelpID(UINT nIDR);
You can call this member from outside the class.

By the way, if you do not agree with someone's answer, do the following: When you evaluate the proposed answer, use the radio button with the lowest agreement (I don't know the correct text, but when it says "excellent-good-ok-bad", use bad). The question then does not loose the status of a question; it will be put back to the unanswered questions.


Author Comment

ID: 1301365
Thank you for resonding.  I did see the definition of CDialog in afxwin.h and the void SetHelpID(UNIT nIDR) function.  However, I need to be able to retrieve the value, not set it.

I assume this means that I will have to provide this myself.

Also, thank you for your advice about question status.

Expert Comment

ID: 1301366
you also find in the MFC-sources:

 if (m_nIDHelp != 0)
  return HID_BASE_RESOURCE + m_nIDHelp;
 return 0;

I think you can use this member to retrieve your actual m_nIDHelp with:
  UINT helpId = myDialog->SendMessage(WM_HELPHITTEST);
  if( helpId ) helpId -= HID_BASE_RESOURCE;
This should work!
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!


Author Comment

ID: 1301367
I tried it and have not yet been able to get it to work.
It is necessary to include afxpriv.h, but I get many compilation errors in it when I do so.  I assume that it requires yet another header, but I have not yet found it.  Thank you.  I will let you know when I get it.

Author Comment

ID: 1301368
As I indicated in my last comment, I have not been able to get
UINT helpId = myDialog->SendMessage(WM_HELPHITTEST);
if( helpId ) helpId -= HID_BASE_RESOURCE;
to work when including afxpriv.h.  I do not know how to elimination the multitude of compilation errors that occur when including that file.  I tried defining WM_HELPHITTEST and HID_BASE_RESOURCE myself to the value in afxpriv.h
#define WM_HELPHITTEST      0x0366
#define HID_BASE_RESOURCE   0x00020000UL  
which did work.  However, this is a embarassing work around.  Do you have any ideas, what the problem is.  Do I need to include yet another file?


Expert Comment

ID: 1301369
I use VC++ 5.0 and do not have any problems with it.
I just built up a little example, and I can send you the files with e-mail, if you tell me your email-adress
(send it to:  MarkusLoibl@ThinkTools.com )


Expert Comment

ID: 1301370
I use VC++ 5.0 and do not have any problems with it.
I just built up a little example, and I can send you the files with e-mail, if you tell me your email-adress
(send it to:  MarkusLoibl@ThinkTools.com )


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question