|
I think we'll never know what he was talking about.
|
|
|
|
|
ced',
off topic but, did you receive my mail ?
(sorry if i am a bit insistant about that, but i'm desperate about it[^], and i'm sure you could be of any useful help )
|
|
|
|
|
Err, no, I didn't get your mail.
But I answered to your question. I'm not sure at all if this is the correct answer though...
|
|
|
|
|
thank you.
i answered consequently.
i'd be glad to share this with you...
(actually, you'd save me my nerves ! lol)
|
|
|
|
|
Yes Dear ,
It is a linker error.
|
|
|
|
|
Then you got a linker problem...
Sorry but if you don't give more information, it's the only answer I can give. What is the exact error message ? And give as much relevant info as possible.
|
|
|
|
|
1. DON'T SHOUT
2. explain clearly what you wnat to do
3. explain clearly what problem(s) you encounter
4. ask for specific questions, instead of hoping someone will do the job for you...
|
|
|
|
|
whenever i compile my code it gets compiled without error.
but when i build it's EXE it gives me external linker error.
please help
|
|
|
|
|
jai_sendme wrote: but when i build it's EXE it gives me external linker error.
please help
We're not mind readers. What's the error?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
:(I have an MDI application and once i open two or more child windows/views at a time, then the data are not updated and are not affecting on the child windows.
Could any one help me out?
-- modified at 7:55 Friday 14th April, 2006
|
|
|
|
|
To refresh the views use
CDocument::UpdateAllView(NULL)
that force an update of the CView
and then use CView::OnUpdate
to initialize the view assuming that the document is changed so everything(variables) must be reloaded from the document.
Elseway, a simple way is to study the constructor of the CView, probally you are not considering that the first CView has an initialization that you forgot in the other Views.
Have a nice code day
|
|
|
|
|
thanks
|
|
|
|
|
Hi,
i written a console application from VC++, program is to generate a binary tree.
program will take a directory as a input and generate a binary tree of words..
problem is if i give a small directory with 5 to 10 files program generates the binary tree properly if i select a big folder it gives below error can anyone help with this..???
=====================================================
This instruction at "0X77f8910e" referenced memory at "0xc7c7cf0".The memory could not be "read".
Click OK to terminate the program
Click on cancel to debug the program
OK CANCEL
=======================================================
Regards,
Parichay.
|
|
|
|
|
You may have to check those size indicators / holders in your code as array boundary or something.
Maxwell Chen
|
|
|
|
|
Hi ,
Thanks for the reply.
Can u plz check my code and tell me where the error is and why it is getting generated..?//
/// Program to Generate Binary Tree of multiple files and multiple words.
#include <iostream.h>
#include <stdio.h>
#include <assert.h>
#include <io.h>
#include <direct.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXWORD 100
struct tnode *addtree(struct tnode *,char *);
void treeprint(struct tnode *);
#define length (80)
struct tnode
{
char *word;
struct tnode *left;
struct tnode *right;
};
struct tnode *root1 = NULL;
struct tnode *talloc(void)
{
return (struct tnode *) malloc(sizeof(struct tnode));
}
char *strdup(char *s)
{
char *p;
p=(char *) malloc(strlen(s)+1);
if(p!=NULL)
strcpy(p,s);
return p;
}
//addtree add a node with w at or below p
struct tnode *addtree(struct tnode *p,char *w)
{
int cond;
if(p==NULL)
{
p=talloc();
p->word=strdup(w);
p->left=p->right=NULL;
}
else
if((cond=strcmp(w,p->word)) == 0) ;
else
if(cond < 0)
p->left=addtree(p->left,w);
else
p->right=addtree(p->right,w);
return p;
}
// treeprint : in order
void treeprint(struct tnode *p)
{
if(p!=NULL)
{
treeprint(p->left);
printf("%s\n",p->word);
treeprint(p->right);
}
}
void ListWords (char *);
#define MAX_LEN 100
int main ()
{
char dir[] = "D://Parichay/";
ListWords(dir);
printf("\n\n\t\t Binary Tree :- Each Node Contains 1 word.\n\n");
treeprint(root1);
return 0;
}
/////////Function to list words//////
void ListWords (char *dir)
{
struct _finddata_t file_s;
long File_handle;
char name[MAX_LEN], words[length];
int j,size;
_chdir(dir);
if( (File_handle = _findfirst( "*", &file_s )) == -1L )
{
printf( "No files in current directory!\n" );
}
else
if (file_s.attrib & _A_NORMAL)
{
sprintf (name, "%s",dir);
//root = addtree (root, name);
////////////////
FILE *fp;
fp = fopen(name, "r");
if(fp == NULL)
{
printf("\n\n Message from _A_NORMAL.");
printf("\n\nERROR: could not open file");
exit(EXIT_FAILURE);
}
else
while (fscanf(fp, "%s", &words)!= -1) //while not the end of the file
{
size = strlen(words); /*determines length of each string */
for(j = 0; j<size; j++)="" *begins="" iteration="" of="" each="" string="" looking="" for="" non-alpha="" characters="" then="" it="" lower="" cases="" all="" *=""
="" {
="" if="" (words[j]="='.'" ||="" words[j]="=','" j++;="" *removes="" non="" alpha-characters="" strlwr(words);="" printf("%c",="" words[j]);="" *prints="" to="" screen="" words=""
="" root1="addtree" (root1,="" words);
="" }
="" fclose(fp);
="" }="" else="" do="" (strcmp="" (file_s.name,="" ".")="=" 0="" strcmp="" "..")="=" 0)
="" continue;
="" (strlen="" (dir)="" +="" strlen="" (file_s.name)="" 2=""> sizeof (name))
{
fprintf (stderr, "Dir name too long\n");
return;
}
if (file_s.attrib & _A_SUBDIR)
{
sprintf (name, "%s/%s",dir, file_s.name);
ListWords(name);
}
else
{
sprintf (name, "%s/%s",dir ,file_s.name);
//printf ("%s\n",name);
////////////////
FILE *fp;
fp = fopen(name, "r");
if(fp == NULL)
{
printf("\n\n Message from _A_SUBDIR");
printf("\nERROR: could not open file.\n\n");
exit(EXIT_FAILURE);
}
else
while (fscanf(fp, "%s", &words)!= -1) //while not the end of the file
{
size = strlen(words); /*determines length of each string */
for(j = 0; j
|
|
|
|
|
As you've seen, "<" and ">" are gone. Would you just send me the cpp file to (sautiller @ yahoo . com)? I will check your code.
Maxwell Chen
|
|
|
|
|
edit your message and check the Ignore HTML tags in this message (good for code snippets) so that < and > aren't considered as html tags.
|
|
|
|
|
Hi V2,
i have sent again hope u get the solution.
/// Program to Generate Binary Tree of multiple files and multiple words.
#include <iostream.h>
#include <stdio.h>
#include <assert.h>
#include <io.h>
#include <direct.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXWORD 100
struct tnode *addtree(struct tnode *,char *);
void treeprint(struct tnode *);
#define length (80)
struct tnode
{
char *word;
struct tnode *left;
struct tnode *right;
};
struct tnode *root1 = NULL;
struct tnode *talloc(void)
{
return (struct tnode *) malloc(sizeof(struct tnode));
}
char *strdup(char *s)
{
char *p;
p=(char *) malloc(strlen(s)+1);
if(p!=NULL)
strcpy(p,s);
return p;
}
//addtree add a node with w at or below p
struct tnode *addtree(struct tnode *p,char *w)
{
int cond;
if(p==NULL)
{
p=talloc();
p->word=strdup(w);
p->left=p->right=NULL;
}
else
if((cond=strcmp(w,p->word)) == 0) ;
else
if(cond < 0)
p->left=addtree(p->left,w);
else
p->right=addtree(p->right,w);
return p;
}
// treeprint : in order
void treeprint(struct tnode *p)
{
if(p!=NULL)
{
treeprint(p->left);
printf("%s\n",p->word);
treeprint(p->right);
}
}
void ListWords (char *);
#define MAX_LEN 100
int main ()
{
char dir[] = "D://Paruichay//";
ListWords(dir);
printf("\n\n\t\t Binary Tree :- Each Node Contains 1 word.\n\n");
treeprint(root1);
return 0;
}
/////////Function to list words//////
void ListWords (char *dir)
{
struct _finddata_t file_s;
long File_handle;
char name[MAX_LEN], words[length];
int j,size;
_chdir(dir);
if( (File_handle = _findfirst( "*", &file_s )) == -1L )
{
printf( "No files in current directory!\n" );
}
else
if (file_s.attrib & _A_NORMAL)
{
sprintf (name, "%s",dir);
//root = addtree (root, name);
////////////////
FILE *fp;
fp = fopen(name, "r");
if(fp == NULL)
{
printf("\n\n Message from _A_NORMAL.");
printf("\n\nERROR: could not open file");
exit(EXIT_FAILURE);
}
else
while (fscanf(fp, "%s", &words)!= -1) //while not the end of the file
{
size = strlen(words); /*determines length of each string */
for(j = 0; j<size; j++) /*begins iteration of each string looking for non-alpha characters then it lower cases all */
{
if (words[j]=='.' || words[j]==',' || words[j]==';' || words[j]==':' || words[j]=='?')
j++; /*removes non alpha-characters */
strlwr(words); /* lower cases */
//printf("%c", words[j]); /*prints to screen words */
root1 = addtree (root1, words);
}
}
fclose(fp);
////////////////
}
else
{
do {
if (strcmp (file_s.name, ".") == 0 || strcmp (file_s.name, "..") == 0)
continue;
if (strlen (dir) + strlen (file_s.name) + 2 > sizeof (name))
{
fprintf (stderr, "Dir name too long\n");
return;
}
if (file_s.attrib & _A_SUBDIR)
{
sprintf (name, "%s/%s",dir, file_s.name);
ListWords(name);
}
else
{
sprintf (name, "%s/%s",dir ,file_s.name);
//printf ("%s\n",name);
////////////////
FILE *fp;
fp = fopen(name, "r");
if(fp == NULL)
{
printf("\n\n Message from _A_SUBDIR");
printf("\nERROR: could not open file.\n\n");
exit(EXIT_FAILURE);
}
else
while (fscanf(fp, "%s", &words)!= -1) //while not the end of the file
{
size = strlen(words); /*determines length of each string */
for(j = 0; j<size; j++) // begins iteration of each string
//looking for non-alpha characters then it lower cases all */
{
if (words[j]=='.' || words[j]==',' || words[j]==';' ||
words[j]==':' || words[j]=='?')
j++; /*removes non alpha-characters */
strlwr(words); /* lower cases */
// printf("%c", words[j]); /*prints to screen words */
root1 = addtree (root1, words);
}
}
fclose(fp);
}
} while (_findnext (File_handle, &file_s) == 0);
}
}
|
|
|
|
|
Did you try to press the cancel button to see where it crashes ?
It is VERY helpfull for us to know where (man, I don't want to go through all this code to find the problem)
|
|
|
|
|
i get the error message soon after run (Ctrl + F5 )
it does not produce any output
|
|
|
|
|
Start your debugger and tell us exactly at which line of code it crashes (press F5 instead of Ctrl + F5).
* me *
|
|
|
|
|
hope this will help u.
after F5
Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
First-chance exception in OnlyWords.exe (NTDLL.DLL): 0xC0000005: Access Violation.
The thread 0x258 has exited with code -1073741510 (0xC000013A).
The program 'D:\Parichay\OnlyWords\Debug\OnlyWords.exe' has exited with code -1073741510 (0xC000013A).
|
|
|
|
|
You are kiding aren't you ?? I simply ask you to tell us where the debugger stops when it crashes. At which line of code in your program excactly (there is a yellow arrow next to your code) ?
I think your eally need to learn a little bit to work with your debugger. I cannot imagine my life without one . No seriously, try to play a little bit with your debugger to see how to use it. It will be a very good friend that will help you in many many situations.
|
|
|
|
|
77F8910E cmp dword ptr [edx+14h],0
after F5 arrow stopes here ....
i have just started learning VC++ so i have very less idea abt Debuggers..
|
|
|
|
|
Ok, so it is not directly in your code probably.
Now, put a breakpoint at the very begining of your program (by going on the line and pressing F9). Then ,put several breakpoints in relevant points in your program. Each time you press F5, the programm will advance to the next bbreakpoint. And there, you can watch to your variables and things like that. Try to play with it and understand how it works, it is really usefull and it will really help you a lot !
|
|
|
|
|