equating handles

I have a problem in equating two HANDLE's.
the code is
if( (m_SocketManager1[i].m_hThread != cl.GetAt(p).h))
here "m_SocketManager1[i].m_hThread" is a HANDLE,
"cl.GetAt(p).h" is a HANDLE

now even though both the HANDLE's are same it goes in to the condition. I
can see in the debugger that they both are equal.

Any help on this is appreciated.
Thank you

Prince1 (2)
11/11/2003 1:23:23 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 26

if( (m_SocketManager1[i].m_hThread) != (cl.GetAt(p).h))

>-----Original Message-----
>I have a problem in equating two HANDLE's.
>the code is
>if( (m_SocketManager1[i].m_hThread != cl.GetAt(p).h))
>here "m_SocketManager1[i].m_hThread" is a HANDLE,
>"cl.GetAt(p).h" is a HANDLE
>now even though both the HANDLE's are same it goes in to 
the condition. I
>can see in the debugger that they both are equal.
>Any help on this is appreciated.
>Thank you
anonymous (74722)
11/11/2003 1:34:49 PM
that didn't help :(
anymore sugessitions ?

<anonymous@discussions.microsoft.com> wrote in message
> try
> if( (m_SocketManager1[i].m_hThread) != (cl.GetAt(p).h))
> >-----Original Message-----
> >hi,
> >I have a problem in equating two HANDLE's.
> >the code is
> >if( (m_SocketManager1[i].m_hThread != cl.GetAt(p).h))
> >here "m_SocketManager1[i].m_hThread" is a HANDLE,
> >"cl.GetAt(p).h" is a HANDLE
> >
> >now even though both the HANDLE's are same it goes in to
> the condition. I
> >can see in the debugger that they both are equal.
> >
> >Any help on this is appreciated.
> >Thank you
> >
> >
> >.
> >

Prince1 (2)
11/11/2003 5:35:12 PM
windows ce wrote:

>I have a problem in equating two HANDLE's.
>the code is
>if( (m_SocketManager1[i].m_hThread != cl.GetAt(p).h))
>here "m_SocketManager1[i].m_hThread" is a HANDLE,
>"cl.GetAt(p).h" is a HANDLE
>now even though both the HANDLE's are same it goes in to the condition. I
>can see in the debugger that they both are equal.

It could be a compiler codegen bug, but they're pretty rare. The debugger
could itself be fooling you. To help verify the problem, try simplifying the

HANDLE h1 = m_SocketManager1[i].m_hThread;
HANDLE h2 = cl.GetAt(p).h;
if (h1 != h2)

Then look at the debugger disassembly and register windows to see what the
compiler is doing for the comparison.

(Note: Just in case you've obtained one of the handles from DuplicateHandle,
be aware that although the two handles refer to the same kernel object, they
have different HANDLE values.)

Doug Harrison
Microsoft MVP - Visual C++
dsh (2498)
11/11/2003 5:50:28 PM

Similar Artilces:

equation editor
I just installed Office mac 2004 student teacher edition on my brand new MacBook. I can't seem to use equation editor. Since I am a math teacher, that sucks - to say the least! Error message says somethng like - make sure it has been installed, or maybe it has been renamed etc. All I did was install. Short of using my 2nd product key to fix the problem what can I check. Find brings up no info on equation editor. I don't think Eq Ed is automatically installed with a standard installation of Office 2004 - it needs to be included in a custom install or added later. You can install it no...

2 variables in 2 quadratic equations in excel
Dear ms excel user/programmers: I hope this question is not repeated before. But anyway highly appreciate anyone can tell me how (or hint) to use ms excell and/or visual c/c++, basic, or octave(emulate matlab) to solve: (12-x)^2 + y^2 =15^2, (16+y)^2+x^2=25^2 (by programming or using its built in function)? that ^2 mean square. looking to any excel user, mathmatician, and/or programmer's help, eric, fsshl@yahoo.com Hi Eric The brute force way (requiring the least mathematical analysis) is to calculate the left hand side as functions of two reasonable first guess x and y inputs...

Handle incoming mail for non existing users.
Is it possible to collect mail for non existing users? I would like to forward all mail with *@company.com to a specific mailbox except for valid users that have their own mailboxes. Regards \Peter Kulinski Datafant AB Sweden Are you sure that you want to go down this path? The expected behavior is to NDR mail for invalid recipients (once it is processed by Exchange). Who is going to monitor this mailbox? If it is you, then just be aware that it may take more time than you think to monitor that mailbox/forward to correct recipients, etc. That being said, there are some ways to do ...

Linear trendline:wrong equation
Hi, I created a bar chart in Excel from the following data: X Y 73 6.6 78 5.7 86 4.8 The SLOPE and the INTERCEPT functions returned -0.136 and 16.4448 respectively. The resulting equation is Y = -0.136X + 16.448 which seems good enough to me. Then I added a linear trendline to the chart. Excel displayed the following equation: Y = -0.9X + 7.5, R ^2 =1 which is way off (and it's not a rounding problem)!!! The data seemed farly linear to me, how come Excel can't come up with the right equation??? Thanks Jan M. Use an "XY (Scatter)" chart. When you...

MS Word equation editor won't open when double-clicking on an equation
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I created a document (.docx) using the Office 2008 version of MS Word some time ago (2 months or so). Recently I wanted to correct an equation in that document and re-opened the document (on the same system and with the &quot;same&quot; copy of Word) and attempted to double-click the equation to edit it. Instead of the equation editor I get the &quot;Format Picture&quot; dialog box. In the interim I did install an update (I tend to try to stay up to date) and am at 12.2.4 (100205). <br><...

Trendline equation not giving correct results
I was trying to form a trendline with following data : Y X 1.128 -20 1.128 -15 1.128 -10 1.128 -6 1.111 -5 1.084 0 1.056 5 1.0276 10 1 15 0.971 20 0.944 25 0.9144 30 0.884 35 0.8524 40 0.82 45 0.788 50 After plotting the chart, I added trendline (Polynominal with order 6) alongwith its equation which read as below : y = 6E-07x6 - 3E-05x5 + 0.0006x4 - 0.0057x3 + 0.0215x2 - 0.0318x + 1.1429 and R2 = 0.9998 The trendline in the chart neatly fitted over the curve. However, when I used above equation and fed in same values of X as shown above the computed results are entirley different fro...

Excel equations
I posted this before, but for some reason, it never showed up. I want to be able to take a list of months in a spreadsheet and add these months to an equation without having to type it out every time. Let me explain: I have a column of text ranging from January to Dec. I also have worksheets titled from Jan to Dec. I need to reference various cells in each of the spreadsheets in a summary spreadsheet, but each reference cell is the same for each month, i.e. always January!$A$1, February!$A$!, etc. Is there a way I can write an equation that will allow be to copy the months in the summar...

Set minimum values for equation results
Hi all, I've been searching the queries here and can't find an answer to what I'm hoping is a simple query . . . I want my equation to ensure that any minus values are returned as 0 but positive values should remain true. THis needs to be within the original equation as opposed to a separate equation doing a find and replace. Appreciate any answers (preferably by e-mail!). Jim. Try using IF(), for example: Put in C1: =IF((A1-B1)<0,0,A1-B1) which will return 0 if (A1-B1) results in a minus value with zero & positive values remaining true Hope the above helps. M...

How do you obtain a Window Handle?
I am a beginner and having a very difficult time with some tasks. Does anyone have a COMPLETE example of how to obtain the handle of a Child window in VC++ 6? All the examples I have found contain incomplete information. It is as-if one needed to know the handle to the window to obtain the handlt to the window. I've tried ever process I can find in my MSDN Library and they all seen to compare with a cat chasing it's own tail. Take a look at the CWnd::GetWindow() member function. You should be able to pass GW_CHILD and then GW_NEXT in a loop to get all the child windows of a given...

I am wondering if someone could help me solve this equation
A car wash makes $4000 profit on sunny days and loses $4000 on non-sunny days. Assuming independence, if it is sunny 75% of the days, (and, therefore NOT sunny 25% of the days) what is the expected (daily) profit (or loss) for the car wash? (MEAN = EXPECTED VALUE) Let me know via email or can you please forward me to someone who can help me with this formula? Thank you. "Miles" wrote: > A car wash makes $4000 profit on sunny days and loses $4000 on > non-sunny days. Assuming independence, if it is sunny 75% of the > days, (and, therefore NOT sunny 25% of the days) what...

Memory Allocation and Message Handling
I have an app consisting of several CWinThread objects. The worker threads post messages back to the main application thread which updates the UI to reflect various status information. This requires passing complex structures back to the main thread that contain status information. Currently I dynamically allocate and populate the structure and pass a pointer to the structure as the LPARAM in the message posted to the main thread. The main thread then updates the UI and deallocates the structure. I'm not sure why, but this practice feels somewhat dirty as the message handler on the...

Dialog: who handles Enter and Escape
Hello, I create a dialog based application and remove both Enter and Escape buttons but the dialog is closed automatically after pressing Enter or Escape. How I can prevent him doing this? Thanks and regards Mark You need to override the "OnCommand" event handler for the dialog. Here's an example" BOOL CYourDlg::OnCommand(WPARAM wParam, LPARAM lParam) { // intercept ESC & ENTER so they don't terminate aplication if(wParam==IDCANCEL || wParam==IDOK) return FALSE; return CDialog::OnCommand(wParam, lParam); } >-----Original Message----- >Hel...

Handling events from a class in an asp.net page
I have a class called Headline. It is a data object that represents a Headline (news article) for use on a website. It (the headline object) will have events linked to it. Some of the events will be something like: 1. Saving - just before the Headline gets sent to the database. 2. Saved - just after the Headline got sent to the database 3. Deleting - just before the Headline gets deleted. 4. Deleted - just after the Headline is deleted. Just for a few examples. There could be quite a few more, but I am still in the planning stage right now and haven't come up with all of them ...

Equation Editor- problem when editing an equation
I use Equation Editor a great deal, and I constantly have the same problem. If I create an equation, and later go back to edit it, the font and spacing of the equation change. I try to resize the equation by enlarging or decreasing the size of the window, but all that I accomplish is either "bunching up" or "stretching" my equation. How do I get it back to what it looked like originally? ...

Install Equation Editor on Toolbar
Hello, I am having difficulty installing equation editor on my toolbar in Word. I can see it if I click on Insert and then Object and then go to equation editor, but how do I get it as an icon on my toolbar? Thank you. Not really a 64 bit OS related question, I would suggest reposting to one of the Word groups. -- -- "Laura C" <LauraC@discussions.microsoft.com> wrote in message news:61D34976-78A0-40A7-84C2-D0529432D107@microsoft.com... > Hello, > > I am having difficulty installing equation editor on my toolbar in Word. > I > can...

Editing equation in rtf doc: "Word equation too large to convert"
I have an academic paper that I have written and need to share with my co-authors who use MS Word. I converted it from latex to rtf format. I can open the document in word 2007 and edit it, however, whenever I try to edit an equation I get a dialogue box with the error message “Word equation too large to convert". The contents of the equation get erased and I have close the equation editor and press Crtl-z to get the contents of the equation back. The problem occurs even with very simple equations, such as the fraction 1/2. I have searched the web and others seem to ha...

Handling Small Inventory Parts
We have many small parts in our inventory. Take our fasteners. Can I treat ALL nuts and one item, and all bolts as another regardless of size or type? Should I? What are the general guidelines for how I make these divisions? I assume it has to deal with the need to capture infomation. the trouble is, that although some items are essentially the same for purposes of sales data, they have different reorder numbers with suppliers. Thanks in advance. -- ______________________________________________________ Larry Leveen OlyBikes Bikes, Parts, Repairs & GREAT Customer Service! 124 Sta...

Pls help out with passing handles from one control to another
Ali , I passed the handle from on e list conrol to anthor list control.I think the wiondow exists and breaks at insert item I get the assertion with insert item.The window is exsting at the constructor till I get NMClick. { ASSERT(::IsWindow(m_hWnd)); return InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0); } The code ***********************Passing the handle in FormView.cpp************************* m_ResultsCtrl.SetIconToFill(&tab1->m_IconsListCtrl); -------------------------------------------end **********************MyListCtrSeriesCtrl.cpp********************************* C...

notification handle
Hello Is it possible to increase the notification handles on a windows 2003 server? Thank you, -------------------------------------------------------------------------------------- (MATLAB makes use of a feature of the Windows operating system called a Change Notification Handle that enables MATLAB to be notified any time a file in an associated directory is modified. Under certain circumstances, Windows may fail to provide MATLAB with a valid and responsive handle. The three most common causes for this are: * Windows has exhausted its su...

how to use today's date in a equation to caculate somebody's birth
If DOB is in A1, then =Today()-A1 should return the number of days. ******************* ~Anne Troy www.OfficeArticles.com "Guyster" <Guyster@discussions.microsoft.com> wrote in message news:6C36C64E-5777-4802-BB79-CEE3265DF320@microsoft.com... > ...

Letters in Equations
I'm trying to use Word 2007's built-in equation functionality, but often times when I try to type a letter in an equation (e.g. y=2x), the letters (so the y and the x) just show up as boxes. The only way it seems I can get it working is to copy and paste from a previous equation that worked with letters, clear out the irrelevant equation and type in the new one. However, I feel there MUST be a better way of doing this. Any help would be appreciated. The 'old' equation editor is included with Office 2007 and works just as before. It is not installed by default so...

can VLOOKUP handle this? Should be simple but not for me
I have 2 works sheets (PRNCATG and NASD 05) PRNCATG contains Col A (cat numbers) along with other info in other cols NASD 05 contains Col A (mainly the same set of catalog numbers as in PRNCATG Col A with multiple new items) and Col B (05 prices) I copied and pasted the formula below to bring in the 05 prices =VLOOKUP('NASD 05'!A5,'NASD 05'!A5:B5,2,FALSE) This works fine until there is a row containing a new catalog number in NASD05, thus causing all the other info below to be off. Example: on row 29 of PRNCATG the price being calculated/brought in is not the correct one ...

handle activeX dll Generated event in my WPF/.NET application
Hi, I have to handle a VB 6.0 ActiveX Dll Generated event in my WPF application. I tried this following things but it does n't work. Could anyone of help to resolve this problem. May be pointing out good example of this scenario will also more helpful. Created a ActiveX Dll Project in VB 6.0 with a class Public Event OnConnectedEvent(FromPhoneURI As String) Public Event OnTerminatedEvent(FromPhoneURI As String) Public Sub Connect(ByVal FromPhoneURI As String) RaiseEvent OnConnectedEvent(FromPhoneURI) End Sub Public Sub Terminate(ByVal FromPhon...

How do I use the handle returned by pIProvTaskPage->GetPage()?
I'm really up against the wall here, any help at all would be wonderful. I'm adding the Schedule and Settings pages to a wizard that is creating Scheduled Task Items. The OnNext() handler on the first page of the wizard calls NewWorkItem() to create the task and then pIProvTaskPage->GetPage() to retrieve handles to the Schedule and Settings pages and finally adds those pages to the wizard. The added pages are displayed as expected but when I get to the final page in the wizard, there are no triggers in the task object, even though I have added some on the Schedule page. Having cr...

Handling large excel files
Hi All, I handle large excel files on a daily basis ( 20 - 40 megs) and opening them takes a painful lot of time in my Thinkpad. Most of the time I just need to work with only 1 or 2 work sheet in a file. Is there a way I can make the Excel application load worksheets in an on- demand basis? Thanks, Sundar Sundar There is no build in facility to do this and I suspect any code solution will take just as long. What you could do if there are a regular two or three sheets is have some workbook_close() event code to move those sheets off each time so you have a fresh separate workbook to vie...