|
I'm currently processing a very large binary file in which I need to move backwards and forwards through the file to check for start and end markers, once I've found a matching start and end marker I then go back to the end of the start marker and read in all of the data upto (and including) the end marker.
However I've found that when I use:
seekg ( -1, ios::cur )
it appears to stay on the current element, so I have to do
seekg ( -2, ios::cur ).
Is this correct behaviour? (btw I'm using -1 and -2 only as example values).
many thanks,
Andy
|
|
|
|
|
It's not staying on the same element.
Take an example, you have this text in a file: "Test". At the begining, the "file pointer" points before the letter 'T', then if you read this character, the file pointer will point just before the letter 'e'. Thus, if you do: seekg ( -1, ios::cur ), it will rewind one character and thus pointing before 'T', that is the letter you just read. So, as you can see it is not staying on the same element ! Because if didn't use the seekg ( -1, ios::cur ), you would have read the 'e' letter instead of 'T'.
Is it a little clearer ?
|
|
|
|
|
cheers, I totally forgot that reading it would also incrment it as well
|
|
|
|
|
I making Active X Control, But IE Key Press( ex)CTRL+R ,CTRL+E) ) is very Problem.....
I Want Active X control Key Press.But,
I can't close IE key press.
The problem is solved by me.
Seredius
|
|
|
|
|
Jokes do not belong to this forum.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
seredius wrote:
The problem is solved by me.
can you please share it. I also remember faced similar one.
|
|
|
|
|
I'm using the CHOOSECOLOR to change the background color on a hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT",.....
control window.
However there is only the background on the main window that changes
hwnd = CreateWindowEx(WS_EX_CLIENTEDGE,MainWindow,.....
Part of the code
SetClassLong(hwnd, GCL_HBRBACKGROUND, (LONG)hbrush);
InvalidateRgn(hwnd, NULL, TRUE);
What's wrong?
Is it possible to edit the bg color on the hedit window?
|
|
|
|
|
leifmikael wrote:
Is it possible to edit the bg color on the hedit window?
Yes, You have to handle WM_CTLCOLOREDIT Message in your WndProc!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thank You very much now i'm on track againa'
|
|
|
|
|
leifmikael wrote:
Thank You
Mention Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
i want to design a photo album with back and next button to show a list of image file(bmp/jpeg/gif ect). plz give the sugestion how to do it
|
|
|
|
|
|
I want to place slider control in Browser control. and want to control some reading with help of slider control.
How can i send notification to c++ code wwhen slide dragged in browser webpage. (I put the slide control of windows in webpage of browser with object tag).
Secondly guide me -- this way is right or i should follow Javascript/DHTML slide in web page.
Quaidian For Once, Quaidian For Ever
|
|
|
|
|
Now I am taking part in one project of GSM/GRPS signalling system support.And I focus on signalling parsing part.My job is parse and decode binary stream(010101011110101.....) and interpreting under GSM 04.08 spec.Do anyone have such samples or ideas on this?
thanks a lot.
Sam
|
|
|
|
|
Hey Der I'm a Newbie in C++ & I get this error while compiling My Application.
: fatal error C1083: Cannot open include file: 'studio.h': No such file or directory
Error executing cl.exe.
Pls Help!!!
|
|
|
|
|
the file is stdio.h not studio.h
next time, be careful on what you write
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
LOL Thanks My Bad.......
But now there 2 more errors..... LMAO They Jus dont stop do they.....
WhileDemo.cpp
E:\Hansveer\C++ For Dummies\Chap05\WhileDemo\WhileDemo.cpp(6) : error C2143: syntax error : missing ',' before '.'
E:\Hansveer\C++ For Dummies\Chap05\WhileDemo\WhileDemo.cpp(6) : error C2059: syntax error : '.'
Error executing cl.exe.
WhileDemo.exe - 2 error(s), 0 warning(s)
The program is as follows, Its jus a tutorial.
// WhileDemo - input a loop count. Loop while
// outputing astring arg number of times.
#include <stdio.h>
#include <iostream.h>
int main(int arg. char* pszArgs[])
{
// input the loop count
int loopcount;
cout << "Enter loopcount: ";
cin >> loopcount;
// now loop that many times
while (loopcount > 0)
{
loopcount = loopcount - 1;
cout << "Only" << loopcount << "loops to go\n";
}
return 0;
}
|
|
|
|
|
Psych0hans wrote:
int main(int arg<b<font color="red">. char* pszArgs[])
it must be a ', ' between the parameters, not a '. '
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Psych0hans wrote:
int main(int arg. char* pszArgs[])
Please be carrefull when you copy the examples ! In general the error messages are there to help you. If they say there is an error at line 6, in general it's because there is an error on line 6. And if they say something like
error C2059: syntax error : '.'<br />
Error executing cl.exe.<br /> maybe it's because there is a '.' somewhere where it shouldn't.
So replace the line by:
int main(int arg, char* pszArgs[])
and this should work
|
|
|
|
|
Hey Guys Thanks Again for Your Help....... Yes U were right.... LOL But these Drated errors Jus go on & on...
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/WhileDemo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
What Will I ever do......... I really appreciate Ur help though!!!
I'm Jus a Bit
|
|
|
|
|
That is because you created your project as a Win32 application so the linker looks for the WinMain function to start the code... and of course it cannot find it because you use the main entry point instead. So, go in the project settings and the must be somewhere there an option to change the project type. Select it as a console application.
Or restart a new project and at the begining, be carrefull to choose console application. Then add your file to the new project.
Hope this helps
|
|
|
|
|
Thanks Yall For Ur Help Guys I've finally seen the error in My Ways..... :-P But seriously Thanks for the Help I finally Figured out my mistake & I O U 1
|
|
|
|
|
|
Start You project As CONSOLE Application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Nope, not this time
|
|
|
|