|
includeh10 wrote: This struct and many others have been redefined for many times by many programmers, people have their own reasons to redefine them, I suggest you do not tell them what you said as quoted sentence.
Once again you seem to be losing the plot here. If you have a problem with your code then show what you have tried, explain the problem, including any error messages, and people will try to help you. But don't start being abusive just because you don't get the answer you think is due to you.
|
|
|
|
|
Richard MacCutchan wrote: Once again you seem to be losing the plot here. If you have a problem with your code then show what you have tried, explain the problem, including any error messages, and people will try to help you. But don't start being abusive just because you don't get the answer you think is due to you.
You lost point for who is first "start ..."
Is my post clear? is any replies of the post clear?
|
|
|
|
|
includeh10 wrote: Is my post clear?
No it is not clear, which is why I suggested that you explain what you are trying to do and what is not working.
|
|
|
|
|
His replies were very clear while most of your posts fall into the belligerent a**hole category. If you'd learn to ask a reasonable question and display a few manners, you might do a lot better.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
Tim Craig wrote: ...while most of your posts fall into the belligerent a**hole category.
While he does display that characteristic on occasion, this time he is just asking outright senseless questions. The term "chasing rabbits" comes to mind.
"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
|
|
|
|
|
I beleave the ruler in any forum:
"answer question if you can, or leave it."
|
|
|
|
|
includeh10 wrote: answer question if you can, or leave it.
A number of people are trying to answer your question, but first they need to understand what the problem is. That is why they have asked for more information.
|
|
|
|
|
Richard MacCutchan wrote: Once again you seem to be losing the plot here. If you have a problem with your code then show what you have tried, explain the problem, including any error messages
Is "plot here" only "any error messages"?
I s my post a C++ question?
|
|
|
|
|
includeh10 wrote: Is "plot here" only "any error messages"?
I apologise if that statement is not clear, it is a common English expression, which means that we are arguing about the wrong things. Let's get back to your question and find out what it is that you are having trouble with.
includeh10 wrote: I s my post a C++ question?
That is what we are trying to find out.
|
|
|
|
|
Try to find any replies related to the topic you posted then create your personal policies for public.
|
|
|
|
|
includeh10 wrote: Try to find any replies related to the topic you posted then create your personal policies for public.
I have no idea what this is supposed to mean.
Do you have a programming problem or not?
|
|
|
|
|
Richard, your patience is awesome.
|
|
|
|
|
Hans Dietrich wrote: Richard, your patience is awesome.
Thanks, but I've seen you do the same! I'm actually trying to follow Chris's rules that a) we help people and b) we don't make them feel stupid. But with some of our questioners it really is a challenge.
|
|
|
|
|
includeh10 wrote: how do you get a feeling of "wrong way"?
He is a clever guy.
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]
|
|
|
|
|
First: You cannot undef a typdef.
Second: Can you give us an real example (not just struct declaration) where you have a problem; give as much information as possible.
Third: Let's work together and try to find a solution to your problem.
Fourth: I have some errands to take care of, will be back in a couple of hours.
---------
According to you, there's an issue with the OSVERSIONINFOEX structure (and maybe their variants ...A and ...W)
Can you give us an example on how you use them ? actual code that use that structure and please highlight sections where you think there's a an error in either you code, MSDN documantation and MSDN usage of said stucture.
If it's a compilation error, please report the errors given by the compiler (and what compiler/ide you are using).
If it's a runtime error, please report the call stack and the input values that could be generating that error.
Please, we are not mind readers, and you do not give us much meat to even start giving you a good answer.
Have a good one,
M. (will be back in a couple of hours)
This signature was proudly tested on animals.
|
|
|
|
|
Hi,
includeh10 wrote: typedef struct _ABC
{
//....
}ABC;
how to undef ABC here?
The Short answer is: Cannot be Done! To ask the question in the first place shows a lack of understanding on how the various pieces of the jigsaw are fitted together when you build an application. This is a vast subject, which cannot be adequately covered in this answer. However, the following is a short answer.
The Headerfiles in general do not contain code. They contain information required by the compiler, (akin to a User Manual for a library) to build modules in such a manner that the entre project can successfully link with the libraries. If you want to upgrade the horsepower of your car, you do not do so by changing the User Manual, but by changing the Engine.
So, an 'untypedef' does not exist, because it cannot serve any usefull purpose.
<blockquote class="FQ"><div class="FQA">includeh10 wrote:</div>this is for correcting/updating VC lib errors.</blockquote>
Hmm...
Well, if you must...
There is no point in changing Header Files, or 'untypedeffing' anything You must Rewrite the Libraries, using exactly the same names throughout, (The best way of doing that is using the existing header files), and save the result in your Windows/System Folder, replacing the Old and Faulty VC libraries.
Success with your Repairs/Upgrades.
Bram van Kampen
|
|
|
|
|
I wrote the code below to copy a picture,and why it will fail if i change the mode of fdest to "ab"?
"ab" means write and add to file,isn't it?what's the difference?
#include<stdlib.h>
#include<stdio.h>
#define MAX 1024
int
main(int argc,int **argv){
FILE *fsource,*fdest;
size_t in;
int buf[MAX];
fsource = fopen("F:\\a.jpg.rar","rb");
fdest = fopen("D:\\a.jpg","wb");
if(fsource == NULL || fdest == NULL)
perror("open error");
while((in = fread(buf,sizeof(int),MAX,fsource)) != 0){
fwrite(buf,sizeof(int),in,fdest);
fflush(fdest);
}
fclose(fsource);
fclose(fdest);
return EXIT_SUCCESS;
}
modified on Saturday, October 17, 2009 5:49 AM
|
|
|
|
|
What do you mean by "it will fail"? The file is not readable? The function itself fails to execute?
Does the file exist while you are using the ab mode? In which case, the contents will simply be appended, and this might render the file unusable.
Dengjin_CN wrote: what's the difference?
You could refer to the table here[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
thanks for your reply.
"it fails" means the file was created but was empty.I realized that the file d:\\a.jpg doesn't exist there before the program runs,now i created it then execute the program,it successed.
however,i can't understand my book says "a" will create a file when the file doesn't exist,campare with "w", why it produces different result?
|
|
|
|
|
I just tried your program and it works correctly in both cases. If you use the specification "wb" then it will always create a new file. If you use "ab" it will do the same, except if the file already exists then it will add to the existing file. For example if you write 100 bytes with "wb" your file will always be 100 bytes long. But if you write 100 with "wb" and then another 100 with "ab" it will be 200 bytes long.
|
|
|
|
|
wb = open new binary file for writing, if file exists with same name, it will be truncated to 0 bytes
ab = open new binary file for writing, if file exists with same name, new data would be written at end of file. This may lead to undesired results if file already exists.
you should check if a file exists before opening it in wb mode :
#include<stdlib.h>
#include<stdio.h>
#define MAX 1024
int main(int argc,int **argv){
FILE *fsource,*fdest;
size_t in;
int buf[MAX];
char c = 'n';
fsource = fopen("F:\\a.jpg.rar","rb");
fdest = fopen("D:\\a.jpg","r");
if(fdest!=NULL){
fclose(fdest);
printf("Destination file already exists, do you want to overwrite?\t");
scanf("%c",&c);
if(c!='Y' && c!='y'){
fclose(fSource);
return 1;
}
}
fdest = fopen("D:\\a.jpg","wb");
if(fsource == NULL || fdest == NULL)
perror("open error");
while((in = fread(buf,sizeof(int),MAX,fsource)) != 0){
fwrite(buf,sizeof(int),in,fdest);
fflush(fdest);
}
fclose(fsource);
fclose(fdest);
return EXIT_SUCCESS;
}
|
|
|
|
|
while(IsCapture)
{
pcap_loop(adhandle, 1, packet_handler, NULL);//call this function
}
void CIPv6_packet_analyzerView::packet_handler(u_char* param, const struct pcap_pkthdr* header, const u_char* pkt_data)
{
//================definition
}
error when compile:
error C3867: 'CIPv6_packet_analyzerView::packet_handler': function call missing argument list; use '&CIPv6_packet_analyzerView::packet_handler' to create a pointer to member
what's wrong? this program can run in vc6.0
use '&CIPv6_packet_analyzerView::packet_handler' to create a pointer to member
while(IsCapture)
{
pcap_loop(adhandle, 1, &CIPv6_packet_analyzerView::packet_handler, NULL);
}
error when compile: :error C2664: 'pcap_loop' : cannot convert parameter 3 from 'void (__thiscall CIPv6_packet_analyzerView::* )(u_char *,const pcap_pkthdr *,const u_char *)' to 'pcap_handler'
Thank you very much
|
|
|
|
|
the VC6 installation error happended several times when I install it:
Setup was unable to create a DCOM user account in order to register "c:\Program Files\Microsoft\Visual Studio\Common\Tools\VS-Ent98\Vanalyzr\Valec.exe"
At last of installation process, setup said: failed.
But VC6 still can be used .
BTW: When try to update VC6 with service pack, service pack setup says: Can not find any VC products.
What is the problem? how to fix it?
|
|
|
|
|
|
google it. The answer is the first result.
|
|
|
|