|
Hi again, i was build using "gmake realclean #for a clean build". it works...
but now, may i know how to run Messenger?
I was used "./MessengerServer"
but the errorvmessage come out, "bash command not found".
I really appreciate your help..thank you
|
|
|
|
|
Open up a term Window and check if the executable program is where you think it is.
They are a Perl script called run_tests.pl to run both Client and Server using an IOR file.
I am not an expert on Unix, but it all should work, Perl is free so check if you have it.
|
|
|
|
|
thanks!
i am not expert on developing network...
my question is how to create IOR file?
u help me a lot..
|
|
|
|
|
You just give the name of the IOR file and it gets created with the data.
e.g.
server -o my_ior_file
client -f my_ior_file
|
|
|
|
|
hello to all,
how to create new ".rc" file which will contain all the information about the resources added in ur project and how to add this ".rc" file in your project?
Thanks and Regards,
A.Kulkarni
|
|
|
|
|
Create a new project. Add something to your resources using the resource editor. Then look or the name of one control (i.e. IDD_MYCONTROL) with the binoculars button where the toolbar. One of the matches will be in MyApp.rc and the other will be in resources.h.
Make a double click in the result of the *.rc, a window will tell you something about opening the resources in the editor, say yes and enjoy taking a look.
You can put as much resources in your resource editor as you want. Afterwards you can check how it is configured and created using this.
Once you know how. Just make it at your own taste with a text editor and put the extension *.rc when saving as.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
hi all.
I have some problem with I/O stream.
I write console application, that start another process "B".
process "B" write's some information in consle.
I need to read this message and if you can tell how I can set that out stream of process "B" wos input stream for my program.
is there some function or other way to do read this information.
|
|
|
|
|
|
I am writing a dialogue based application that has several button controls on it. I want the user to be able to press several buttons at once via the keyboard and the dialogue to represent the button as being pushed for the duration of the key presses.
My plan was to use OnKeyDown to read the keyboard and determine which button is pressed. I then want to send a message to the dialogue to simulate the button being pressed by the mouse. I was intending using:
SendDlgItemMessage(IDC_BUTTON2, ON_BN_CLICKED,0,0);
to send a message to the dialoge that a button has been pressed, but I am not having much luck.
I am using Visual Studio 2005
Any answers?
Kalvin
|
|
|
|
|
KalvinComer wrote: SendDlgItemMessage(IDC_BUTTON2, ON_BN_CLICKED,0,0);
It is absolutely useless. Any way BN_CLICKED is the message, not ON_BN_CLICKED. And it is sent along with WM_COMMAND. Also this message should be sent to the parent (dialog). So in the OnKeyDown, you have to send this message to your own dialog, instead of the button.
BTW you need a pushing effect on the button?
- NS -
|
|
|
|
|
To be a little clearer:
I have a dialoge that has two buttons (BT1, BT2).
I would like it to be the case that I can:
press 1 on the keybord and BT1 depresses (and calls and associated button1 clicked method). Releasing 1 un depresses BT1.
press 2 on the keybord and BT2 depresses (and calls and associated button2 clicked method). Releasing 2 un depresses BT2.
Press and hold 1 and 2 on the keyboard, and both BT1 and BT2 depress. Releasing 1 and 2 un-dpresses BT1 and BT2.
Kalvin
|
|
|
|
|
KalvinComer wrote: Press and hold 1 and 2 on the keyboard, and both BT1 and BT2 depress. Releasing 1 and 2 un-dpresses BT1 and BT2
Hope the following code may suit for you...
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_KEYDOWN )
{
if( pMsg->wParam == '1' )
{
pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn1.m_hWnd;
}
else if( pMsg->wParam == '2' )
{
pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn2.m_hWnd;
}
}
else if( pMsg->message == WM_KEYUP )
{
if( pMsg->wParam == '1' )
{
pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn1.m_hWnd;
}
else if( pMsg->wParam == '2' )
{
pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn2.m_hWnd;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
- NS -
|
|
|
|
|
KalvinComer wrote: I have a dialoge that has two buttons (BT1, BT2).
I would like it to be the case that I can:
press 1 on the keybord and BT1 depresses (and calls and associated button1 clicked method). Releasing 1 un depresses BT1.
press 2 on the keybord and BT2 depresses (and calls and associated button2 clicked method). Releasing 2 un depresses BT2.
Press and hold 1 and 2 on the keyboard, and both BT1 and BT2 depress. Releasing 1 and 2 un-dpresses BT1 and BT2.
I would use "pushbutton like" checkboxes instead of normal buttons, because you can make them look depressed just by set their state to checked, and release them by seting their state to unchecked. This would also make the dialog useable for someone who doesn't want to use the keyboard. Your idea of handling two keys pressed at once would work, but I think it would be easier to just assign '1' and '2' as shortcut keys to the respective buttons. That way, a user could press, but not hold '1' to either press or release button 1, and similarly for button 2.
Nathan
|
|
|
|
|
NS17:
Thank you, your code snippet has helped me alot. The key bit I was missing was: generation of my own button down command i.e.:
pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn1.m_hWnd;
However, can't seem to get two buttons down at the same time.
Nathan:
Thanks for your suggestion. I now have two pushlike buttons on the dialogue and it behaves just how I want it with respect to the keyboard. But with respect to the mouse can I get the control to be true whilest the mouse is over it and the LH mouse button is down, and it returns to false when the mouse LH button is released.
I'm convinced some combination of your two solutions will get me there but after several hours work, I have got no further.
Having this dicussion has clarified my thoughts: what I need is:
A control either button or push like check box, that the rest of my app can reconise as being true or not, the control must be true only whilest the key assigned to it is pressed or the mouse button is being held down over it. If two buttons are pressed via the keyboard then both control states should be true for the duration of the press.
As some back ground: I am trying to write a simulation of a piece of hardware which has several keys. The state of which are sent regularly out over the serial port, have coded all that bit. The hardware buttons are momentary push buttons i.e. there state is high only whilst they are pressed down. So in real life the user could press more than one.
I can get the behaviour I want from the keyboard thanks to Nathan's idea, that only leaves how the control should behave in response to the mouse. Here I'd like the control to be on only when the mouse is over the control and on getting a WM_LBUTTONDOWN and the control to go off when getting the next WM_LBUTTONUP.
Any further ideas?
Kalvin
|
|
|
|
|
KalvinComer wrote: Nathan:
Thanks for your suggestion. I now have two pushlike buttons on the dialogue and it behaves just how I want it with respect to the keyboard. But with respect to the mouse can I get the control to be true whilest the mouse is over it and the LH mouse button is down, and it returns to false when the mouse LH button is released.
That makes things more complicated. When a mouse button is pressed over a control, the control captures the mouse input so that other windows don't get mouse messages. If you made a subclass of CButton that informed its parent whenever it got a mouse message, and used it for control members, you could update the state of the buttons according to the mouse state as well as the keyboard state.
I've just realized that you could also intercept mouse messages in PretranslateMessage for the same effect.
Nathan
|
|
|
|
|
Nathan,
I have written an ActiveX control to provide the functionality I require, a bit of a learning curve but it's now doing just what I want.
Thanks for your help.
Kalvin
|
|
|
|
|
Hi,
I have notice that, when I open the configurations tool of the 3rd party dll that I am using, if I move the window of the configurations tool, my programm is not able to refresh while the Modal DialogBox is opened. That causes that my programm (in background) acumulates vestiges of the movement of the foreground window. I have checked it out with another programs in background but it doesn't make it.
What should I look for in order to avoid that my program acumulates the tracks of the DialogBox's movement while it is opened? Any tip?
-- modified at 8:50 Friday 5th October, 2007
I hope you can understand what I try to say
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
i have declared a variable TCHAR TBuf[ 512 ] in public section of a class. How i can initialize this variable .
if i declare the variable in a local function i initialize it as TCHAR TBuf[512] = {'\0'} , in this method entire buffer (512) bytes is initialized. How to perform this kind of initialation on a class variable.
Thanks & Regards
|
|
|
|
|
On the constructor of the class
MyClass::MyClass ()
{
}
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
void MyFunc()
{
TCHAR TBuf[ 512 ] = { '\0' } ;//this method initializes the array index 0 to 511 with null
}
//in the case of a class varibale i use the following method, is there any simple step to do the same ?
class MyClass
{
public :
TCHAR TBuf[ 512 ] ;
MyClass()
{
//
int i = 512 ;
while( i > 0 )
{
TBuf[ --i ] = '\0' ;
};
}
}
Thanks & Regards
|
|
|
|
|
better use ZeroMemory Api! or memcpy!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Au contraire!
Why should one not use a C++ function instead of something more complicated and proprietary?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
As DavidCrow mentioned, you can use memset().
Also, I would recommend NOT using hardcoded values like 512...
use the sizeof operator.
class MyClass
{
public :
TCHAR TBuf[ 512 ] ;
MyClass()
{
memset(TBuf, 0, sizeof(TBuf));
}
};
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
nitin3 wrote: How to perform this kind of initialation on a class variable.
Ever heard of memset() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am using CreateDestop() API to create a new Desktop and SwitchDesktop() API to switch to new desktop.It works fine without any errors.
But the problem is that I am not able to open any process in new Desktop. I am not even able to open the Taskmanager in new desktop. What I get is only blank desktop there.
I am using following code to Create and Switch to new Desktop.
If you know what is the probelm please inform me.
hNewDesktop = CreateDesktop(L"NewDesktopName", NULL, NULL, 0, GENERIC_ALL, NULL);
SetThreadDesktop(hNewDesktop);
SwitchDesktop(hNewDesktop);
OpenProc(_T("userinit.exe"));
OpenProc(_T("Explorer.exe"));
Thnx in advance.
|
|
|
|