• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1695
  • Last Modified:

GlobalAlloc / GlobalFree problem on Windows 7

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
PC-Alex
Asked:
PC-Alex
  • 3
  • 3
1 Solution
 
jkrCommented:
"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
 
PC-AlexAuthor Commented:
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
 
jkrCommented:
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
PC-AlexAuthor Commented:
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
 
jkrCommented:
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
 
PC-AlexAuthor Commented:
OK, good Idea, I'll try and report ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now