16,016,760 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Michael Melkonian (Top 12 by date)
Michael Melkonian
7-Apr-11 1:14am
View
I agree. Tony needs to explain a bit more - lets see what the real situation is - I am curious :)
Michael Melkonian
6-Apr-11 23:38pm
View
I think you misunderstand the devices you are describing, SA. They take serial data packets from a serial port, encapsulate them in an UDP/TCP/IP packet(typically TCP) and send it to another similar device via Ethernet/Internet. The receiver strips the packet off TCP/IP header, and shoves the raw data into the serial line of device #2. To the end devices the communications looks exactly the same as if the two were connected via RS485, or RS232 or TTL or whatever, they don't even know they are connected through Ethernet/Internet.
What Tony wants is totally different.
Michael Melkonian
6-Apr-11 21:56pm
View
Ahh, the CRecordView. I had some trouble with OnRecordNext and OnRecordPrev too, so in one project I had to do my own handlers for the move buttons. It only had 6-8 lines and I think replicates the default framework-generated ones. Let me know if you the code I can dig it out.
Probably too much trouble if you only have (a smallish) problem with losing focus.
Have you tried handling First Last Next and Prev toolbar buttons in CMainFrame instead? Find the CRecordView and call View's handler? That way, the buttons should always be enabled.
Michael Melkonian
6-Apr-11 21:41pm
View
This is quite an unusual setup. You would expect data proprietary protocol (e.g. over RS485) to be encapsulated in TCP/IP, not the other way around.
In addition, RS485 is a multidrop party line type arrangement, and not common for use with 2 stations only.
The key question is : what is carried inside the TCP packets?
Do the two devices establish a TCP connection and send some prorietary application data through it?
Michael Melkonian
5-Apr-11 20:34pm
View
Well it is going to look heavy either way I think - you are, in effect, you are overriding what framework does when it sets the focus. To be honest, I am struggling to see why would you ever want to do that - much easier to just ignore the input even if the focus is set - if thats what your application requires.
Michael Melkonian
5-Apr-11 20:21pm
View
Thanks for all answers I will try a few over the weekend - cheers, this was very useful
Michael Melkonian
4-Apr-11 21:50pm
View
Thanks for that. As I said I am looking for something generic and NOT integrated with MS .Net.
Line of code metrics can be very useful in some circumstances. No one is suggesting this as a motivational tool. Anyhow, I did not intend this question as a discussion on s/w project management.
Michael Melkonian
4-Apr-11 21:09pm
View
Is this the only view that you have?
I am guessing there is another view that you want to keep the focus at. If not, ignore the rest of my comment.
In which case, you could handle WM_KILLFOCUS in another view before it loses focus and immediately re-establish it (and hence prevent the CYourView view from getting focus).
Or even something along the lines of:
((CMainFrame*)GetParentFrame())->SetActiveView(this);
Michael Melkonian
10-Mar-11 19:15pm
View
Ok, may be you can understand piece of code that I have just posted. It would help to single step through it and look at values as I don't want to argue about basic stuff all day.
Michael Melkonian
10-Mar-11 19:03pm
View
Deleted
You misunderstand pointers. See below - this is text book stuff, you might want to re-read relevant parts of K&R (like the ones that talk about pointers, references and addresses).
double some_data[] =
{
0.0,
0.1,
0.2
};
void setAngleCorrect (double **angle)
{
*angle = &some_data[0];
}
void setAngleIncorrect (double *angle)
{
angle = &some_data[0];
}
void CPictureNameDlg::OnBnClickedButton3()
{
double *angle1;
setAngleCorrect(&angle1);
ASSERT (angle1 == some_data);
double *angle2;
setAngleIncorrect(angle2); // this is an error
ASSERT (angle2 == some_data); // this will assert
}
Michael Melkonian
9-Mar-11 23:17pm
View
I was under impression that he wants setAngle to return a pointer to a double, not a double value. For a value the answer is of course trivial (like you said).
Michael Melkonian
9-Mar-11 22:55pm
View
Meant to be setAngle, not doStuff in main.
e.g.
void main()
{
double *angle;
setAngle(..., &angle); // pointer is now initialized...
}
Show More