|
I mean switch the two statements around. Swap them. Have one trade places with the other.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello again,
these two instructions are in the right place (inside my function called by a personal window message). If I swap them I will get an error.
Do I understand well what you mean ?
see you !
There is no way to happiness, happiness is the way !
|
|
|
|
|
madretierra wrote:
If I swap them I will get an error.
What sort of error (compiler, linker, assertion, exception)?
Unless strOut is being assigned a value in some other location, the first time OnMyMessage() is called, EditSCR.SetWindowText(strOut) will set the control's text to nothing (i.e., empty). The second time OnMyMessage() is called, strOut will have a value because strOut.Format("TimeCode %X",wparam) has given it one. Make sense?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
OOhh you're right ! I'm so sorry to be so stupid ! I think I need to have a rest... Thanks a lot
for your light !
I wish you a nice week-end and hope I will bring you help when you will need, bye
There is no way to happiness, happiness is the way !
|
|
|
|
|
Hi ,
I am a novice to VC (MFC). I want to add a listcontrol on propertypage, such that it contains no. from 1 to 10 When I press scroll up button of listcontrol, the number in the list control should decrease and on pressing scroll down button the number should increase. Hope I made my need clear and specific.Please help me out!
Drushti
|
|
|
|
|
Drushti wrote:
I want to add a listcontrol on propertypage, such that it contains no. from 1 to 10
How about this:
for (int x = 0; x < 10; x++)
{
str.Format("%d", x + 1);
m_listcontrol.InsertItem(x, str);
}
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hey there...i m really embarraced here ,,,i really m new in programming...i m trying to write a simple c++code for a simple calander......so if any 1 of u can help me...i will b very greatfull....
thank u all
|
|
|
|
|
if you need a month calender use the control month calendar, theres also a control datepicker. or do you need something special ?
|
|
|
|
|
Can somebody help ?
Requirement :
1) A simple dialog based MFC proj which hides itself when a hot key is pressed. For EG : Ctrl + Alt + F8. and unhides itself when the same hot key is pressed again. [the same hotkey is used to HIDE / UNHIDE itself.]
2) Must be a single process, no service or other threads is running to listen to the keystroke except this application ]
Assumption :
1) The hot key is unique in the system. [ no conflicts with any running application or services ]
I am able to hide the window, but I am not able to unhide it as this application is no longer the active application.
Thanks,
JSM
|
|
|
|
|
I think you need to install a keyboard hook for this. I've not tried it but I think it will still intercept keystrokes even while the application's window is hidden.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Register that keypress as a hotkey with RegisterHotKey() , and the system will send your window a WM_HOTKEY message when it is pressed.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
Thanks for the tip. I was not aware of this function.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for this wonderful tip !!
|
|
|
|
|
I wanna tab control with buttom,image in mdi.
What I use class?
|
|
|
|
|
Need suggestions for the problem preferrably in VC6:
There are two machines A and B. A telnet(or SSH) to B.On logged in to B, B should give it's own window in Machine A. That is, B should be the owner of window in A.
If it is something to do with XWindows or Xterm, I am not clear how exactly to hit the problem.
I hate that lazy Java
|
|
|
|
|
Hi All,
I wanted to know the difference in creation of the list box which drops down from a
combo box and the list box control which we can embed on a dialog by drag and drop from the control menu. The list box that drops down from the combobox can overlap on other controls and still the focus is on the list box when the mouse is moved over the overlapping area of this list box and other controls.
But if we manually overlap listbox and some other control,the focus cannot remain on the list box in this overlapped area,but focus goes to other control.
Can someone tell me how to make the focus remain on the list box though the list box and some other controls get overlapped.
Thanks in advance
Raghu
|
|
|
|
|
The list box portion of a combo box is handled specially. It's actually a child of the desktop, not the combobox itself or the dialog. That way, the list can extend outside of the parent dialog (look at the Start->Run dialog for an example).
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
thankyou. the answer was helpful
Raghu
|
|
|
|
|
How to interpret the content of the key "HKEY_LOCAL_MACHINE\SYSTEM\DISK\Information"? I want it to locate all volumes under Windows NT 4.0. If the content of this key was not documented, what is the other way to locate a specific volume under WinNT 4.0? Thanks.
Best regards.
|
|
|
|
|
Are either of these what you are looking for:
GetLogicalDriveStrings()
GetLogicalDrives()
GetVolumeInformation()
FindFirstVolume()
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for your reply,
However, what I need is the location of each volume. For example, what is the starting offset and length of the volumn C: and, of course, which physical disk this volume belongs to. In other words, I want a similar function (works in WinNT 4.0) with IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, which does not work under Windows NT 4.0
I think the approach to key HKEY_LOCAL_MACHINE\SYSTEM\DISK\Information is correct. But the content of this REG_BIN value is still unknown.
Best regards.
|
|
|
|
|
Tuan Dang wrote:
I think the approach to key HKEY_LOCAL_MACHINE\SYSTEM\DISK\Information is correct.
Except that that key does not always exist. The two machines on my desk do not have that key.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Dear all,
I cannot quite understand the logic behind the notion of operator overloading.
I understand that creating a class, is like creating a new type, therefore we can overload some operators to work with that new type. For example:
Ratio& Ratio::operator=(const Ratio& r)
{
num = r.num;
den = r.den;
return *this;
} This example is absolutely comprehensible but I cannot understand how I have to think, visualize the things in order to implement operator overloading in the *, *= operator, or in the == for instance.
Consider the Ratio class as the following:
class Ratio
{
friend Ratio& operator*(const Ratio& x, const Ratio y);
public:
Ratio(int =0, int =1);
Ratio& operator=(const Ratio&);
Ratio& operator*=(const Ratio&);
private:
int num, den;
};
Here is the understanding problem:
Ratio operator*(const Ratio& x, const Ratio& y)
{
Ratio z(x.num*y.num, x.den*y.den);
return z;
}
Is this the only way to overload that operator in this example? How one has to think in order to writew the above code? What are the steps involved in order to write the above two lines of code? And secondly in the first example (operator=) the return type is a reference to the Ratio but in the second is not a reference. Why is not a reference. When should we use a reference and when not?
Please bare in mind that I understand the use of friend functions.
Thanks in advance for the help,
grscot
|
|
|
|
|
Compilation of file1.cpp and file2.cpp - success.
Linking causes error LNK2001.
What are possible reesons?
//file1.h
void dosmth();
//file1.cpp
#include "file1.h"
void dosmth()
{
//dosmth
}
//file2.cpp
include "file1.h"
void main()
{
dosmth();
}
XPIS
|
|
|
|
|
Hi,
I couldnt find anything wrong in your code except missing of # in the #include statement @ file2.cpp. It is working 4 me. @ what env. r u working @
Sujan
|
|
|
|