473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What does "::DestroyWindow(hWnd)" mean?

I read a piece of code, and the code looks like the following part.

CWnd is a MFC class

class CFrameGrabber : public CWnd {
....
};

BOOL CFrameGrabber::Create(int x, int y, CWnd *pParentWnd) {
.......
if( !capDriverConnect(hWnd, DEFAULT_CAPTURE_DRIVER)) {
::DestroyWindow(hWnd);
return FALSE;
}
.......
}

My question is: This is a correct code, and what does the preceding
"::" of the DestroyWindow(hWnd) really mean here? If I remove the
preceding "::" from the DestroyWindow(hWnd), the compiler will call the
inherited DestroyWindow() from CWnd class and generate an error.

I can not find any reference about the usage of "::" like this.
Previously, I've only seen something like A::test()....

Thanks

Jul 23 '05 #1
3 4304
* Joseph:
::DestroyWindow(hWnd);

My question is: This is a correct code, and what does the preceding
"::" of the DestroyWindow(hWnd) really mean here? If I remove the
preceding "::" from the DestroyWindow(hWnd), the compiler will call the
inherited DestroyWindow() from CWnd class and generate an error.
'::' refers to the global namespace. It ensures you're referring to a
freestanding function (or something) outside any namespace.

I can not find any reference about the usage of "::" like this.
Previously, I've only seen something like A::test()....


That's exactly the same, provided 'A' is a namespace name -- the name of
the global namespace is just nothing.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #2
no, the *most* annoying thing is someone that thinks they have the right
to tell others what to do when they're not asked to do so.
Alf P. Steinbach wrote:

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Jul 23 '05 #3
[re-arranged to be more readable :-)]

"jeremiah johnson" <jj******@psg.com> wrote in message
news:ARtDe.189819$xm3.69621@attbi_s21...
Alf P. Steinbach wrote:

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


no, the *most* annoying thing is someone that thinks they have the right
to tell others what to do when they're not asked to do so.


Oh, c'mon...lighten up. It's just Alf's usual signature. It conveys a
useful message, and in a humorous way at that.

-Howard
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrey Mishenin | last post by:
While accessing MySQl data base by means of perl the value of variable $! sometimes equals " Resource temporarily unavailable". At the mean time everything works correct. What does that mean?...
2
by: pembed2003 | last post by:
Hi all, I recently saw a piece of code that looks like: class one{public: one(){} }; class two : public virtual one{public: two(){} }; class three : virtual public one{public: three(){} }; ...
4
by: pete | last post by:
I found it in the view source of a corporate website. <script Language="Javascript"> <!-- var keyMacro= ]; //--> </script>
6
by: **Developer** | last post by:
What does this mean: External component has thrown an exception. My program crashes after it leaves a subroutine. What I see during debugging is when I press F11 at the End Sub statement
2
by: tony | last post by:
Hello!! I know what an abstract class is which mean that the one of the derived class must define the abstract methods in the abstract class. So all the abstract methods in the abstarct class...
10
by: tony | last post by:
Hello!! I have some demo programs written in C# and they have this construction "" see below. I haven't seen this before so what does it mean ? public bool ShowDropDownButtons { get {...
9
by: JoeC | last post by:
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth; m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight; What does this mean? I have seen v=&var->member.thing; but what does it mean when you...
0
by: steve | last post by:
What does it mean to set a value or April fools all year long :) http://beyondsql.blogspot.com/2008/03/sql-what-does-it-mean-to-set-value.html
14
by: Tony | last post by:
Hello! It says "Another limitation that you need to be aware of is that using the operator == and != are only permitted when comparing a value of a type supplied to a generic type to null....
1
by: rasmidas | last post by:
Hi, Could anyone please let me know what does it mean by the following statement in solaris shell scripting. $PROMPT " Select an option: " read ans db_option=${ans:=0} I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.