?
Solved

GlobalAlloc / GlobalFree problem on Windows 7

Posted on 2010-09-14
6
Medium Priority
?
1,661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Suggested Courses

765 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