|
|
Short and sweet here. Building app with C++/Win32. Deadline is Friday
and I've got this one last little bitty error. Someone Please help...
I can't seem to track it down. Visual Studio doesn't(helpfully) point to
the line of the error. ? ..
ERROR: The instruction @ "0xc91142e" referenced memory @ "0x36303130".
The memory could not be read.
******** Code ******** NREGS IS 75 AND CALIB_START_REG IS 100 *********
case CALIB_WRITE:{
int cntr=0;
while(cntr < NREGS){
Sleep(20);
sWrtCalQuery=BuildWriteQuery((CALIB_START_REG+cntr),
01,
mpCalibrations[calibrate_list[cntr]]);
Port<<swrtcalquery;
port.listener(serialio::notify(hwnd).rx_flag(':'));
="" cntr++;
="" }
="" port<<ssavequery;
="" procflag="DFLT;
" modified="false;
" break;
="" }="" end="" calib_write
***********
="" seems="" to="" run="" through="" the="" while="" loop="" no="" problem.="" all="" of="" my="" values="" are
="" written="" connected="" device="" and="" also="" saved.="" so="" appears="" be
="" fine.="" be="" somewhere="" after="" that="" but="" can't="" figure="" it="" out.??..=""
="" also,="" when="" i="" debug="" go="" line="" by="" line,="" error="" doesn't
="" come="" up.??...=""
="" thank="" you,="" in="" advance.
="" greg..
="" --="" at="" 12:13="" wednesday="" 12th="" april,="" 2006<code="">
|
|
|
|
|
You mean your code works in debug mode and does no in release mode?
If yes, then check with array size and index used.
Typically such errors come in release mode if the memory allocated is not enough.
In debug mode due to extra buffer the problem dont seem to occur.
Check out the size of calibrate_list and max cntr value used.
|
|
|
|
|
TY ArtiGujare. I'll double check those items. I googled the error and
found a posting that directed me to a BB. It indicated that there may be
a problem with my machine. Consequently I compiled, jump drived the .exe
to another machine and ran it. No error...(hmmmm) Gonna test a couple more
machines....
Does running in VS - "start w/o debug" execute the app differently than if
you just ran the .exe??????
G
|
|
|
|
|
Not my machine. Generated the error on 3 out of 4 machines.
G
|
|
|
|
|
Thanx so much!!!!! You narrowed it down to a couple of things and as
a result, I tracked it down. Sometimes it just takes someone saying,
"More than likely the error is this. Double/Triple check it."
I had an infinite while loop going. For some reason, cntr was staying
at 1.
G
|
|
|
|
|
Compile your debug buid with /GZ. It may show the error then.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
|
How to set the text color of a toolbar, in a Win32 SDK project?
Thanks in advance.
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
Hello
i want to work with a Cfile Object in a console application
what should i do please
beacause when i declare a CFile Object in my console app
in the shows the error that Cfile is an indeclared identifier.
thank you
|
|
|
|
|
CFile is an MFC class.
your console project has to support MFC.
then, include windows.h
|
|
|
|
|
Mahhouraaaaaa wrote: i want to work with a Cfile Object in a console application
what should i do please
Use AppWizard to create a console application that supports MFC. No need to manually include windows.h . This is handled automatically by virtue of it being an MFC application.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
-I am creating a program while having the program GUI developed through Windows Form Application (part of VS2005). I have tried to find a tutorial in c++ but haven't been able to find one. I found many in C# but that doesn't really help in c++. I tried morphing some C# code to try to get the c++ code working, but that didn't work. I am trying do develop a test program so I know how to code Windows Foms Applications before I try to do the GUI on the real project.
-I want to be able to have an action happen when a button is clicked here's the code:
<br />
<br />
#include "stdafx.h"<br />
#include "Form1.h"<br />
<br />
using namespace windowsformsapplicationtest;<br />
<br />
[STAThreadAttribute]<br />
int main(array<System::String ^> ^args)<br />
{<br />
Application::EnableVisualStyles();<br />
Application::SetCompatibleTextRenderingDefault(false); <br />
<br />
Application::Run(gcnew Form1());<br />
<br />
<br />
Form1::button1.Click=Application::Exit();<br />
<br />
return 0;<br />
}
When I try to compile this code I get the following error:
.\windows forms application test.cpp(20) : error C2228: left of '.Click' must have class/struct/union
Ind have tried various variations of Form1::button1.Click and don't have a clue what to try anymore, so hopefully someone can help me! What am I doing wrong? How can I fix it?
|
|
|
|
|
In case anyone else hase the same problem later on, I finally (finally after lots of effort) found this.[^]
|
|
|
|
|
try attaching an event function, which the exit inside of that function.
This is why I recommended a tutorial on "Visual C++" not just on C++ or MFC, etc. You will find in the button properties how to add an event function to the putton press, then fill that function with the actual code to what is needed. It will be easier if you learn what the tools do for you, and if you read the code it helps teach you what you need to write yourself.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thank you very, very, very much.
I finally have a lead on what I am doing wrong.
|
|
|
|
|
Bob X wrote: I finally have a lead on what I am doing wrong.
don't hold your breath or bet your salary on it.... I use visual C++ for OpenGL, not for GUI. I know the process, not the specifics.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Jeffry J. Brickley wrote: don't hold your breath or bet your salary on it....
Ok, I won't hold my breath, but I am trying it out very soon
Hopefully the program will work
|
|
|
|
|
This page contains all you need to move deaper.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindowex.asp
The enemy's gate is down.
Welcome to CP in your language. Post the unicode version in My CP Blog[^] now.
|
|
|
|
|
I have a class A in a dialog application.
A thread X is running in this class. However, i would like to update a member var in class A.
In order to have access to this member var from thread X, i did a static cast like CClassA * pClassA = static_cast<cclassa*>
I know that the above is wrong but, how can i do this?
|
|
|
|
|
Correct.
pass address of instance of class A to thread X parameter.
Kuphryn
|
|
|
|
|
So it would look like:
CClassA pClassA = static_cast<cclassa*>(pClassA);
|
|
|
|
|
x *y = reinterpret_cast<x *>(z)
Kuphryn
|
|
|
|
|
For some reason, images I insert into a list control (whether main item or subitem), always seem to have a white background, and if I change the row color for example, it looks a bit hokey, same with when they are highlighted.
I'm using a transparent image list for the images, which work fine everywhere else where transparency is required, like buttons, etc.
Anybody know any way around this behavior, other than owner draw?
Thanx,
Rick
|
|
|
|
|
When you create the CImageList used to store the various icons for the CListCtrl you need to setup a mask for it at the same time, check the documentation for CImageList:Create[^] for more details.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|