|
any chance to see you code from which you achieve this ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Are you writing in your own executable? This is not recommanded. Assembly programmers used to write self modifiable code, but thank god for the protected mode!
If you are doing just this, use the registry to store your values.
If you try to write to another executable file, please show us your writing code.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello
i am not writing on the same exe ,i want to make this entry in a new exe
i can successfully read from the exe but it fails to write on the same location
strcpy(RemoteFile,m_DirPath);
strcat(RemoteFile,"\\GoldfishClient.exe");
fstream fileHandle;
fileHandle.open(RemoteFile,ios::in|ios::out);
LONG lActual,loffset=104063;
fileHandle.seekp(loffset,ios::beg);
char testch[4];
fileHandle.read(testch,4);
testch[0]='1';
testch[1]='0';
testch[2]='2';
testch[3]='5';
fileHandle.seekg(loffset);
fileHandle.write(testch,4);
fileHandle.flush();
fileHandle.close();
|
|
|
|
|
Hello,
Sorry that I post this so late, but you didn't reply to my post, so I didn't see this one before.
I see your problem, you use the fstream::seekg() function to position the file pointer to write to the file. The problem here is that fstream object have 2 pointers one for reading and one for writing. Since fstream is derived from basic_iostream and that in turn is derived from basic_istream and basic_ostream. They all have functions to position the pointer in the buffer. One for reading and one for writing. They couldn't give the same name to those functions, so they placed a suffix g for get and p for put after the functions. So your code would look like the following:
<br />
strcpy(RemoteFile,m_DirPath);<br />
strcat(RemoteFile,"\\GoldfishClient.exe");<br />
fstream fileHandle;<br />
fileHandle.open(RemoteFile,ios::in|ios::out);<br />
LONG lActual,loffset=104063;<br />
fileHandle.seekg(loffset,ios::beg);<br />
char testch[4];<br />
fileHandle.read(testch,4);<br />
testch[0]='1';<br />
testch[1]='0';<br />
testch[2]='2';<br />
testch[3]='5';<br />
fileHandle.seekp(loffset, ios::beg); <br />
fileHandle.write(testch,4);<br />
fileHandle.flush();<br />
fileHandle.close();<br />
This should help you
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi all, I am calling the GetConsoleWindow function, and according to the MSDN I defined the _WIN32_WINNT 0x0500, but i still get the error C2065 "GetConsoleWindow: Undeclared identifier", How can I fix it, plz help.
|
|
|
|
|
Have u included Windows.h ?
Steve Mayfield: "Coding in VB is like riding a tricycle...once you figured out how to peddle, its really hard to fall off."
My Articles
|
|
|
|
|
yes i did, but it still happen, i compiled it under Windows 2000 Professional.
|
|
|
|
|
Hi
I am using fstream class for file I/O operations. When I upgrade my compiler to VC++ 7.1 from VC 6.0 I get compilation error on fstream related operation.
With 6.0 I was using include fstream.h, while with VC++ 7.1 I am using fstream as fstream.h is no longer supported with 7.1.
Sample Code:
filebuf *pFb = Fb.open ("abc", ios::out, filebuf::sh_write);
Error:
sh_write is not a member of 'std::basic_filebuf<_Elem,_Traits>'
Regards
Devendra
|
|
|
|
|
Hi
I am looking for a nice http server (serving atleast GET, POST,HEAD) and http client requesting the same methods.. (I think apache is huge for my requirement)
Any pointers will be very helpful.
rgds
|
|
|
|
|
|
please help me to draw a pie chart based on some values which my program generates.now i am able to draw charts using mschart control.but i want to export it to an html file without using the CDC GetDC method.please advice me the best approach that i should follow.
|
|
|
|
|
|
Im using borZoi to implement ECC in my project Ive uncluded all the header files and other things according to its manual but when i call its functions i get undeclared function errors.
I call
use_NIST_B_163 ();
and get error
e:\vc\myprojects\project\malloc1\dsprojdlg.cpp(212) : error C2065: 'use_NIST_B_163' : undeclared identifier
|
|
|
|
|
Have you included the headers file directory into your settings (include path)?
And the library?? Is it linked/added into the Link tab > Object library modules?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I don't know anything about that library, but the manual says you must define USE_MPI. Did you define it?
Are you sure dsprojdlg.cpp has an include for borzoi.h and nist_curves.h?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
// DSProjDlg.cpp : implementation file
//
#include "borzoi.h"
#include "nist_curves.h"
#include "stdafx.h"
#include "DSProj.h"
#include "NewDlg.h"
#include "SignDlg.h"
#include "DSProjDlg.h"
Yup Ive included the files
and Ive included the USE_MPI in Project->settings->C/C++
->prepocessor->preprocessor definitions
Is it OK?
|
|
|
|
|
titi@yahoo.com wrote:
Is it OK?
No. Since you are most likely using precompiled headers through stdafx.h, the compiler ignores anything before the include for stdafx.h.
Move the includes for borzoi.h and nist_curves.h below the include for stdafx.h and try again.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I like the babylon dictionary.
The only reason is because its ease of use.
Ctrl-right click on ANY word, and it shows you the dict entry.
There's a firefox extension that you can right click on a word and select from the context menu -> query to -> dictionary.com but it's no way as convenient as babylon. And it only works on firefox.
In the past I have created a simple dictionary app that use some dictionary database in the public domain.
I know a lot of students would benefit if there is such a free / open source app.
But I have no idea how Babylon did that (capture a word on ANY app on Ctrl-right click, even bitmap).
This is what I tried : I wrote a autoit script sometime ago.
Basically what I did is to program a hot key so that when it is triggered the script will:
double click where the pointer is
Ctrl-C
[autoit api] find windows handle that match my dict app
[autoit api] change focus to my dict app
Ctrl-V
<enter>
It works 75% of the time, but for some timing issues and whatnot, the 25% failure rate still frustrate the user to no end.
I think most macro/scripting solution won't cut it.
BTW, if Babylon have a built-in OCR, it'll be quite complicated to implement. And i'm not aiming that high.
How about text only apps? (one that you can use mouse to select and ctrl-c / ctrl-insert).
Is there any c/c++ glue code that can use the win32 api to achieve that?
If any win32 guru can give me pointers to the relevant doc / url / reference, that will be great.
OTOH, maybe such a open source dictionary exists, but so far I'm not aware of one yet.
|
|
|
|
|
Hi,
I am upgrading VC compiler on a windows machine from version 6.0 to 7.1
after upgrading when I tried to compile my application and got this error
\\Vc7\atlmfc\include\atlalloc.h(218) : error C2629: unexpected 'class ATL::CTempBuffer ('
I was able to compile code on 6.0 version
Please tell me reason and solution for this problem.
I got only one related link on net but it was in Hungarian.
http://www.netacademia.net/blogspace/petert/archives/2005_06.html
Regards... Ankur
|
|
|
|
|
template< typename T, int t_nFixedBytes = 128, class Allocator = CCRTAllocator >
class CTempBuffer
{
public:
CTempBuffer() throw() :
m_p( NULL )
{
}
CTempBuffer( size_t nElements ) throw( ... ) : <--- This is the line
m_p( NULL )
{
Allocate( nElements );
}
~CTempBuffer() throw()
{
if( m_p != reinterpret_cast< T* >( m_abFixedBuffer ) )
{
FreeHeap();
}
}
There were huge changes in ATL/MFC between VC6 ( which is basically crap for C++ ) and 2002. Babel fish doesn't translate hungarian, perhaps another site does ? Can you remove parts of your code to figure out which bit is causing the error ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am getting this error whenever "atlalloc.h" is included directly or indirectly in my cpp file.
Please tell me how to fix this
Regards... Ankur
|
|
|
|
|
If I include atlalloc.h, it blows up as well. Do you need it ? It looks to me like it doubles up some stuff, actually.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Respected all
Regards!
i used the following code.
----------------------------------------------------------
pFile=fopen("C:\\filename.dat","r");
and my "filename.dat" is in the follwing form.
----------------------------
sfsd
sdfgsfg
dsfgsfg
sgsfg
X Y Z Indix
12 33 45 3335
12 34 45 2323
12 34 34 3434
---------------------------------------------------
and there are several file like the above but in different total no, of lines.
so how i can find out the total no, lines in a file.like in above but remember
that the file may be n different size.
waiting for + response.
david
|
|
|
|
|
Are you using C++ or C ? fopen is C. ifstreams are C++. In C++, reading a file with an ifstream, you can use the getline function to read a line at a time, and of course, you can keep count as you do so.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all
how to place a animated icon on the caption bar, similar what we see in Internet Explorer.
if any one has any idea, please share it with me.
thanks and regards
pradish
|
|
|
|