Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Threads & Winsock

Posted on 1997-03-12
1
Medium Priority
?
424 Views
Last Modified: 2010-04-03
My application locks up when I use DeAllocateHwnd() in a
thread.  I have used AllocateHwnd() to start with, which seems to work fine.  But when I DeAllocate the window handle, it crashes the program and most times win95.
The thread is being used for winsock applications.
0
Comment
Question by:spookie031297
[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
1 Comment
 
LVL 1

Accepted Solution

by:
ozzy earned 100 total points
ID: 1334850
The correct use of AllocateHwnd() is
function AllocateHWnd(Method: TWndMethod): HWND;
I assume you are using it like...
handle := AllocateHwnd(method);
then DeAllocating it by doing...
DeallocateHWnd(Handle);
If this is correct (your using Handle is both), make sure you do not assign Handle to anything else before deallocating it, and make sure that the value of it does not change.
A good way to test this is to allocate it, then deallocate it on the next line as you step through your code in debug mode.  See if it crashes then, if not, wlak through your entire code watching to see if Handle changes.
Also make sure that any child windows of this window are destroyed prior to destroying the parent window.
If you are getting an Exception, include the name of the exception and any additional info in your responce.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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