Highlighted
Absent Member.
Absent Member.
1399 views

visual cobol - error creating window handle - message

Jump to solution

[Migrated content. Thread originally posted on 20 January 2012]

hi,

im starting to get a windows error message saying "error creating window handle" and after some googlerling found the following:-

http://stackoverflow.com/questions/222649/winforms-issue-error-creating-window-handle

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/3fb91a63-a86a-4817-9c3a-5b2f2443926f/

it mentions this code:-

dim index as integer
for index = ctlFLP.Controls.count -1 to 0 step -1
ctlFLP.Controls.Item(index).dispose()
next


But how do i cobolize it and where should i put it in my program.

pls help!

many thanks

neil.
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: visual cobol - error creating window handle - message

Jump to solution
It would be best to open up a support incident for this as we will probably have to take a look at your actual application to determine exactly what is going on.

Can you reproduce the error in a cutdown version of your application?
Is the error sporadic in your application or can it be reproduced by following the same procedural steps to run it?

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: visual cobol - error creating window handle - message

Jump to solution
This code is pretty specific to the example used in the articles.

It shows how to dispose of child controls withing a panel control named ctlFLP which is being created dynamically on a Form.

It just invokes the dispose method on each of the child controls on the panel in order to stop a handle leak condition that was occurring.

It should be placed in a method that will be invoked when you are done using the panel control that is the parent to these child controls.

The COBOL version of this would be:


       01 wsIndex   binary-long.     
       method-id disposeChildren.
       procedure division.
           
           perform varying wsIndex from ctlFLP::Controls::Count by -1
              until wsIndex = 0
              invoke ctlFLP::Controls::Item(wsIndex - 1)::Dispose
           end-perform


But is this really the same problem that you are experiencing?

Are you dynamically creating a lot of controls that are not being disposed of properly?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: visual cobol - error creating window handle - message

Jump to solution
to be honest i dont know if thats the exact error im getting.

i do have a jpeg image of the error but dont know how to post it on to this page?

any ideas?

thanks

neil.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: visual cobol - error creating window handle - message

Jump to solution
It would be best to open up a support incident for this as we will probably have to take a look at your actual application to determine exactly what is going on.

Can you reproduce the error in a cutdown version of your application?
Is the error sporadic in your application or can it be reproduced by following the same procedural steps to run it?

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: visual cobol - error creating window handle - message

Jump to solution
this error is just sporadic, cant be reproduced as its so random.

i have no idea whats causing it, which is why i googled it, and was surprised to see other visual studio users were getting same sort of problems.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: visual cobol - error creating window handle - message

Jump to solution
Can you please send the error .jpg to me at chris.glazier@microfocus.com?

A stack trace would also be helpful if it is being produced.

Thanks.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.