 |

|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
Does it have any constraint in MFC, because the same code works fine when I run on win32 console. Will be grateful.
|
|
|
|

|
SetWindowsHookEx [^] is a Windows API . Calling it (correctly) in a MFC application or in a Win32 console application is the same.
Veni, vidi, vici.
|
|
|
|

|
What error code do you get?
|
|
|
|
|

|
If we create the ribbon project in VS 2008 update SP1. statically we are in inserting the item in tree control but i want to insert it in run time plz let me know how can i do?
|
|
|
|

|
Use the TVM_INSERTITEM message.
See CTreeCtrl::InsertItem
Within you lies the power for good - Use it!
|
|
|
|

|
Hello every one. i want to show an image in every place of screen with MFC. for example i want to load an arrow picture near windows clock or near start menu or in every place in its original shape and not in the dialog or form. Please help me or give me a good link for this action.
Thanks.
|
|
|
|

|
You could use a borderless popup window. You could even use window regions to have the window in the shape you want.
Within you lies the power for good - Use it!
|
|
|
|

|
Thanks for your answer.if it's possible for you please more explain.
imagin you want to draw a line on Specified window.recently i used this codes to draw a line on my application's dialog:
CClientDc mydc(this);
mydc.MoveTo(5, 20);
mydc.LineTo(80,20);
but this codes draw a line in my application's dialog. Who can i draw a line in every window that i want?
|
|
|
|
|

|
How to send a keystroke or a mouse event to another running process in Ubuntu? I want to write a C program that reads data from the USB port sent by AVR Micro Controller board continuously.In response to that it checks the data received and sends a command to another process running on the computer? Example,when the program reads 101 from the USB port it sends left mouse button down to the VLC media player window that is currently running? Can anybody explain the whole process in detail?? I would be very thankful...
|
|
|
|

|
What's wrong in Google[^]?
Veni, vidi, vici.
|
|
|
|

|
I have no idea on the mouse manipulation stuff, but you can read stuff from the AVR board if it is visible as COM Port .
Where is your problem exactly?
Do you have a problem reading the data from the AVR board, or getting the mouse to move?
I will never again mention that Dalek Dave was the poster of the One Millionth Lounge Post, nor that it was complete drivel.
How to ask a question
|
|
|
|

|
hello every body
i try to develop a client and a server project by visual studio 2010!
now i have alot of question
1- how can i test the connection between client and server???
2- how my server could have a list of connected clients???
please help me i am a beginner!!!
|
|
|
|

|
To test your programs start them both on your machine and use the loopback device (IP: 127.0.0.1, name: localhost) for listening and connection.
If a server accepts and handles multiple connections at the same time the state of each connection is typically stored in some manner. This must be implemented by you and the information to be stored depends on your requirements. If you need a list of clients, one piece of information to be stored is the client IP.
I suggest to start with a server that accepts only one client at time. Then you can test the communication and implement multiple client support when the other things are working.
|
|
|
|

|
In addition to what Jochen has mentioned, I would look at WireShark which is a tool to view network communications. I have found it invaluble for debugging network type applications, though I think client and server have to be on different machines (I could be wrong on that one) for Wireshark to record the data.
|
|
|
|

|
Wireshark is a must have for network programming
...I do remember some issue with seeing the loopback data, but I can't remember it 100%... think you get spoiled having a bunch of computers sitting on your desk at all times.
|
|
|
|

|
Myself I doubt a beginner with no experience in sockets is going to get much use out of wireshark.
|
|
|
|

|
I don't know, I started using it almost immediately, while debugging my first network type application.
|
|
|
|

|
Member 10757148 wrote: 1- how can i test the connection between client and server???
Write TWO applications.
One does only client.
One does only server.
For testing you can there run each individually in TWO instances of VS 2010. (You can run from the command line as well but you will probably want to use the debugger in VS.)
Member 10757148 wrote: 2- how my server could have a list of connected clients???
You should try reading up a bit on sockets. Much of it won't make sense but it will give you some more basics on 'how' a server handles multiple clients.
That said I would STRONGLY suggest that you first start with only a single client.
|
|
|
|

|
I downloaded a project from codeproject that makes multiple selection posibible on a CTreeCtrl. The link is: [^]
The downloaded project works fine, I mean it works to select multiple lines with the Ctrl key.
I created a project on my own, taking from the downloaded project just CCustomTreeCtrl files, because I need just CCustomTreeCtrl. So, my problem is that it does not work to select multiple lines in the tree control in my project, but in the downloaded project it does. How can this be? I cannot figure it out. I checked and double checked to see if there's any notable difference, and I can't see any.
|
|
|
|

|
At first glance, that article seems to be more geared towards rubber banding a selection. While Ctrl+Click may work, too, there may be extra code there that is messing you up. Perhaps you could use Paul DiLascia'c code from here, or a related article (alas with more features) from here.
"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
|
|
|
|

|
Thanks for your reply and for the provided links.
|
|
|
|

|
I tried the code from the second link. It behaves the same as the code from Syed Babu from codeproject. If I select multiple items using Ctrl and left mouse button it selects JUST THE LAST 2 previously selected items; the first item selected in a row of three is always deselected. I don't get it, I have the same code as the original code. There's something strange here.
|
|
|
|

|
The code looks fine actually. Can you elaborate the problem you are facing in this code?
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?
|
|
|
|
 |