Advertisement

11.26.2008 at 09:29AM PST, ID: 23938040
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

FreeLibrary hangs

Asked by Rongas in C / C++ / C# Editors and IDEs, C++ Programming Language, Microsoft Visual C++.Net, Microsoft Visual C++

Tags:

I am creating a dll that gets frames from an ip camera.  When i try to release the dll, the dll hangs.
What i have seen, is that the problem does not occur when CHttpFile connection does not occur (everything else are the same) by commenting the lines:

m_pFile = m_pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, m_getImageURL+(CString)m_numberofframes+"&"+(CString)temp+"&"+"compression=50",0,1,0,0,INTERNET_FLAG_NO_CACHE_WRITE);
if (m_pFile!=0)
{
   m_pFile->AddRequestHeaders(strPreFileData);
   BOOL response=m_pFile->SendRequest();
   m_pFile->QueryInfoStatusCode(m_dwRet);
   if ((int)m_dwRet==200 && response==1)
   {
      return 1;  
   }


When i delete the instance before freeing the resources, i close the CHttpFile as seen in the code attached. The request is for MJPeg (so the CHTTPFile does not finish by it self until i close it).
Can someone help me to make FreeLibrary((HMODULE)hinstLib); not to hang??  

I only have one instance of the dll class and no sharedmemory between exe and dll.
Any questions for clarification are more than welcomed.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
// Requesting mjpeg, m_pFile is the CHttpFile
....
m_pFile = m_pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, m_getImageURL+(CString)m_numberofframes+"&"+(CString)temp+"&"+"compression=50",0,1,0,0,INTERNET_FLAG_NO_CACHE_WRITE);
if (m_pFile!=0)
{
   m_pFile->AddRequestHeaders(strPreFileData);
   BOOL response=m_pFile->SendRequest();
   m_pFile->QueryInfoStatusCode(m_dwRet);
   if ((int)m_dwRet==200 && response==1)
   {
	return 1;   
   }
....
 
 
//Deleting Instance
...
	if(m_pFile!=NULL) 
	{
		//m_pFile->Abort();
		m_pFile->Remove(
		m_pFile->Close();
		delete m_pFile;
		m_pFile=0;
	}
...
 
// Releasing the dll
...
        DELETEPLUGIN DeletePlugin = (DELETEPLUGIN) GetProcAddress(hinstLib, TEXT("DeletePlugin"));
	DeletePlugin(testobj);
	if(hinstLib != NULL)
	FreeLibrary((HMODULE)hinstLib);
...
[+][-]11.29.2008 at 07:33PM PST, ID: 23061882

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11.29.2008 at 09:20PM PST, ID: 23062048

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C / C++ / C# Editors and IDEs, C++ Programming Language, Microsoft Visual C++.Net, Microsoft Visual C++
Tags: c++
Sign Up Now!
Solution Provided By: DanRollins
Participating Experts: 1
Solution Grade: A
 
 
[+][-]12.01.2008 at 12:55AM PST, ID: 23066957

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.01.2008 at 02:33AM PST, ID: 23067329

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.01.2008 at 02:36AM PST, ID: 23067342

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.02.2008 at 08:44AM PST, ID: 23078521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081119-EE-VQP-49 - Hierarchy / EE_QW_2_20070628