|
|
Ok I know I can get an EditBox to respond to a double click message by providing a function in a derived CEdit class.
But what I really want is for my Dialog class to know when the edit box recieves a double click message like it does when the ON_EN_CHANGE message is sent, but so far I'm un sure of how to do this.
Any assistance would be great, thanks.
class CMyEdit : public CEdit
{
public:
CMyEdit(){};
//{{AFX_VIRTUAL(CMyEdit)
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CMyEdit)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
};
BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
//{{AFX_MSG_MAP(CMyEdit)
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CMyEdit::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CEdit::OnLButtonDblClk(nFlags, point);
}
class CMyPage : public CDialog
{
public:
CParticle2Page(CWnd* pParent = NULL); // standard constructor
virtual ~CParticle2Page();
enum { IDD = IDD_PARTICLE2DLG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnEnChangeMyEdit();
afx_msg void OnDBClickedMyEdit();
CMyEdit m_MyEdit;
}
CMyPage::CMyPage(CWnd* pParent /*=NULL*/)
: CDialog(CMyPage::IDD, pParent)
{
}
void CMyPage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_MY_EDIT, m_MyEdit);
}
BEGIN_MESSAGE_MAP(CMyPage, CDialog)
ON_EN_CHANGE(IDC_MY_EDIT, OnEnChangeMyEdit)
ON_WM_LBUTTONDBLCLK(IDC_MY_EDIT, OnDBClickedMyEdit)
END_MESSAGE_MAP()
void CMyPage::OnEnChangeMyEdit()
{
int a = 10;
}
void CMyPage::OnDBClickedMyEdit()
{
int a = 10;
}
|
|
|
|
|
i download the divx 5.1.1 from the divx.com web site.
it has only the decode,but i want the encode.
who can tell me where to get?
or i must to write the encode of myself.
if i DIY,
how i do?
thx!!
hxr601
|
|
|
|
|
Download virtuaDub.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have this program, and I need to find the difference between the start time and end time. My code:
<br />
#include <iostream.h><br />
#include <iomanip.h><br />
<br />
class StopWatch<br />
{<br />
public:<br />
StopWatch(float hour, float minute, float second);<br />
StopWatch();<br />
void difference(StopWatch start_time, StopWatch end_time);<br />
int get_hour();<br />
int get_minute();<br />
int get_second();<br />
int reg_time();<br />
int mil_time();<br />
private:<br />
int hour, minute, second;<br />
<br />
};<br />
<br />
void main()<br />
{<br />
int start_time, end_time;<br />
char chr;<br />
int difference;<br />
cout << "This program is a stop watch program. It will store time in hours, minutes, and seconds" << endl;<br />
do<br />
{<br />
StopWatch start_time, end_time, mil_time, reg_time;<br />
cout << "Enter Start Time" << endl;<br />
start_time.get_hour();<br />
start_time.get_minute();<br />
start_time.get_second();<br />
<br />
cout << "Enter End Time" << endl;<br />
end_time.get_hour();<br />
end_time.get_minute();<br />
end_time.get_second();<br />
<br />
cout << "In Military Time" << endl;<br />
cout << " Start Time Entered: ";<br />
start_time.mil_time();<br />
cout << " End Time Entered: ";<br />
end_time.mil_time();<br />
<br />
cout << "In Regular Time" << endl;<br />
cout << " Start Time: ";<br />
start_time.reg_time();<br />
cout << " End Time: ";<br />
end_time.reg_time();<br />
<br />
difference(start_time, end_time);<br />
cout << "Do you wish to enter another time(Y/N)?" << endl;<br />
cin >> chr;<br />
if(chr != 'N' && chr != 'n' && chr != 'Y' && chr != 'y')<br />
{<br />
cout << "Enter Y or N" << endl;<br />
}<br />
}while (chr == 'Y' || chr == 'y');<br />
<br />
<br />
} <br />
<br />
StopWatch::StopWatch(float hours, float minutes, float seconds)<br />
{<br />
hour = hours;<br />
minute = minutes;<br />
second = seconds;<br />
}<br />
<br />
StopWatch::StopWatch() : hour(0), minute(0), second(0)<br />
{<br />
}<br />
<br />
int StopWatch::get_hour()<br />
{<br />
cout << " Hour: ";<br />
cin >> hour;<br />
return hour;<br />
}<br />
<br />
int StopWatch::get_minute()<br />
{<br />
cout << " Minute: ";<br />
cin >> minute;<br />
return minute;<br />
}<br />
<br />
int StopWatch::get_second()<br />
{<br />
cout << " Second: ";<br />
cin >> second;<br />
return second;<br />
}<br />
<br />
int StopWatch::reg_time()<br />
{<br />
<br />
cout << setfill('0') << setw (2) << hour << ":" << setw (2) << minute << ":" << setw(2) << second;<br />
if(hour < 12)<br />
cout << " AM";<br />
else<br />
cout << " PM";<br />
cout << endl;<br />
<br />
return 0;<br />
}<br />
<br />
int StopWatch::mil_time()<br />
{<br />
cout << setfill('0') << setw (2) << hour << ":" << setw (2) << minute << ":" << setw(2) << second << endl;<br />
return 0;<br />
}<br />
<br />
void difference(StopWatch start_time, StopWatch end_time)<br />
{<br />
cout << "difference = " << start_time.get_hour() - end_time.get_hour() << " hours, " << start_time.get_minute() - end_time.get_minute() << " minutes, " << start_time.get_second() - end_time.get_second() << " seconds" << endl;<br />
<br />
}<br />
It is the last function I need help with... well calling it anyways. I'm just not sure how to do it.
|
|
|
|
|
You would do better for your difference function to return a value that is validly in 0-60 minutes and seconds every time. You would also do better to return the time as a structure that you define, and providing an operator << for it, so that it can then be sent to cout. This class is not very useful or reuseable. I know it's you're homework, but still, best learn good principles now.
And that includes not asking broad homework questions. I presume the trouble is that you're getting gaps with negatives in them ? Just think about what it is you need to do to work around that, it's not hard.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
if the user enters 25 and more or the user enters -ve values for hours,the program will not prompt any error message
and to find the difference, write a function where all the hours ,minutes and sec are compared with 59 mins , 59 secs convert to next hours
and think ur logic
bye
thennati
|
|
|
|
|
how can I make a simple assembly compiler so it would use basic functionality and actually compile the code, maybe a website or tutorial
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
Try NetWise ASM (NASM) ...
Maxwell Chen
|
|
|
|
|
Hello,
I have inherited a GUI application that I am required to modify. One of the modifications that I have already implemented consists of capturing a serial data stream, doing some processing on it, and then writing it out to a file.
The serial data is captured in a separate reader thread that signals the main dialog window when serial data is ready to be processed. This all works fine. The serial data stream consists of many voltage and temperature measurements collected from an attached A/D converter box. I parse the A/D data and keep track of the latest temperature and voltage measurements for all 22 channels that we are sampling.
I would like to modify the main GUI display to also show the latest values of some if not all of the 22 channels that we are monitoring. In the simplest implementation, I could have a list down one side of a form that shows:
Variable 1: 22.876 Volts
Variable 2: 76.988 Degrees
.
.
.
Variable 22: 23.988 Volts
To the right of each of these text labels I would like to have a small "window" where I could write the most recent value received for each of the data channels, be it tempearture or voltage. This way, the operator could see all the current data value on a single screen.
The problem is that I have been looking through the Toolbox and there doesn't appear to be any sort of "box" structure that could be used for this purpose. Maybe I'm just missing it. Could someone please point me in the right direction. Perhaps there is a sample project that someone has done that would allow for a new tool like this?
A second question revolves around going one step further. Since I am collecting this data over time, it would be nice to show the user say the last 10 minutes of data for any given variable in a "graph window", for lack of a better term. Does anyone have any links to a "graph tool" that I could use that might enable me to display my collected data in a graphical format in addition to the text display I mentioned earlier?
Thanks,
Robert
|
|
|
|
|
ummmmm i assume ur talking about a c++ app...
the "box" thingy u mention is either a static control or an edit control ... i would do the static myself
the graphing thingy ... look here on cp ... there are lots of 2d graphing controls that would suit ur needs exactly i think
"there is no spoon" biz stuff about me
|
|
|
|
|
are you able to get the sys or cpu temperature?
/\ |_ E X E GG
|
|
|
|
|
I am not sure if I am putting this in the right place, but you guys are really smart about eMbedded visual C++ too right? Anyways I am new to the embedded visual c++ world. I have a large chunk of code that is supposed to work!!. But when trying to compile it I recieve Build : warning : could not create output directory 'D:\Visual\PCS\ARMDbg' . I can't see anything in the code that wants to write to the D drive. Is this something in the compiler. I am using Embedded Visual C++ 3.0. Can someone at lease point me in the right direction.
Thank alot,
Rodneyk1
|
|
|
|
|
Your settings obviously include something to set the output directory. Is this using Visual Studio ? Get the project settings up and check where it's trying to build to.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
also make sure ur not running the app in the debugger while recompiling it
"there is no spoon" biz stuff about me
|
|
|
|
|
Is there an API that will tell me if the display is in 640 x 480 mode?
thanks
|
|
|
|
|
GetSystemMetrics (SM_CXSCREEN), and GetSystemMetrics (SM_CYSCREEN)
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have a sample for a third party SDK which is in C, and I'm converting it to C++ as I put it into a COM component. Whenever my code hits a line that actually calls functions within the SDK, it throws an exception. I am linking to the same lib files that my SDK sample ( which works fine ) links to, and I'm starting to go nuts. What could be causing this ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Could there be some calling convention mismatch? Check if you need to define something in order to let the preprocessor expand a __stdcall or __cdecl (or whatever) in the header file that matches what the lib files were compiled with.
If that's not the error, I'm as stumped as you are on this one. Let me know if you solve it! (Could happen to me as well in the future)
--
Meine Welt ist monoton und minimal, doch ganz total!
|
|
|
|
|
Thanks for the suggestion - I don't know much about this stuff, where would I look, and what am I looking for ? My new project is an ATL one and defines WIN32,_DEBUG,_WINDOWS,_USRDLL, the old one defines the first three. Both use cdecl * calling convention according to the project settings.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Look in the header files for the 3rd party library. See if you can find prototypes that matches these patterns:
returntype SOMEMACRO function(typen arg1, ..., typen argn); Then see what SOMEMACRO is defined as. If the definition depends on SOMEMACRO on some other #define it may very well be the calling conventions that's killing your function calls.
It's a long shot...
--
Meine Welt ist monoton und minimal, doch ganz total!
|
|
|
|
|
hello.
i am designing a project for shared resources.now i have already added and deleted a share successfully.Its a networking project which i would like to mention.
Now i want to know how to specify access rights for folders based on user level security. i mean i just want to modify the user privilege so that only he can access the folder. I want to set the rights sitting in some other system of course as an administrator. Doing it in a local system is quiet easy(setting the share rights of windows) but how do i write some code which works from remote system in VC++
|
|
|
|
|
Howdy,
I'm looking at trying to write a skinnable MFC application.
I've played with the SkinMagic demos from appspeed.com, they look pretty good.
I was wondering if anyone has experience using the appspeed SkinMagic or similar C++/windows skinning systems?
Recommendations and lessons learned would be greatly appreciated.
|
|
|
|
|
I have a dialog (Find dialog) sitting inside a toolbar which resides in a control bar inside my main application. I want to know where I would call the LoadAccelerators method since right now if I add this to my Find dialog InitDialog
m_hAccelTable = LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE
(IDR_ACCELERATOR1));
m_hAccelTable is not loaded correctly. Can someone tell me where I should use this and which resource file I should add it to? My find dialog is residing in a different .NET solution than my main app.
|
|
|
|
|
sorry if this was asked before, didn't see anything.
I'm building a client program, and I get a 'The server name or address could not be resolved' message.
the relevant code lines are:
establishing session:
Connection = Session.GetHttpConnection("http://www.google.com/");
(Session is a CInternetSession)
sending request and recieving file:
char* c = "/index.html";
CHttpFile* details = TheList->Connection->OpenRequest(0,c);
details->SendRequest();
char* l;
details->ReadString(l,100);
Connection is CHttpConnection
as you can see, I'm trying to connect to google, and I tried other well-known services.
what am I doing wrong?
thanx!
|
|
|
|