AfxHookWindowCreate fails and createEx returns getlasterror value as Zero and does not give a meaningful return error value

Hi,

My application crashes after running for a long time, when analyze the
cause, i found that CreateEx is causing the problem. In this
AfxHookWindowCreate is failing. when i tried to get the error code for
the createEx, it returns getlasterror value as Zero and does not give a
meaningful return error value.

Can any one please tell why AfxHookWindowCreate can fail..The window
iam creating is a child window and having attributes as
WS_EX_TRANSPARENT.

Note: It fails after running for a long time. Not in the first atempt
itself.

0
12/26/2006 4:32:14 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
777 Views

Similar Articles

[PageSpeed] 42

>My application crashes after running for a long time, when analyze the
>cause, i found that CreateEx is causing the problem. In this
>AfxHookWindowCreate is failing. when i tried to get the error code for
>the createEx, it returns getlasterror value as Zero and does not give a
>meaningful return error value.
>
>Can any one please tell why AfxHookWindowCreate can fail..The window
>iam creating is a child window and having attributes as
>WS_EX_TRANSPARENT.
>
>Note: It fails after running for a long time. Not in the first atempt
>itself.

If it's only ever failing after running for a long time, I'd suspect
either a memory leak or some handle leak - have you tried monitoring
them to see if they're increasing?

Dave
0
davidl7375 (2060)
12/26/2006 11:12:43 AM
I'm confused.  In one case you say AfxHookWindowCreate fails, and in another place you say
CreateEx is failing.  Which is it?  

It sounds to me like you are either creating too many windows or you are leaking window
handles.  

How long is "a long time"?  Ten minutes?  Two weeks?  A year?
					joe

On 25 Dec 2006 20:32:14 -0800, frozenforu@gmail.com wrote:

>Hi,
>
>My application crashes after running for a long time, when analyze the
>cause, i found that CreateEx is causing the problem. In this
>AfxHookWindowCreate is failing. when i tried to get the error code for
>the createEx, it returns getlasterror value as Zero and does not give a
>meaningful return error value.
>
>Can any one please tell why AfxHookWindowCreate can fail..The window
>iam creating is a child window and having attributes as
>WS_EX_TRANSPARENT.
>
>Note: It fails after running for a long time. Not in the first atempt
>itself.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
12/26/2006 10:39:10 PM
On Dec 27 2006, 3:39 am, Joseph M. Newcomer <newco...@flounder.com>
wrote:
> I'm confused.  In one case you sayAfxHookWindowCreatefails, and in another place you sayCreateExis failing.  Which is it?
>
> It sounds to me like you are either creating too many windows or you are leaking window
> handles.
>
> How long is "a long time"?  Ten minutes?  Two weeks?  A year?
>                                         joe
>
> On 25 Dec 2006 20:32:14 -0800, frozenf...@gmail.com wrote:
>
> >Hi,
>
> >My application crashes after running for a long time, when analyze the
> >cause, i found thatCreateExis causing the problem. In this
> >AfxHookWindowCreateis failing. when i tried to get the error code for
> >thecreateEx, itreturnsgetlasterror value as Zero and does not give a
> >meaningful return error value.
>
> >Can any one please tell whyAfxHookWindowCreatecan fail..The window
> >iam creating is a child window and having attributes as
> >WS_EX_TRANSPARENT.
>
> >Note: Itfailsafter running for a long time. Not in the first atempt
> >itself.
>
> Joseph M. Newcomer [MVP]
> email: newco...@flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm


Hi all,

Thanks for your replies, it was failing because of no more handles
present with the windows, ie some where in the code there is leakage
of handles. This thing i found by observing in the task manager. But
in this case windows was not giving proper error code...

0
2/4/2007 5:54:26 AM
Reply:

Similar Artilces:

Why is collection failing?
I'm creating a wrapper class for a collection object, mainly so I can test whether a given records exists. I'm baffled as to why I'm getting "Invalid procedure or argument" in the exists function when I try to extract the value, whether it actually exists or not. I've tried collection.item and collection(item), same result. BTW, the values are numbers that I convert to strings. Option Compare Database Option Explicit 'this class object extends the collection object to include an 'exists' boolean function Private colStatus As VBA.Collection Private S...

Matching the Searched Value to the Adjacent Column
Hi, I'm trying to search for the maximum numeric value in one column but I want the data in the adjacent left column which is a Time variable to be displayed as the result. How do I achieve this? I can only think of MATCH, VLOOKUP. The data is quite large. Thank you very much for your help in advance. Richard try this idea =INDEX(C:C,MATCH(MAX(D:D),D:D)) -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com <vamber001@gmail.com> wrote in message news:babc6c6f-ae70-447c-8057-2cfa2cf1a4b6@w24g2000prd.googlegroups.com... > Hi, > > I'm trying ...

Number zero in a cell
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3283152995_4495907 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit Hopefully this will make sense. I am adding information to a spreadsheet and when I try to input, let�s say a zip code starting with the number zero, it does not appear on the sheet. How do I make the number stay visible? I am a little rusty on my excel skills so if anyone can help me with this it would be greatly appreciated. Thank you!...

drop-box and numeric values
hi there: i have created a drop-box with the items A, B, and C as the options. Now I would like to assign a numeric value to each option as well as a shaded background. Can anyone guide me on how to do this? thx, tg what kind of dropdown box. From the forms toolbar, from the control toolbox toolbar, using data validation. What do you mean by assign a numeric value. How did you get the options A, B, C into your drop-box. Where do you want shading to occur - certainly not in the dropdown - that isn't supported in any of them. -- Regards, Tom Ogilvy tg <hlwatts@hotmail.com> w...

Margins do not fit page size! ERROR
Hi My print/ print preview setings seem to have gone for a loop. I'm trying to change the page setup to print to 1 page wide & tall. The actual page is approx 100 rows and columns A-M in width (should not normally pose a problem). The rows & columns are std. sizes. When I hit fit to 1 page the following happens: the scaling changes to 10% and Excel fits my document into 1530 pages. On viewing or trying to drag the page margins to fit to 1 page the error message "Margins do not fit page size!" appears and man it pops up often!!!! I noticed that once I've clicked th...

Automatic Return
Hi Need your help, If I'm entering data in several columns, let say from a to f, what I want is, when I hit enter on column 'F' I want to go back automatically to cell 'A' Thanks Hi one way: prior to entering your values select the data entry range (e.g. A1:F20) or have a look at http://j-walk.com/ss/dataform/index.htm -- Regards Frank Kabel Frankfurt, Germany "Fluffy" <angar711@hotmail.com> schrieb im Newsbeitrag news:1078dutpotnmn0e@corp.supernews.com... > Hi > > Need your help, If I'm entering data in several columns, let say from a t...

Stocks Return Calulations
I sold a stock and later brought it back. The stock is now up since I brought it back. However, the return valuations in Money show that the stock is down. When I sold the stock the first it was at a loss. How do I correct this problem to reflex what is going on now? Was the transaction considered a ""Wash Sale" by IRS regulations? In microsoft.public.money, marc wrote: >I sold a stock and later brought it back. The stock is >now up since I brought it back. However, the return >valuations in Money show that the stock is down. When I >sold the stock the fir...

CreateDirectoryW fails
Hi I want to create a directory with more then 300 characters. I am using the CreateDirectoryW function and prepending \\?\ to the path for eg.. CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name but the function fails with error 123. What could be the problem. I am working on Windows 2000. Regards Jakir Would it hurt to tell us what error 123 means? (I looked it up and it says the fllename syntax is illegal). Give your code snippet below, I'm not surprised. Take a look at CreateDirectoryW. What is its argument type? A Unicode string. So you should supply a Unic...

CRM 3.0 Server Error in '/' Application when accessing Reports via
Hi, I've got a server running Sharepoint 2003 and CRM 3.0, both using SQL 2000 Server, which is a separate server. All Windows Server 2003. The default website on the CRM site has always been stopped and the CRM site has a host header, the CRMReports folder is inside the CRM website. No SSL enabled on the CRM site. All has been running fine until the last couple of days, now when we go to http://crm and click on 'Reports' in the CRM app via IE, we get the following error: Microsoft CRM Unhandled Error Details: Server Error in '/' Application. --------------------...

Users failing to log in to Exchange on some PCs but not others.
Last week a number of laptop users reported that whenever they run Outlook 2002 to access exchange they are being prompted with a login dialogue. As they are already authorised network users this should not be happening. I took the most important users laptop and checked the settings to find everything was OK. I started a test profile and tried to set up the user there. Same problem. I went to another PC and set up a new profile and accessed exchange immediately. Back at the laptop, I reinstalled the Outlook Suite, The Network components and anything else I could think may be at fault, but sti...

Protecting value in cells to change
Hello Excellers, I have the next problem, when i have a value on Sheet1!C3, Sheet2!cells C3:C10 may not bechanged. When sheet1!C3 is empty, Sheet2!cellsC3:C10 can be changed. How can i accomplish this action ? Greetz, Reijer You can do this with data validation but there are limits as to how much "protection" this will give you. You can try this out and see if it meets your needs. Create this defined name: Goto Insert>Name>Define Name: SH1C3 Refers to: =Sheet1!$C$3 OK Select the range Sheet2 C3:C10 Goto Data>Validation Alow: Custom Formula: =SH1C3="" U...

Identity Column Values
Is there a way to tell SQL Server to cache a sequence of pre-generated Identity values in memory to improve the performance of getting each successive number? If SQL Server already does this by default, is there a way to tell it how many numbers to cache? I have an application that does many concurrent inserts into a table. I added an Identity column to the table and saw SQL Server CPU utilization rise by roughly 10%. So I was wondering if I can improve performance by pre-caching Identity values. Thanks. You cannot pre-cache identity values. Are you actually seeing a prob...

Looking up values in a table
Hi, How do you search for data from a table having 2 criterias? Example: Month Name Score Jan John 3 Jan Mark 2 Jan Tom 4 Feb John 5 Feb Mark 3 Feb Tom 4 Mar John 5 Mar Mark 4 Mar Tom 3 Let's say i want to look for the score for john in Feb. What formula could I use? Thank you, On Mon, 26 Apr 2010 11:55:01 -0700, Aris <Aris@discussions.microsoft.com> wrote: >Hi, > >How do you search for data from a table having 2 criterias? > >Example: >Month Name Score >Jan John 3 >Jan Mark 2 >Jan Tom 4 >Feb John 5 >Feb Mark...

Operation Failed error
When I attempt to send a worksheet via email (Outlook 2000) I get "Operation Failed" error. Any ideas? ...

Runtime error when trying to save Excel 2000 worksheet from VB app
I have a VB 6.0 application that creates reports using Excel 2000. The application has been working fine but recently I installed it on a new hard drive (same configuration) and now I get a run time error every time I try to save the excel report. The error is: Runtime error '1004'. "Unable to set the CenterHeader Property of the Page Setup class." Can anyone help me troubleshoot this problem?! ...

Error Code 8004888d
Windows Vista Home Premium 32 bit Have been sing windows live messenger for years with no problem. Suddenly it (almost) freezes when I try to log on and then wont let me sign in. "Signing in to windows Live Messenger failed becasue the dervice is temporarily unavailable. Please try again later - Error code: 8004888d" The service is available because I still have no problem signing in at any other computer. I saw some (old) "fixes" on google, all of which I tried and none work. Needless to mention, no help from Microsoft. Anyone any ideas ? Thanks...

Total for Cells with same name value
I am sure I've done this before. somehow it alludes me all of a sudden; I have a table with ProductName | Amount Sold Where Product Names can duplicate Sorted by product name I want to run a simple column formula so it will step down and as long as it is still in same product group (i.e. A6=A5) it will give me a report on the totals. hi not sure but it sounds like you are talking about the sumif function. =sumif(criteria range, criteria, sum range) or if you table was in A and b then =sumif(A2:A500,"productname", B2:B500) or did i miss something? Reg...

Public folder contact-error viewing calendar activities
Hi. We have several Contacts folders under Public folders, with people's tasks and calendars set to link to the Activities in these folders. This works ok apart from one user's calendar. Tasks works fine but if you go to the contact, Activities tab, the following message is displayed: "Outlook cannot display this view. The contacts folder could not be found." The calendar link is in place, and the permission is set to Editor (as is the Tasks folder). Can anyone help please? Alison wrote: > Hi. We have several Contacts folders under Public folders, with > people&...

Why do I get ERROR <<HQMessageServer>> 3285 Item not found in col.
any clues? Would help a lot! Dan Sounds like a store may have created an item locally. Can you give some more details about when the error occurs? I'm guessing that it's showing up in HQ Client - is it at one store or multiple stores? -- Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me directly but post all responses here in the newsgroup so that all can share the information "Dan" <Dan@discussions.microsoft.com> wrote in message news:BFCAC371-38BE-4B97...

lookup value in column
A simple example of what I am looking for: Sheet 1: Col A Col B Jan 125 Feb 100 Mar 95 Apr ..... Nov Dec Sheet 2 Col A Col B Amount for 95 latest month Sheet 2 Col B should contain 95. (This being the most recent value from Sheet 1). If a value was entered next to April on Sheet 1 this would then appear in Sheet 2 Col B. I guess I could do an IF Dec <> "", ELSEIF Nov <> "" etc., but I thought there must be a quicker was of doing this. is there a function that will do this? Thanks Andy With help from Bob Phillips and Frank Kabel: ...

Report Load Failed
when i deploy my project, crystel report have an error "report load failed".This project made in C# desktop application 2008. In solution, there is no error beacuse the crystel report path work well in solution but no well in deployment. ...

Copy Color Formats Based On Column Date Values
I currently have this code, where HMLoc is the starting point for a color paste at C6. Instead of having this a constant field, I need it to search for today's date in the cell above it (C5) (The dates are given in the range C5:BO5), and then color accordingly. I have struggled with this all morning and can't get it to work the way I want it. Please help me! Option Explicit Const LegendLoc = "BH3" Const HMLoc = "C6" Const None = 0 Sub ColorHM() Dim theRow As Integer Dim theCol As Integer Dim NumX As Single Dim Color1 As Integer Dim Color2 As Integer Dim Color3 A...

Returns #3
Is there a way to restrict the creation of 'Returns' outside of removing document access? Try Field Level Security. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobalbusiness.com The Dynamics GP Blogster at http://dynamicsgpblogster.blogspot.com "rcr" wrote: > Is there a way to restrict the creation of 'Returns' outside of removing > document access? ...

Excel fails to save properly
I have a daily exercise in which I copy a web-based datagrid and paste it into an Excel workbook. It's typically up to 6,000 rows +/- and 15 columns wide. It takes a while to paste. After that I block format remove text-wrap and adjust row height and column widths to fit, change the worksheet tab to a description name, then attempt to SAVE AS "XXXX_YYYY-MM-DD.XLS". At this point the worksheet usually becomes unresponsive but not always. If I close Excel and then reopen it, the recovered file can eventually be repaired and saved. Is this a known problem? I suspect th...

How do I specify using lines or bars on graphs w/ 2nd value axis?
I am building a chart using a secondary axis with both the data displayed in both bars and lines. Everytime I add a new field Excel decides if it will be displayed as a bar or a line. How do I control that decision myself. I understand how to align data to a secondary axis, but not how to control the bar vs line option. Create your chart using all lines or all bars. Select one to change, and use Chart Type on the Chart menu to change it. Select the next to change and use the F4 function key shortcut for Repeat Last Action. Etc. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier ...