|
Sure that will be great. My email address is:
mohsinmunawar [at] gmail [dot] com
|
|
|
|
|
Dear all:
I implement a application, when I log in windows, the application will auto
start, and write registry in HKEY_CURRENT_USER,
SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run.
The context of registry is a wav file path.
I put the wav file and the application in the same folder.
My code show as below:
HKEY hKey = HKEY_CURRENT_USER;
TCHAR filePath[MAX_PATH];
TCHAR dirPath[MAX_PATH];
GetCurrentDirectory(MAX_PATH, dirPath);
StringTruncate(filePath, dirPath, "\\Default.wav");
WriteReg(hKey, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion"), _T("Sound"), filePath);
My question is:
when I log in windows, the registry value always equal to C:\Windows\system32\Default.wav, Not my folder path.
How can I write the right wav file path after windows log in?
Thanks for your help, Victor.
|
|
|
|
|
Did you check that writing to the registry was successful?
|
|
|
|
|
Dear Jochen:
I use the same code, but different condition.
condition 1: windows run stable, it write the registry success with my folder.
condition 2: after log in windows, it write the C:\Windows\system32 path.
Thanks for your help, Victor.
|
|
|
|
|
What is the value of filePath at the time of writing? Hint: it's not what you think it is.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Dear David:
I know the filePath equal to C:\Windows\system32.
The value of registry which I write is different between log in windows and run windows stable.
How can I write the same value in log in windows?
|
|
|
|
|
cedricvictor wrote: I know the filePath equal to C:\Windows\system32. So then why continue to use it?
cedricvictor wrote: The value of registry which I write is different between log in windows and run windows stable. Which has nothing to do with anything.
cedricvictor wrote: How can I write the same value in log in windows? Why not just use:
TCHAR filePath[MAX_PATH] = _T("C:\\abc\\123\\Default.wav");
WriteReg(hKey, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), _T("Sound"), filePath);
All that said, I suspect you are wanting to use ::GetModuleFileName(NULL, ...) instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It is right, Firstly, you should use ::GetModuleFileName(NULL, ...) to get the path of your application image,
and then, get what you want by this path.
If you set the path as const value, it's not convenient!
|
|
|
|
|
I'm not sure why you replied to me with this (as opposed to cedricvictor), but thanks for the affirmation.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Sorry, I just agree with your opinions, so I can't help myself to reply you.
|
|
|
|
|
Hi, is CMap object can be copied to another CMap oject?
I can't find a member function in CMap class.
And if I want to implement deep copy, do I need to loop it , copy every element to another manually?
|
|
|
|
|
Why not try it and see what the result is?
|
|
|
|
|
As far as I know, CMap has not such a facility. On the other hand, the std::map[^]...
Veni, vidi, vici.
|
|
|
|
|
Hi guys
I have OS of the WB150F camera. you can download it here:
https://www.mediafire.com/?jmshouy4c937yw3
I have several question about it:
1- What do these files do?
MakeAv, MakeAvf, sde6 and all files in the "Tools" folder
2- What is the usage of the "brcz.h" file (in this address: \ip\include)?
3- What is the diffrence between the files of "av" folder and "avf" folder in os folder?
|
|
|
|
|
Does this have something to do with C++?
|
|
|
|
|
|
That sums it up pretty much - The line method executed before is
void Writer::DoWrite(QString auditEntry){
QByteArray ba = auditEntry.toLatin1();
char* aestr = ba.data();
std::string aestdstr(aestr);
log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT");
LOG4CXX_INFO(logger, aestdstr);}
I did the search work - Yes, aestdstr is terminated with '\0'. I'm running out of ideas here. The detailed error message is called
Quote: A buffer overrun has occurred in app.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.
For more details please see Help topic 'How to debug Buffer Overrun Issues'.
Fun fact is that no one has ever seen the help topic 'How to debug Buffer Overrun Issues' (here[^]).
Any thoughts on the issue?
|
|
|
|
|
Looking at the documentation for LOG4CXX_INFO [^], I wonder if you should use the char* as the second parameter, like:
char* aestr = ba.data();
log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT");
LOG4CXX_INFO(logger, aestr);
}
|
|
|
|
|
Thank you kindly for the suggestion, but oddly a missing [static] library on which log4cxx was dependent went missing.
Don't ask me why the Linker didn't complain but the debugger decided to throw a buffer overrun
A ghost from the past. Known to others as "Linda".
|
|
|
|
|
This is probably where the buffer overrun was detected, not where it actually occurred. In general it is not possible (or prohibitively expensive) to detect the actual corruption. Try using the Page Heap[^], although this often falls in the prohibitively expensive category. Remember to disable it when you're done!
WARNING: DO NOT ENABLE THE PAGE HEAP FOR ALL PROCESSES, JUST THE ONE YOU'RE DEBUGGING. YOU HAVE BEEN WARNED!
Steve
|
|
|
|
|
Hi,
Is it possible to create a view (In MFC MDI app)without document as follows?
CMultiDocTemplate* pDocTemplate = new CMultiDocTemplate(IDR_CheckTYPE,
NULL,
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CCheckView));
I mean, passing NULL for the document runtimeclass and use pDocTemplate->CreateNewFrame().
Thanks,
Prasanth
|
|
|
|
|
Why you do not want to use the CDocument?
I'd rather be phishing!
|
|
|
|
|
What happens when you try it?
|
|
|
|
|
Yes, I do it all the time.
- basically, the "View" will not be attached to the derived object class of (CDocument).
- the attached derived (CDocument) object is intended to update the View when the derived object changes.
|
|
|
|
|