|
I never found it especially useful. By the time it arrived I had disciplined myself when I created code that I didn't see failures to deallocate anymore.
I did find that attempting to refactor code (others) that did have problems was at best a futile exorcize but maybe I never understood it in detail enough.
|
|
|
|
|
|
In general it may indeed be better to create it on the stack. The reason you'd use new is when you want more control over it's lifetime. For example you can't use the stack if it need to stay "alive" after the function returns (more generally, when it goes out of scope).
Steve
|
|
|
|
|
In Embedded programming working with Win c, can we develop Win c applications in visual studio, for that any special licence required.
|
|
|
|
|
I develop Win CE program using VS2005,but need SDK from hardware vendor.
then my program can run on it's hardware platform.
|
|
|
|
|
ok thank you for your reply, can u tell me if i am using visual studio 2008 or 2010 is there any necessity of SDK in these versions also, please help me.
|
|
|
|
|
I think you need to ask the hardware vendor. for example, if you use ARM CPU, and I assume you develop WinCE based program, then, either hardware vendor create a SDK for you, or you can create a SDK for yourself with PlatForm Builder.
PlatForm Builder is a software from Microsoft.
|
|
|
|
|
Visual studio 12 will allow you to compile direct to Windows RT on an ARM processor which can be useful.
Personally however I cheat I usually write a UI interface that emulates the the embedded target on the PC or I have an old version of WINE which I have doctored and call Darkside which provides all the basic API interface of windows but runs a very simple concept of a device context and no multitasking.
It sort of weird I often have a linux thread kernel pushing into a faked version of Windows UI .... seems all wrong if you think about it.
The trick with all these techniques it to have a clear idea of interfaces on your embedded project so you can do the emulations. You can't just start random coding and hot and hope planning is everything.
|
|
|
|
|
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?
|
|
|
|
|
|
it works fine for some time on MFC. I get a feeling that it gets unhooked from the OS for some reason after approx 10 notifications
|
|
|
|
|
Post some code. Not reams of code if you expect an answer, a minimal program that shows your problem. I concede that at times this is easier said than done.
Steve
|
|
|
|
|
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?
|
|
|
|
|
You really can't do that in MFC or at least not using any MFC commands because the windows you are trying to draw on don't belong to MFC
You can use WIN32 API commands to draw on the desktop like this
HDC hDC_Desktop = GetDC(0);
RECT rect = { 0, 0, 200, 200 };
HBRUSH blueBrush=CreateSolidBrush(RGB(0,0,255));
FillRect(hDC_Desktop, &rect, blueBrush);
Your drawing wont stay there very long or be refreshed however
To make anything permanent on the desktop you need to subclass the desktop handler and it's paint message and that requires a lot more knowledge.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773183%28v=vs.85%29.aspx[^]
I suspect you are going to tell us more about what you are trying to do.
|
|
|
|
|
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.
|
|
|
|