|
Since you don't know in advance the length of string required for storing the image version, the API requires you to first determine the length using:
DWORD length;
GetImageVersion(NULL, &length);
Then you can allocate the buffer required for storing the image version,
TCHAR* imageVersion = new TCHAR[length];
GetImageVersion(imageVersion, &length);
-Saurabh
|
|
|
|
|
|
You are welcome.
-Saurabh
|
|
|
|
|
I tried out this code. The problem is that for example I input "Book" to the file so it displays 4characters of the ASCII '1'.
If I enter a three letter word it displays that character three times?
Here is the code.
#include<stdio.h>
#include<conio.h>
#include<windows.h>
char d;
main()
{
{
FILE *ft;
ft=fopen("test.txt","w");
char ch;
while(ch=getche())
{
if (ch=='\r')
break;
putc(ch,ft);}
fclose(ft);
}
system("cls");
printf("Read?");
d=getch();
system("cls");
if(d=='y')
goto read;
read:{
FILE *fp;
fp=fopen("test.txt","r+");
char chr;
while(chr=fgetc(fp)!=EOF)
printf("%d",chr);
fclose(fp);
}
}
|
|
|
|
|
Razanust wrote: char d;
Why make this global?
Razanust wrote: main()
{
{
Why the extra open/close braces?
Razanust wrote: char ch;
while(ch=getche())
Do you know that getche() returns an int ?
Razanust wrote: if(d=='y')
goto read;
read:{
And if d is not equal to 'y' , control still goes to the read label.
Razanust wrote: fp=fopen("test.txt","r+");
No need to open the file for writing.
Razanust wrote: while(chr=fgetc(fp)!=EOF)
While it's syntactically correct, you are missing an important pair of parenthesis.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
beside html file, what other files IE can display if without extra software (not inclued in default windows installation) support?
for example, IE can display php file, but it needs php software supports.
|
|
|
|
|
hta, xml, ico, png(kinda), gif, jpg, svg, txt(based files), vrml (i forget)
And many others I don't recall this minute.
|
|
|
|
|
What do you mean it can display php file? PHP files are text files and IE can dispaly *any* text file.
-Saurabh
|
|
|
|
|
PHP, like ASP and JS, usually runs on a web server. It takes special files/filters to translate the script to HTML to send back to the client's browser. In essence, IE is not displaying PHP files.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes I know that and that is why I asked OP what he means by IE can display PHP files.
-Saurabh
|
|
|
|
|
I remember someone said "do not ask why when people ask for why".
Now I tell you why, when I upload html to UNIX server, file size of html file is changed, so I want to use a similar html file, whose size will not be changed in upload/download process.
Is it interested for you?
Do you have more why to ask?
.
|
|
|
|
|
You didnt answered my question. My question was what do you mean by IE can display PHP files. Check again its not why but what. Because PHP is just a text file and IE can display any text file.
What file formats are supported in IE has nothing to do with change in file during upload and download. If file size if changing during upload and download then it is most likely because you are sending files in ASCII mode. You need to use binary mode for data transfer. Just like I said in other thread.
-Saurabh
|
|
|
|
|
This post is C++ related .
I am trying auto-update software, it is a harder job than C++ itself.
One info I used for detecting file changes is file-size.
Unfortunately, when I upload/download files between Windows and UNIX, file size has been changed by ftp tool (FileZilla) or flatforms - not sure who did it.
So far, file-size-changes only happened on html files, file-size-differences may be up to 2 bytes.
I am wondering why file-size has been changed? if - only if - the file is an exe, it may not work again after upload/download.
Can you explain why?
Thanks
|
|
|
|
|
includeh10 wrote: So far, file-size-changes only happened on html files, file-size-differences may be up to 2 bytes.
Have you used a file-comparer tool to see what those differences are?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
both ftp tool and windows file-manager show the difference.
|
|
|
|
|
When exchanging files between Windows & Linux , for instance, FTP should be in binary mode, since in text mode, newlines are translated according to the platform.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi CPallini,
I redo the test, you are correct, the more \r\n the file has, the more size is reduced.
I did the test by a txt file, if I change file extension of the txt file to any others, i.e. kbc, file-size is not changed.
wonderful.
|
|
|
|
|
You should not rely on file extension. Instead use binary mode to transfer files.
-Saurabh
|
|
|
|
|
Needed that Visual studio pause the application and tells me a message when an infinite number or a NAN is generated so I can debug and remove the causes.
Any flag available on the solution's properties?
Thanks
Russell
|
|
|
|
|
You can put a breakpoint and set the breakpoint condition as something that check the value. Then start debug run. VS will break the execution once the condition is met.
Btw, I don't think that there is a specific condition check like NAN or infinite (in C/C++). But you can check the range of value depending on the variable type.
For example,
long n can be checked something like ( (unsigned long) n > 0x7FFFFFFF ).
- ns ami -
modified on Tuesday, September 29, 2009 11:19 PM
|
|
|
|
|
In that cases I think it is possible to use functions like isnan() and isinf().
Other test like you wrote probably will fail because you can't use standard math in that cases.
But the problem is that I have to find when and where the problem happens to set some addictional line to let the algorithm be safer. So I can't check every single line with breakpoints (only the lines of the algorithm that I'm testing are more than 10000 and on different files).
It is surely needed an help from the debugger, it have to check for us and open a dialog like happens for ASSERTs so we can work.
It looks strange that there isn't any option that can be set into the debugger...
Russell
|
|
|
|
|
Russell' wrote: only the lines of the algorithm that I'm testing are more than 10000 and on different files
Sounds like a very complicated algorithm!
Russell' wrote: It looks strange that there isn't any option that can be set into the debugger
Well if the program doesn't signal anything on these errors how is the debugger supposed to recognise it, apart from checking the results of every instruction in the program. Consider how long that may take to run.
|
|
|
|
|
It doesn't matter how long it will take: this is simply an advanced-debug step, the release version will not contain this big amount of addictional operation.
... and without this help we surely will lost more and more time going to check all the code
Also because this algorithm works for some set of data, but dont' works for other sets (probably because for some reasons the numbers becames too small).
Russell
|
|
|
|
|
Nishad S wrote: long n can be checked something like ( n > 0x7FFFFFFF ).
How? If you add 1 to that value, it becomes negative, thus failing the test.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Yes. I have updated my reply.
((unsigned long) n > 0x7FFFFFFF)
- ns ami -
|
|
|
|