Solved

Troubleshooting with converting code from WIN NT to WIN 2000

Posted on 2002-07-02
4
164 Views
Last Modified: 2013-12-03
Hi
My name is Avishay abahel, and I m software engineer from Israel.

My question:
I m trying to run a software (contains com objects and multithreaded) which were written in WIN NT, on Windows 2000.
When I m run it with within the msdev(by pressing the F5 key), it’s running.
But, if I m trying to run the executable file, it fails in mode debug and release as follow:
1.     Mode debug: I m using the “MsgWaitForMultipleObjects” API function which I pass it an array of handles I have created. The ret code from this function is ok when it receives messages from the queue. But for the handles array the ret code is –1. I used the “GetLastError” function to figure out what is the problem and the message was: “Handle is invalid”. My question is: why the handle is valid when I m run the software through the msdev environment and invalid if I run the executable file from the explorer.
2.     Release mode: I have exception immediately after I m using the “PostThreadMessage” function.

Thanks for your help!
0
Comment
Question by:Avishaya
[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 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7124419
One (or more) of your handles being passed to WaitForMultipleObjects() is probably NOT getting initialized.  You realize, I hope, that in DEBUG mode, there is really no such thing as an unititialized variable since the DEBUG library initializes everything for its own purposes.

So when you run DEBUG code OUTSIDE the debugger, you never get a truly uninitialized pointer or handle.  In RELEASE mode, you do and you get a crash.

Check the SOURCE of ALL of your HANDLES passed to WaitFor... and find out which one or ones you are neglecting to init.  That should do it...
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10786971
PAQed - no points refunded (of 50)

modulo
Community Support Moderator
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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