|
|
|
Heh. I don't know what to tell you. Try google search on same text.
I usually post links to save myself typing....I can see that failed here...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
already tried google and the msdn library isnt opening
|
|
|
|
|
if you use Visual Studio, go to the Help index and type
"static members" and choose data members.
That's how I found the link.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm writing a program that can read out an C-file.
This is done line by line,
firt I open the file, then I read in every line of the file.
All these lines are putted in an Array,
now I have to search this array for functions, like "main", "void" etc.
So my question is,
How kan I search an array?
greetings,
Timo
|
|
|
|
|
That depends a lot of how you defined your array. A snippet of code would be usefull.
To search for a string into a larger string, you can use the strstr function[^]
|
|
|
|
|
Here's a couple of lines out of the code:
while ( fgets ( line, sizeof line, file ) != NULL )<br />
{<br />
rn++;
itoa(rn,regelnummer,10);
strcpy(alles[i], line);
i++;
strcpy(alles[i], regelnummer);
i++;
}<br />
fclose (file); <br />
}
........................................................
first the line out of a file is putted in the array,
after this the line number..
then the next line.. next line number etc..
|
|
|
|
|
So now all you have to do is go back through the alles array and look at all of the "even" lines. Use the strstr() function as has been mentioned.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What kind of array is that? Is it one dimensional like char sFile[SIZE] or two dimensional like char sLine[MAXLINES][MAXCHARS] ?
- NS -
|
|
|
|
|
i can compile and bulid my pgm sucusfully..
But when i run my pgm it says, "can't exectute" :
and when i press F5 it says, "..path\\release\mypgmname.exe not found"
y it happnes.. is there any anthing i can do to make it run??
|
|
|
|
|
suganforu wrote: and when i press F5 it says, "..path\\release\mypgmname.exe not found"
Does it actually exist?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
suganforu wrote: But when i run my pgm it says, "can't exectute" :
How are you executing it ? And what is the exact error message ?
suganforu wrote: and when i press F5 it says, "..path\\release\mypgmname.exe not found"
What kind of project is it ? A dll ? Or a plain executable ? Again, what is the exact message (with the correct path) ?
|
|
|
|
|
Use "Rebuild All..." in the menu and confirm if asked. Then use another time the "run" button.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
the error it shows .... " my file path\\Release\\mypgmname.exe" file not found....
i haven't used "Release file" in my pgm .. is there anything i could change in "project settings" ..? ?
|
|
|
|
|
when i rebulid all the follwing error happens....
" fatal error C1083: Cannot open precompiled header file: 'Release/acs.pch': No such file or directory"
same error in all my ".cpp" files..
|
|
|
|
|
By the way, if it displays two '\' then it means that you did something wrong in the configuration. For the path in the configuration, you should only supply one '\' (you will never have escape sequences in a path).
That is probably your problem.
|
|
|
|
|
@Cédric Moonen
noo that wasn't the problem...
|
|
|
|
|
suganforu wrote: noo that wasn't the problem...
what path did you set (because it still shouldn't show \\ anywhere in a path) ?
|
|
|
|
|
Hi,
one third party DLL that I'm using to configurate and test the connection to a plc is writing some datas into the registry in HKEY_LOCAL_MACHINE\SOFTWARE\FOLDER_1\Folder2\Device0
I want to code the deletion of FOLDER_1, Folder2, Device0 and all the values that are at the end of the path, but only when they exists. I have though using this code (Windows XP, VC++ 6.0 ), but before calling any code about the registry I want to be sure that it is not dangerous for the registry itselfs (it's my first try).
BOOL bDeleted = FALSE;
CRegKey rkMyRegKey;
if (rkMyRegKey.Open (HKEY_LOCAL_MACHINE, "SOFTWARE\\FOLDER_1") == ERROR_SUCCESS)
{ if (rkMyRegKey.RecurseDeleteKey ("SOFTWARE\\FOLDER_1") == ERROR_SUCCESS)
{ rkMyRegKey.Close ();
return MY_MSG_OK;
}
rkMyRegKey.Close ();
}
return MY_MSG_ERROR;
would it work?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
If you are that unsure, why not create a few dummy keys and values, and work on deleting those instead?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
To delete those keys is not a problem (im deleting them manually to check another things, like configuration through a *.ini), the dll will always create them, every time I run it.
My problem is that I prefer not to play with the registry just making "dummy" tries and errors, and less in a computer that is not mine.
what I am unsure about is if my code is dangerous for the registry or not.
Because of that I have asked if the code would make a safelly deletion.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: what I am unsure about is if my code is dangerous for the registry or not.
Because of that I have asked if the code would make a safelly deletion.
Try it and see.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No errors by compiling but either no results, it opens but doesn't deletes. Any tip?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Have you stepped through the code to see which method is failing? Why have you not tried:
if (rkMyRegKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE") == ERROR_SUCCESS)
{
if (rkMyRegKey.RecurseDeleteKey("FOLDER_1") == ERROR_SUCCESS)
...
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|