?
Solved

api

Posted on 1998-11-10
6
Medium Priority
?
264 Views
Last Modified: 2010-04-02
how i am going to use api function in a mfc based application.Eg: SHGetSpecialFolderLocation function
0
Comment
Question by:poonamvis
[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
6 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 400 total points
ID: 1177438
There is no reason that you can't use the windows API from an MFC application.  MFC provides a wrapper to most (but not all) of the API, where it doesn't just use API calls.  (You can use API calls even where it does provide a wraper, but that defeats the purpose of using MFC).

0
 
LVL 22

Expert Comment

by:nietod
ID: 1177439
If you have a CWnd object that you and you wish to pass its window handle to the function, I believe you cna just specify the CWnd instead of the handle (not a pointer to the CWnd), as I think there is a HWND conversion operator.  If not, then you can just specify the m_hWnd data member.

Let me know if you have questions.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1177440
It is customary to explicitly use the global scope.  E.g., ::SHGetSpecialFolderLocation(...)
It lets the programmer use the API even if there's a similarly named member function in scope (as is the case with lots of MFC functions).
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 22

Expert Comment

by:nietod
ID: 1177441
Good point.  That insures there is no problem in the future if an interface function with the same name, but different parameters, is added to MFC.  
0
 

Author Comment

by:poonamvis
ID: 1177442
Thanks Nietods,I'll keep on taking your help when ever necessary
be free to write to me if any way I can help you reqarding communication programming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1177443
Unfortuantely, communication is not my specialty.  (even with humans--my wife would say.)
0

Featured Post

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!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

764 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