|
TurboNext wrote: The problem is the filepointer is not moving...
If you want the file to be appended to, you must call SetFilePointer() after opening it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Maybe try
...
hFile=CreateFile(g_szLogFileName,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
}
if(hFile!=INVALID_HANDLE_VALUE)
{
SetFilePointer(hFile, 0L, 0L, FILE_END);
WriteFile(hFile,csT2,csT2.GetLength(),&dwT1,NULL);
|
|
|
|
|
Thank you guys, It works now. I used SetFilePointer() and its working not. Thanks a lot.
|
|
|
|
|
Hi
I'm working in a simple mail encryption system with random generated passwords.
What I would like is to make some kind of encoding to the password in order to allow the user to share the password via phone.
I tried replacing every char in the pass by its hexa ascii code, but the resulting number is too long, I'm using 32 chars keys.
Any ideas on how could I solve this problem?
Thanks a lot
|
|
|
|
|
Kharfax wrote: What I would like is to make some kind of encoding to the password in order to allow the user to share the password via phone.
You must be a very paranoid individual !!
on a more serious note :
I'm not certain exactly what you really want to do ? you want to encrypt the password a second time to be able to give it more securly ? and send them another key to decrypt that first key ?
me think that you could make your password longer and/or use a better encrytion algo. in your software to validate that license key.
|
|
|
|
|
noooooooo, I'm not paranoid, I use PGP with 1024 bit keys just to be 133t
I just needed something to make easier to the user the task of sharing passwords via phone.
Lets supose the pass is "a&RT2"/(=fbTR16bJ" is really hard to say all that by phone, the idea is to transform that in something like "LU8C-RA7Z-12MVR-97YB" thats a lot easier to tell.
I already found the answer to my problems, and is called Base32.
Thanks a lot for the feedback anyway Maximilien
|
|
|
|
|
|
Hey thanks a lot for the links
|
|
|
|
|
Has anybody experienced any problems after building a release on vista and running it on XP?
I like all my projects to be backward compatible with win98, but my latest build ( on vista ) refuses to even run on XP, giving me a "This is not a valid exe" error.
Before I go pulling my code apart line by line ( which is already full of error checking ) would anybody like to advice me of some of the common problems of backwards compatibility and where I should look first.
|
|
|
|
|
Not me, I've never heard of a "this is not a valid exe" error. That sounds like something the loader would show, which makes me suspect that the file got corrupted.
|
|
|
|
|
I'm beginning to suspect the error is valid. The file has not been corrupted, I copy from the vista machine to the XP machine via a USB pen, and I have done this quite a few times. I have also put a few MessageBox alerts in error prone places, but none of them are being triggered.
You'll have to forgive my translation of the error, the XP machine is a Chinese version, and Chinese isn't exactly my first language. But thats more or less what it say's.
|
|
|
|
|
hi
this is a common error that occurs in XP.
It occurs sometimes when u run exes from the Explorer in XP.
try it in command prompt or just restart.
thx Slipnit
|
|
|
|
|
If you are seeing that happen so often that you consider it a "common error", I would guess that you either are either dealing with some really f-ed up software, or something is seriously wrong with your system!
I have only seen that problem with trunated copies/downloads. Never on a complete, valid executable (unless it was a 32-bit vs. 64-bit problem).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
maybe theres something wrong with my XP.
but i do get it.
maybe i should inform this error msg to Microsoft.
thx Slipnit
|
|
|
|
|
This is not a 64-bit vs. 32-bit problem, is it?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: This is not a 64-bit vs. 32-bit problem, is it?
Unfortunatly not. Other from the basic 64-bit compatibility checks, all builds and OS's are 32-bit.
|
|
|
|
|
The problem could lie in the manifest that's being baked into the .exe. I just dragged myself through 48 sleepless hours trying to debug a problem with an app that ran fine on my development machine but wouldn't start on other XP boxes. (The error was mine).
/ravi
|
|
|
|
|
Good to know that a broken manifest file (for a native C++ app) can cause exe not valid errors. I never would have guessed that...!
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I would have to agree. The manifest has been part of VS2005 for quite some time and is not related to vista. It's something most of us know about, and know how to deal with, yet it would not produce these errors.
|
|
|
|
|
More correctly, the problem was caused by SxS, which was introduced in XP.
/ravi
|
|
|
|
|
|
Hello
Please help me, I want to make an application that deletes all files
from the folder in wich my application is, but one wich's name
I give in the command line.
Are there some functions in Visual C++ for getting all files in a folder?
Thanks
snoopy
|
|
|
|
|
snoopy_321 wrote: Are there some functions in Visual C++ for getting all files in a folder?
See the FindFirstFile() /FindNextFile() pair.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: See the FindFirstFile()/FindNextFile() pair.
Don't forget to use FindClose() after you done with searching. I had a bad expeirence of forgetting of same. which may causes crashes and locking file system resources...
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Thanks, I think they will work.
bye...
|
|
|
|