|
minkowski wrote: 0xC0000005: Access Violation
Someone, somewhere is trying to dereference a NULL-Pointer.
You need to find the place where. Set breakpoint in your program, and when you found one before the crash use step execution to wherever the crash occurs.
The find out what is going on and fix it.
Sorry, but I can't help you more without knowing what is happening in your program.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Simply running your application under the debugger should help, it will tell you where the access violation is.
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
Ok thank you! I will try that !
|
|
|
|
|
Hi, All
I want to change some text of Menu item on runtime.
i had changed submenu text, now i want to change text of menu, ect: File, View, Edit
Please, adv me.
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
I had solved.
CMenu *pMenu = GetMenu();
// Change main menu
pMenu->ModifyMenu(0, MF_BYPOSITION | MF_STRING, 0, _T("New Item 1"));
pMenu->ModifyMenu(1, MF_BYPOSITION | MF_STRING, 1, _T("New Item 2"));
pMenu->ModifyMenu(2, MF_BYPOSITION | MF_STRING, 2, _T("New Item 3"));
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
hi all,
when i'm returning a value from a try block of function, control is jumping in to
catch block.
thanks in advance.
Regards,
Prashanth
-- modified at 5:32 Monday 23rd October, 2006
|
|
|
|
|
voorugonda prashanth wrote: returning a value from a try block of function, control is jumping in to catch block.
Being not a prophete, I can only speculate that you are live-experincing the chatching of an exception.
Otherwise, show some (reduced!) source.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Try a "Rebuild all". It might help.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi
I have a class that I use for logging events in my applications, which are normally left running all day and year. The class generates txt files of the name :
app_name(YYYY_MM_DD).txt
and is designed to delete files that are a month old eg todays date is the 20/10/2006, so it will delete the 20/09/2006.
Occasionally the program may not be running for a few days. In this case the class does not delete the files that were generated a month ago - i.e. if the app was not running yesterday (the 19th), the log generated on 19/09/2006 would not be deleted.
Is there a simple way round this?
Can you use wild cards some how - for instance delete all files from 09/2006 at the start of 11/2006?
Thansk for any advice
69 Bay
|
|
|
|
|
If you are using MFC, just calculate the difference using COleDateTimeSpan . If GetTotalDays() returns 30 or more for any file encountered, delete it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David
I am using MFC - how do I get a list of all the files that are currently in a folder? I assume I would have to do this, and then go through each file and do as you suggest.
Thanks for helping
69 Bay
|
|
|
|
|
Hi all,
I would like to know if there is a way to programmatically obtain the path to any user's any special folder?
Here I do not mean "All users" profile but really for any user that has his/her profile created on the machine.
For example, I can get what I need with the "SHGetSpecialFolderPath" function, but only for the current user. I need to do the same thing but for any arbitrary user.
If this task can not be achieved with SHGetSpecialFolderPath function or any other API function, is there maybe some workaround (like manually reading specific registry keys and values)?
Thanks in advance.
Bila
|
|
|
|
|
Bila1 wrote: For example, I can get what I need with the "SHGetSpecialFolderPath" function, but only for the current user.
Use SHGetFolderPath() instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for your reply.
I have already tried this function, but I do not know how to use it to get what I need. I guess that the "hToken" parameter is the answer. Problem is, I do not know the process to create such a token (access token).
Could you help me further with this issue please?
Bila
|
|
|
|
|
Bila1 wrote: I guess that the "hToken" parameter is the answer. Problem is, I do not know the process to create such a token (access token).
You can use LogonUser() to retrieve the token.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks, this sure helps.
Now, one more twist: is there any other way I can do what I need -without- requiring the user's password?
|
|
|
|
|
You may read them under HKEY_USERS, but it is not suggested. Some keys are not created until the special folder path is requested by the user, and you may not have the permission to read these entries.
Regards
Microsoft MVP in Visual C++
www.jiangsheng.net
|
|
|
|
|
Hi,
I already tried this approach but no success. Reason is that there are no keys in HKEY_USERS hive for any other users beside the current user and some system users (NETWORK SERVICE, LOCAL SERVICE if I remember correctly).
If the problem is really with access permissions, is there a way to obtain them so I can read this hive? Maybe some workaround?
Or for that reason, any other way at all to find out a special folder for any other user (I specifically need the startup folder)?
Thanks.
Bila
-- modified at 3:56 Tuesday 24th October, 2006
|
|
|
|
|
Bila1 wrote: ...is there any other way I can do what I need -without- requiring the user's password?
Yes, but it's a bit more involved. You'll need to iterate through the folders in the following registry key:
HKEY_USERS\xxxx\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
You'll need to loop through the users to find the right one (SID).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I already implemented this approach, but it does not give satisfying results (please see my reply to Jiang Sheng above).
Any other suggestion?
|
|
|
|
|
Hi all,
I see that C++ is still powerful although managed C++ is out and Microsoft is trying very hard so that every programmer will want to move to managed C++ or C#.
I have try following Microsoft .NET framework (C#) but it grows too fast so that I always lose track of it, and it has new programming paradigms, terms and concepts such as GAC, CASPOL and so on. Who can exactly tell me those concepts are not going to change in the next version of Microsoft .NET Framework? Or a new concept is out and what we programmer do is often learn and learn again.
Is there anybody knows the real future of managed C++? Can we really program API (direct access to API) in windows vista? So we can avoid those always growing concepts (and oftenly even the language can grow such as template c#, hmm i forget what it calls).
I want to avoid those growing concepts and learn what a real programmer should learn, such as algorithm, data structure, rendering, and so on. Is there any C++ library that is as powerful as .NET, such as easily making control dockable, and easily making connection and use the framework provided by it and so I can focus learning API?
I have heard Corba but dunno what it is. Is there anybody knows?
|
|
|
|
|
Sora Innosia wrote: Is there anybody knows the real future of managed C++?
It seems to be the glue to wrap old, tested code in an assembly to be used by .NET-programsn and to make the new, .NET-coded stuff accessible for old-school code (in the way of a bridge-dll).
Sora Innosia wrote: I have heard Corba but dunno what it is. Is there anybody knows?
Something like COM/DCOM. But totally different.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Sora Innosia wrote: I see that C++ is still powerful although managed C++ is out and Microsoft is trying very hard so that every programmer will want to move to managed C++ or C#.
Unmanaged C++ isn't going anywhere. There is so much C/C++ code written for applications out there already, and even more being written in it everyday (that either cannot or will not be written with managed code). Managed C++, VB.Net, C#, etc. can be used anywhere you would use Java. That is, there are some application domains where these languages will thrive (largely due to the type or programmers that are in those domains, but also to the requirements for applications there). C/C++ will always be used when there is a need for efficiency and control (e.g. low-level OS, game engines, embedded systems).
Sora Innosia wrote: I have try following Microsoft .NET framework (C#) but it grows too fast so that I always lose track of it, and it has new programming paradigms, terms and concepts such as GAC, CASPOL and so on. Who can exactly tell me those concepts are not going to change in the next version of Microsoft .NET Framework? Or a new concept is out and what we programmer do is often learn and learn again.
Learn standard C++ first, and then you won't worry about all the new "technologies" (which really are just renaming old techniques with new languages).
Sora Innosia wrote: Is there anybody knows the real future of managed C++?
Only time will tell. IMHO, it will be restricted to application GUIs for the most part.
Sora Innosia wrote: I want to avoid those growing concepts and learn what a real programmer should learn, such as algorithm, data structure, rendering, and so on.
Again, start learning standard C++. The .Net world is far less "scary" once you know the fundamentals behind it.
Sora Innosia wrote: I have heard Corba but dunno what it is.
If you have ever heard of DCOM, Corba is the open-source competitor for it. It is very ugly to write (just as DCOM is), and is not something you should jump into when you are just beginning.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi Zac
so the conclusion is c++ is some how worth to learn?
where should i start? I know a bit about writing form using pure c++ and API (which uses a lot of lines, struct, and so on), or should i learn MFC better?
i dun really have a clue to be a good programmer (i mean low level and really understand things). for some reason when i see people know how exactly a video file is contructed and they can even modify it using code, but i know only how to make database appliction from vb6 or .net, i thing i am quite curious to understand deeply low level thingies. is there any good site for my programming interest?
[Quote]
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week[/Quote]
so where should i sign up to?
thanks a lot
|
|
|
|
|
For a beginner, it is good to start with an introduction to C++ book. I can't really give you a recommendation on a good one since its been years since I read any, and I'm sure there are much better ones now than there were when I first learned C++. You might try to check out the local college and see what books their introduction courses use.
Once you get the basics down, Bjarne's book is a good reference, "Effective C++" and "Effective STL" by Scott Meyers are both excellent, as is "Exceptional C++" by Herb Sutter. To get into detailed programming areas (game engines, graphics, etc.) I would start with every book I could find on the subject (Barnes and Nobel is a good resource) that interests you after reading the forementioned books.
There are so many different facets to programming that there isn't just 1 site to find everything you might possibly be interested in. Are there certain niches that you find yourself interested in?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|