The fact that C/C++ is a staticly-typed language has nothing to do with static member functions. In turn these have very little to do with static functions in general. They are just 3 different uses for the same word.
Member 14968771 wrote:
If I have a C+_+ class and the function is defined as "static" - what is so different from function which is NOT defined as NOT static ?
Regular member functions have one extra hidden parameter, the "this" pointer, that points to the object on which they are called. Static member functions don't have this hidden parameter and are very much like any regular function except for some scoping rules.
"Static", like "object" and "module" are a very abused words in programming.
First you tried something without 'static' in place and it worked.
Second you put 'static' somewhere and now it doesn't work. The console output does not show up.
Not really a lot of information there. So the following are some possibilities for that behavior.
- You recompiled, it failed, and then when you ran something it did not find the binary. So it didn't actually run.
- You recompiled, it worked (because someone has some 'clever' code) and it failed with an exception. But you did not see that exception output or ignored it.
- You recompiled, it worked (because someone has some 'clever' code) and that other code worked. But you did not see any output because the actual method that was called, which is a different one, does not do console output.
You are describing a case where you have an existing application flow: Serial port to POS.
And you want to put monitoring place to see what that serial traffic looks like. So you don't want to replace or modify the existing code but rather just see what is happening.
So you should google for the following
windows serial port intercept
That said however I would suggest that if the POS code is under your control that the POS code itself should be modified to provide the same sort of monitoring. Log files (search for libraries) can both be used to control and collect such data.
I have been able to format all my text. via Streamin, Next thing I would like to draw is bitmap breakpoint I mean like in the visual studio debugger. I think the examples of using the richeditole interface is if you streamin SF_RTF mine was done as text SF_TEXT.
I thinking of getting the richedit DC via CWnd::GetDC and maybe draw an ellipse
I think if i draw it on the richedit itself it might misalign the rest of the text a line, then there is the option of drawing it on the side of the dialog box though when I page up and down the text I would have to erase and re-draw if anyone has any ideas how to go about this, I would appreciate it. But as I said most of the examples, I saw for drawing in richedit was streaming with SF_RTF THANKS
As I have stated in my question the OLE interfaace only works SF_RTF my text was streamed in SF_TEXT
I have decided to copy Visual Studio the code is probably in SF_TEXT if you look around the code there is a frame possibly a dialogbox frame the breakpoint is probably and CDC::Ellipse. bitmaps seem to have a 3d look With SF_TEXT you cann't draw in the rich edit it messes up the text. I drew on side of the adjoining dialogbox box frame what I really needed was the y coordinates got the from PosFromChar the x I can determine from the width of the dialogbox frame thank you
I posted this yesterday by mistake in the CLI forum, so I am reposting here. I am getting a heap corruption in my stream in function. I have a global variable, which keep count of the number of records I stream in the exception happens when the record count is 0x197e
When I insert the following code
if (nummachine == 0x000000000000196E)
and step thru the code everythibg works fine
the amount of characters i am streaming (as I said I am able to complete the process with the above code
is 0x7604d0 or 7,734480 decimal
I use the following code
though the function says that is intended for RTF code
here is the stack frame when I get the exception any debugging ideas would be much appreciated.
riched20.dll!CTxtPtr::InsertRange(long,unsigned short const *) Unknown
riched20.dll!CRchTxtPtr::ReplaceRange(long,long,unsigned short const *,class IUndoBuilder *,long,long *,unsigned long) Unknown
riched20.dll!CTxtRange::ReplaceRange(long,unsigned short const *,class IUndoBuilder *,enum SELRR,long *,unsigned long) Unknown
riched20.dll!CTxtRange::CheckLimitReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned long,long *,long,int,unsigned long) Unknown
riched20.dll!CTxtRange::CleanseAndReplaceRange(long,unsigned short const *,int,class IUndoBuilder *,unsigned short *,long *,unsigned long) Unknown
riched20.dll!CLightDTEngine::ReadPlainText(class CTxtRange *,struct _editstream *,int,class IUndoBuilder *,long) Unknown
riched20.dll!CLightDTEngine::LoadFromEs(class CTxtRange *,long,struct _editstream *,int,class IUndoBuilder *) Unknown
riched20.dll!CTxtEdit::TxSendMessage(unsigned int,unsigned __int64,__int64,__int64 *) Unknown
user32.dll!CallWindowProcAorW(__int64 ,struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,int) Unknown
mfc140d.dll!CWnd::DefWindowProcA(unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 1100 C++
mfc140d.dll!CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2100 C++
mfc140d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 265 C++
mfc140d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 418 C++
mfc140d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 299 C++
user32.dll!SendMessageInternal(struct HWND__ *,unsigned int,unsigned __int64,__int64,int) Unknown
> mfc140d.dll!CRichEditCtrl::StreamIn(int nFormat, _editstream & es) Line 775 C++
DriveRichEdit.exe!CProgDebug::OnInitDialog() Line 137 C++
DriveRichEdit.exe!CMainFrame::PROGDEBUG() Line 48 C++
DriveRichEdit.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26 C++
Yep that is how memory (heap) corruption works. You broke the heap at that point. Then somewhere after it something went to use the heap and at that point the data was bad.
Additionally the behavior that happens could be almost anything. Depends on what the actual data (bad) was in the heap and what it was attempting to do with it at that point, and even what was calling it.