Solved

GlobalAlloc / GlobalFree problem on Windows 7

Posted on 2010-09-14
6
1,653 Views
Last Modified: 2013-11-18
We receive strange errors when running our app on Windows 7 systems (we believe it is a Windows 7 problem). W7 runs as 32 Bit system, out app is VB6 based and calls some C++ DLLs, in one of which the error occurs. The app runs stable on 150 PCs (in majority Win2000 and Win XP).

This code fragment is a part of Chris Maunder's DataGridCtrl, where the complete grid shall be printed. See the code part and the error situation in the screenshot; GlobalFree causes an error.

I would try to use another allocating technique (if allocating an HGLOBAL can be done alternatively), but I'd like to understand what's the problem here in Windows 7.
GlobalFree-Error-W7.jpg
0
Comment
Question by:PC-Alex
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 33683126
"Break instruction exception" actually points to a an error condition being raised in 'datagrid.ocx' - you should rebuild that as 'Debug' with symbols to see what causes that. '0xc0000374' is 'STATUS_HEAP_CORRUPTION', see http://msdn.microsoft.com/en-us/library/cc704588%28PROT.10%29.aspx ("NTSTATUS values")
0
 
LVL 1

Author Comment

by:PC-Alex
ID: 33683193
jkr,

thanks for the comment ... we are *inside* datagrid.ocx there, where you see the code. This code is the code inside this ocx where the crash happens; this is the last place outside the Windows API or Kernel function until where I can track the error
0
 
LVL 86

Expert Comment

by:jkr
ID: 33683317
Yes, but the debugger also states "Cannot find symbols for datagrid.ocx", to a debug (or release) build with symbols might help tracking down the error.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:PC-Alex
ID: 33683823
now I'm a little confused. I'm sure he knows where to access the .pdb file, otherwise he wouldn't show me the exact line of code. Or am I missing something ?

Is there more to the symbol information than the .pdb file ?

I've given him the path to the DebugU folder (where all compiler output is located) and reloaded, but nothing changed, see the screenshot.

I think he's missing symbols for the vb runtime ?
GlobalFree-Error-W7-2.jpg
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 33683893
Ah, OK, I might have missed that. The German variable names made me think it was the code that calls the OCX.

As a side note: There is no need to use 'GlobalAlloc()' for a DEVMODE struct, you can just declare it as

DEVMODE dmDevMode;

and use it. I wonder whether that would fix the whole problem or just the symptom...
0
 
LVL 1

Author Comment

by:PC-Alex
ID: 33683913
OK, good Idea, I'll try and report ...
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

856 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