Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From Delphi to Visual Studio

Status
Not open for further replies.

552525

Programmer
Aug 9, 2003
2
YU
This might come very easy for experienced programmers but i've recently switched from Delphi to Visual Studio and it really bugs me (or i'm not trying too hard).
Whenever I use an API function that returns a window handle it returns a type CWnd but every function that receives a handle as an argument asks for HWND. How should I transform CWnd to HWND and the other way around. I didn't have these kind of problems in Delphi.

Please dignify this with an answer.
 
CWnd is a MFC class. MFC is a library that encapsulates Windows APIs to use in Object Oriented C++ development. You should ask future questions regarding the use of these technologies in the Microsoft: Visual C++ forum: forum116

To obtain the HWND value encapsulated by a CWnd object use the CWnd::GetSafeHwnd() member function. To attach an existing HWND to a CWnd class use the CWnd::Attach() member function.

To learn C++ Windows development using Visual C++ and MFC you should get a book targeted to beginners. Most of them will cover basic concepts like this for the MFC library.

I also suggest not using statements like [blue] Please dignify this with an answer.[/blue] as some people are easily offended.

There are several FAQs in different forums here at Tek-Tips that discuss techniques for posting question in a fashion that results in receiving good responses. Here is one of them: faq333-3811



-pete
 
Thanks for the tip but I'm a bit confused with the remark on not to use a certain kind of statements becuse I haven't been around forums too much. What was offensive in my closing remark?
 
[lol] That's the whole point. You won't know most of the time. Sticking to the facts is safest.

It was just a suggestion so feel free to ignore it and do things your own way. That's also part of forums of course. [wink]

-pete
 
From Delphi to VC? Why dont you use Borland C++ Builder? This is the best RAD/C++ tool ever and it uses the same Visual Class Library. You shouldn't need to start learning everything from the begining.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top