|
IMHO,
if you are to show the file in the previous state,save the number of characters that were not being shown (at the time of exiting from your application) from the start and save it to the registry.The next time you have to show the file, set the text on the control on which you are showing the contents according to the count you put previously in the registry.
This could be one of the many options of doing this. You can also look for better opinions/options on this forum.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You may start with INI file where you can store the application data...and use whenever required.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I have loaded bmps to a CImageList,
ex:
//////////////////////////////////////////////
bmp->m_hObject=(HBITMAP)LoadImage
(NULL, str, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
m_imagelist1.Add(bmp, RGB(0, 0, 0));
question:
I want use this CImageList to gain an icon to Load to other place, what shall I do?
wating for answers online!
Just my interest for these common things
|
|
|
|
|
HICON ExtractIcon( int nImage );
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
could you tell me in detail?
Just my interest for these common things
|
|
|
|
|
Taken From MSDN :-
Just look for that function in MSDN.
Example<br />
<br />
extern CImageList* pmyImageList;<br />
extern CDC* pmyDC;<br />
<br />
int i, dx, cx, cy, nCount = pmyImageList->GetImageCount();<br />
HICON hIcon;<br />
<br />
::ImageList_GetIconSize(*pmyImageList, &cx, &cy);<br />
<br />
for (dx=0,i=0;i < nCount;i++)<br />
{<br />
hIcon = pmyImageList->ExtractIcon(i);<br />
<br />
pmyDC->DrawIcon(dx, 0, hIcon);<br />
dx += cx;<br />
}
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Ok, thank you very much, I will try this way!
Just my interest for these common things
|
|
|
|
|
Can someone compile this c file for me I tired for a few days with no success
and this is really important to me .
http://www.xs4all.nl/~itsme/projects/sources/other/zippw.c[^]
many of my other mates attempted also failed they said it need unix os
I appreciate it to the max.
-- modified at 0:34 Thursday 22nd June, 2006
|
|
|
|
|
Yes it does compile (win32 console app) with a few changes to the includes and a few typedefs (the changes amount to at most 6 lines). That said this is a forum for posting programming questions and not a compiling service.
|
|
|
|
|
lol cmon I have no where else to ask
|
|
|
|
|
I really cannot see what's wrong here:
for (curPart; curPart < totalParts; curPart++)<br />
{<br />
#ifdef MTXCMD<br />
printf("Reading part #%i... \n", curPart);<br />
#endif<br />
printf("C");<br />
<br />
iFileName = mtxJoinAddExt(fileName, curPart-1);<br />
<br />
<br />
iFile = fopen(iFileName, "wb");<br />
<br />
<br />
if (iFile == NULL)<br />
{<br />
_mtxSetErrorCode(MTX_ERROR_READFILE);<br />
_mtxSetErrorInfo(iFileName);<br />
return -1;<br />
}<br />
printf("Checkpoint!");
The "C" prints, but the "Checkpoint!" doesn't... And no, the fopen() didn't return false, because if I put the "C" printf() after the next line, it does not print! And mtxJoinAddExt() returns fine, I'm sure of that. Maybe a compiler error? (GCC 3.4.2)
Thanks!
\|/ Thrift Store Floppy Collection \|/
(Server currently down due to mainteneance, aka comp not detecting monitor and acting weird)
|
|
|
|
|
Maybe because your program exit before having printed the text ? Try to add a sleep after the print.
Cédric Moonen
Software developer
Charting control
-- modified at 2:25 Thursday 22nd June, 2006
BTW, if you use printf to debug your code, use your debugger instead, it is much more powerfull.
|
|
|
|
|
My guess is that mtxJoinAddExt corrupts the stack. Check it for array overrun.
I.e:
char ch[5];
strcpy(ch, "Hello");
|
|
|
|
|
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.
|
|
|
|