|
iltallman wrote:
I have been using it for years now and all of a sudden during some testing it has started to crash inside the call.
Could you be trying to reference a memory location that no longer exists?
-Nick Parker
|
|
|
|
|
No. I looked in the debugger at all the data and attributes - it all looked good with appropriate NULL ending strings
|
|
|
|
|
well -- fprintf works fine for me when I don't do something boneheaded.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
I had a case once, where I did something like this.
<br />
char *str = GetSomeInputString();<br />
fprintf( F, str );<br />
worked pretty well, but would crash once in awhile when someone put a %s.
changed it to:
fprintf( F, "%s", str );
all is well.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
fprintf has always worked well for me. Except when I did something boneheaded like you point out.
Sometimes I have done things like
int i = 8675309;<br />
char *str = GetSomeString()<br />
fprintf(F, "%s", i, str);
|
|
|
|
|
Robert Little wrote:
int i = 8675309;
Reminds me of a song!!
|
|
|
|
|
I've done that too.
None of us are exempted from bonehead mistakes..... I've certainly had my share, and unfortunately they seem to be the most difficult to track down...
It's my guess that the writer of this question made some boneheaded mistake....
Have fun!
P.S. I don't really consider fprintf to be old....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Santa Cruz Networks / VidiTel / Reality Fusion (pick a name -- may change at any moment)
|
|
|
|
|
A common problem with formatting is that the parameters don't match the formatting string, and VC++ doesn't do a check to see if they match.
Elaine
The tigress is here
|
|
|
|
|
I've been trying to use the MSComm serial communications control with a Doc/View architecture but can't seem to find a way to access the OnComm windows message directly in the View class... Can it only be accessed from a dialog class? (I though adding an object of the control in the View header file (CMSComm m_comm;) would allow me to "see" the OnComm windows handler in Class Wizard.
Using the MSComm control in a dialog box is fairly easy... you bring in the control and double click on it in the dialog box to add the OnComm message handler to your dialog box class. What if you don't want the dialog box sitting on your view...I'd like to respond to serial port data and draw lines on the View.
|
|
|
|
|
Hi,
When I use window, if I right click on the desktop, there is a menu that display refresh,copy, paste etc..
I would like to be able to do something similar to that. In a DlgApp, if I click on a button, I would like to see a menu appear from witch I can choose data. What kind of control do I have to use?
Any ideas on how to achieve that?
thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
see TrackPopupMenu in the documentation
|
|
|
|
|
|
I have been working on an application that displays data in various labels and textfields.
How can I size the application to the correct dimensions video card settings (display settings)?
thanks,
sj
|
|
|
|
|
Call GetSystemMetrics with the following:
SM_CXSCREEN,
SM_CYSCREEN
|
|
|
|
|
I am writing an application that upon the user pressing a funciton key the applicaiton is dispalyed. Even if the user is using another program and this key is pressed.
I have tried using the following functions but if I have notepad(or other app) maximized and press the button my appication does not come to top.
ShowWindow
BringWindowToTop
SetWindowPos
I have confirmed the hot key is being recognized by poping up a dialog box when it is pressed. I have confirmed the correct handle by using SetWindowPos to move the window. Is there another approach/function I should be using
Thank you,
SAK
|
|
|
|
|
One solution is ShowWindow().
ShowWindow(SW_RESTORE);
Kuphryn
|
|
|
|
|
I've made a horizontal scrollbar control using CreateWindowEx, and on the WM_HSCROLL event in the parent window I do this:
if (flag == SB_LEFT)<br />
{<br />
curPos -= 1;<br />
}<br />
<br />
else if (flag == SB_RIGHT)<br />
{<br />
curPos += 1;<br />
}<br />
<br />
else if (flag == SB_LINELEFT || flag == SB_PAGELEFT)<br />
{<br />
curPos -= 1;<br />
}<br />
<br />
else if (flag == SB_LINERIGHT || flag == SB_PAGERIGHT)<br />
{<br />
curPos += 1;<br />
}<br />
<br />
else if (flag == SB_THUMBTRACK || flag == SB_THUMBPOSITION)<br />
{<br />
curPos = position;<br />
}
Then using SetScrollPos(hWndScroll, SB_CTL, curPos, TRUE) I try to let the scrollbar be updated, but it doesn't seem to work. any ideas?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
Hi.
I have a faulty app that I should restart whenever it crashes.
I can easily see when it's dead, since it creates a named mutex that disappear with the app.
My problem is that if the app crashes and shows a MessageBox
as this example:
The instruction at "0x004015b0" referenced memory at "0x00000000". The memory could not be "written".
Click on OK to terminate the program
Click on CANCEL to debug the program
Is there any way to avoid this? I can't modify the darned app's source code.
thanks in advance,
bye
M.
|
|
|
|
|
|
Thank you very much indeed, your answer is perfect for our needs.
marco
|
|
|
|
|
I have read many tutorial article here and now realized a mouse hook,Now I can get windows handle which mouse move over,but I don’t know how to get mouse right button click event.I want to prevent a special window's mouse right button click event,how I do?Please help me.
|
|
|
|
|
The subject says it all,
how can i receive all messages sent in system - like SPY does ?
Thank you very much!
|
|
|
|
|
|
Thank you, i'll take a look!
|
|
|
|
|
Hi
I have created a Dialog based application using VC++ 6.0. I have set the main dialog to NOT have a title bar and system menu. Unfortunately, this also remove the icon in the Windows taskbar when the application is running. Is there a way I can get round this problem? My endusers demand that the icon be seen next to the application name in the taskbar.
Thanks in advance
|
|
|
|