Solved

Troubleshooting with converting code from WIN NT to WIN 2000

Posted on 2002-07-02
4
160 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
4 Comments
 
LVL 32

Expert Comment

by:jhance
Comment Utility
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
Comment Utility
PAQed - no points refunded (of 50)

modulo
Community Support Moderator
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now