Solved

How to get to protected member m_nIDHelp

Posted on 1997-05-06
7
1,030 Views
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.
0
Comment
Question by:solomon021499
[X]
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
7 Comments
 
LVL 1

Accepted Solution

by:
MarkusLoibl earned 70 total points
ID: 1301364
In afxwin.h you find the definition of CDialog, included the member:
protected:
        UINT m_nIDHelp;
There you also find:
public:
      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.

0
 

Author Comment

by:solomon021499
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.
0
 
LVL 1

Expert Comment

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

ON_MESSAGE(WM_HELPHITTEST, OnHelpHitTest)
LRESULT CDialog::OnHelpHitTest(WPARAM, LPARAM)
{
 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!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:solomon021499
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.
0
 

Author Comment

by:solomon021499
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?


0
 
LVL 1

Expert Comment

by:MarkusLoibl
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 )

0
 
LVL 1

Expert Comment

by:MarkusLoibl
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 )

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to match SAS datasets by multiple key variables and then rename and create new variables? 2 102
Doc'in system (example?) BA 7 120
sum13 challenge 24 134
scoreUp challenge 14 70
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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