|
char ch[5];<br />
strcpy(ch, "Hello");
What am I supposed to check with that? Should I printf(ch) ? Thanks both of you!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
Hello. I'm sorry for the delay, due to public holidays in Sweden.
What I wanted you to check is for buffer overruns, as in my example.
(Allocating 5 bytes and writing 6 bytes in it).
Such overruns usually corrupts the stack, and makes the return to the previous function "go bananas".
That's a common source of this kind of problems.
|
|
|
|
|
hi..I have the following problem..
Im doing a program that receives SMS and save it to file,the SMS format is received like this
+CMGR=2
+CMGR: "REC UNREAD","phone number",,"06/06/21,15:20:28+32"
SMS Test
OK
the first line is the command Ive typed to read SMS to char* buffer and the last line is the responce of the modem (that the operation is done)
now I want to save the SMS starting from "phone number" ending with SMS test ( the message itself).
how can I do that dynamiclly?
|
|
|
|
|
You can use Find(), and based on the index returned extract the string using CString::Right(), CString::Left(), CString::Mid()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
use find()..to find what ? Ive searched CString functions and find() return the first occurrence of char..saying that "\"" or "\," is what Im looking for find() wont work..so can you explain more how is that done?
what about string tokenizer ..I dont know much about it but if I can tokenize the string it will be good..but with library to use and how??
|
|
|
|
|
CString s="+CMGR=2+CMGR: \"REC UNREAD\",\"phone number\",,\"06/06/21,15:20:28+32\"SMS Test OK";
int iFirstComma=s.Find (",",0);
CString sExtracted1=s.Right(s.GetLength ()-iFirstComma-1);
int j=sExtracted1.Find ("OK",0);
CString sExtracted2=sExtracted1 .Left (j);
Now sExtracted2 has the string you need. Is it Ok?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
My compiler(borland c++ builder 6) cant recognize CString class..the header file name is CString isnt it?maybe because its MFC.......but c++ builder has MFC !!
but this code looks fine..I'll try to implement it using other string type... thanks alot
|
|
|
|
|
..If there is "OK" in the SMS message itself the code above will trim the rest of the message...
its better to delete the last 2(or 3) characters...
|
|
|
|
|
For articles on String Tokenizing search CodeProject with String Tokenizing in the search box.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
A camera and a frame grabber have been set up. And the frame grabber has been installed in PCI. When I use continuous grab mode, the image data are written into a specified memory continuously and cover the old data. Then how can I update the image from the memory to the client screen since I have tried calling StretchDIBits in OnDraw(), but I find it is not efficient with the client area twinkling frequently. Is there any efficient way like copying the data directly to the display memory? How?
Thanks
|
|
|
|
|
Override OnEraseBackground to do nothing.
|
|
|
|
|
For this kind of application DirectDraw is the best solution,
With DirectDraw;
Less PCI bandwith consumption.
You can manipulate video memory directly in various video format.
You can solve flickering/twinkling by Double Buffering, Waiting Vertical SYNC.
|
|
|
|
|
In PPC emulator, I press a button to call a dialog. And in the dialog state, how can I hide the menu bar??
I use the following function in OnInitDialog()
this->ShowWindow(SW_HIDE);
or
this->SetMenu(NULL);
but they are useless@@
Any suggestion is useful!!
|
|
|
|
|
I have an application that uses the IProgressDialog interface to dislay a progress dialog during long processing steps. Everything works fine until I invoke the StopProgressDialog method to close the dialog. The progress dialog doesn't disappear until I move the mouse over it. Does anyone know what could be causing this?
|
|
|
|
|
Did you ever figure out the solution? I am having the exact same issue.
|
|
|
|
|
It's been a while since I had this problem but I believe what we ended up doing was to get the window handle of the dialog and force it down. I no longer have access to the code but if I can find out from a person who's still working on the project I'll try to post the code we used.
|
|
|
|
|
After searching the internet some more I found the same answer. Following is the code, in case anyone else has this issue.
HWND hDlgWnd(NULL);
HRESULT hr;
IOleWindow *pOleWindow;
//Sometimes the progress dialog sticks around after stopping it,
//until the mouse pointer is moved over it or some other triggers.
//This process finds the hwnd of the progress dialog and hides it
//immediately.
if (SUCCEEDED(m_pprogressdlg->QueryInterface(IID_IOleWindow, reinterpret_cast<lpvoid> (&pOleWindow))))
{
hr = pOleWindow->GetWindow(&hDlgWnd);
if(FAILED(hr))
{
hDlgWnd = NULL;
}
pOleWindow->Release();
}
m_pprogressdlg->StopProgressDialog();
if (hDlgWnd)
::ShowWindow(hDlgWnd, SW_HIDE);
m_pprogressdlg.Release();
|
|
|
|
|
As I recall, that's basically what we did as well. I'll double-check this when I can get the code fragment from my co-worker.
|
|
|
|
|
Hi,
I use the function OnPaint() in a dialog-based mfc-application to draw a nice little bitmap. Although there is no click to minimize the dialog, it can be minimized by clicking 'Show Desktop' in the windows taskbar oder pressing 'Windowsbutton+d'.
The problem is: When I reactivate my application, the bitmap will not be drawn! It seems, the function OnDraw() is not called. Only after a mouseclick in the dialog, it will be drawn.
Is there another function I have to overwrite with the code for bitmap-loading? I do not know any. Which function is called when a minimized dialog is reactivated?
Thank you very much!!
Nick
|
|
|
|
|
Try WM_ACTIVATE.
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi, I'm developing a simple applications for child to use and this requires the disabling of the minimize, maximize, and close buttons on the top right hand corner. Also, the application needs to be maximized at all times. This was easily achievable by creating a window with only the WS_CAPTION passed as the Window Style and ShowWindow was used with SW_SHOWMAXIMIZED to maximize the application on when the program starts. The problem, however, is that the maximized window is still movable and double clicking on the title bar will un-maximize it. Is there a way around this, where I can prevent the movement of the window and prevent the un-maximizing of the window?
|
|
|
|
|
Handle the NC_LBUTTONDOWN and NC_LBUTTONDBLCLK messages. The handlers don't have to do anything, as long as the messages aren't passed along to DefWindowProc() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
If you process such messages as WM_SYSCOMMAND, you could simply do nothing for a command you don't want to support, such as SC_RESTORE. Don't know if that message covers double-clicking on the title bar. You could even try processing WM_NCHITTEST and never returning HTCAPTION.
|
|
|
|
|
Thanks guys, I'll give both NC_LBUTTONDOWN,NC_LBUTTONDBLCLK, and WM_SYSCOMMAND a try and see how that goes.
|
|
|
|
|
Hi guys,
Basically I am getting unresolved external errors when trying to use the _strtime and _strdate functions. I have tried to include the following libraries in my project to aid the situation:
LIBC.LIB
LIBCMT.LIB
MSVCRT.LIB
But alas it doesnt work. Every single one of them conflict with one of the other libraries I have. These are the libraries, options and include files I have:
shlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testing_project.pdb" /debug /machine:I386 /out:"C:\testing_project.exe" /pdbtype:sept
<code>
#include <windows.h>
#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <shlwapi.h>
#include <time.h>
<code>
Anyone able to sign some light on the issue and see what I could do to make this work?
Thanks,
Robbie
-- modified at 18:44 Wednesday 21st June, 2006
|
|
|
|