Solved

Troubleshooting with converting code from WIN NT to WIN 2000

Posted on 2002-07-02
4
163 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
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Standards for file storage. 3 25
Windows 10 Scheduled Tasks 11 88
Windows Installer 4 72
Access 2013: API code to put hidden database icon in taskbar? 8 74
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 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