Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

I am receiving exceptions from CWButton in a VC++ application.

I am routinely updating (twice a second) the color of a set of buttons that I have added to a dialog. Frequently, while only clicking somewhere on the dialog, I get exceptions to the GDI32. If I disable the buttons so that they don't get redrawn, I don't get the exceptions. The message is:
First-chance exception in LSBR.exe (GDI32.DLL): 0xC0000005: Access Violation.

I have removed all code that talks to the buttons or changes their status, and that does not remove the exceptions! I have found no information concerning this on any postings yet.

Thanks, Dave
0 Kudos
Message 1 of 3
(3,148 Views)
If you have CWButton from Measurement Studio 1.0 or Measurement Studio 6.0, I suggest installing Measurement Studio for Visual C++ and using those classes instead of the wrappers that MFC automatically generates for ActiveX controls. Measurement Studio for Visual C++ contains MFC C++ classes that provide native C++ interfaces to the ActiveX UI controls and to several hardware APIs. It also contains a project wizard to create new projects that use Measurement Studio classes and an add-in that lets you add Measurement Studio support to existing projects.

First, I suggest trying the CNiButton class from this Measurement Studio for Visual C++ libraries and see if this still reproduces when using this interface to the control. If you're still getting the er
ror, could you please post a small test project that reproduces the error? Thanks.

- Elton
0 Kudos
Message 2 of 3
(3,148 Views)
I am converting an existing project over to use MS for VC++, so I will look for some supporting articles to help me. I just recently installed it and am using MS for the first time. What I am saying is that I, of course, didn't use the project wizard... I will generate a project with the wizard and follow it's lead. Do you know of a good conversion tutorial?

I will try your suggestion concerning CNiButton. Does this mean that I should not use ActiveX UI controls in the future, or do I just need to change some options or libraries to get them to work?

Thanks,
Dave
0 Kudos
Message 3 of 3
(3,148 Views)