Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to get to protected member m_nIDHelp

Posted on 1997-05-06
7
Medium Priority
?
1,061 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 140 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

604 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