|
|
Hi,
I want to remotely show a Client Desktop in a Server.
and For this I want to Read Graphic Card memory and send them to Server.
Like what the monitor does.
What is the best way?
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I don't think there is any easy way to read the graphics memory card etc.
But you can take screen shots of the client. Then you can compress the images, like convert them to jpegs and also reduce the size of the image, if you want to, then send them over to the server.
For this, first you will need to know how to take screen shots of the desktop, like this article:
http://www.codeproject.com/tools/screen_snaper.asp[^]
There are other ways also. You can search for them.
this is this.
|
|
|
|
|
Hi,
I wrote a program that sends data to few systems through a differnt thread(SendThread) using UDP on a LAN. and before this SendThread i am launching another Thread(RecvThread), that listens to a port no 54000. this RecvThread listens and whenever it gets any message Say "AAA" then it replies back with a sendto(sd,"yes",3,&client,size); but this message never reaches the other system that sent the first message "AAA". When i dubugged i found that the IP was alright. Once the SendThread finishes sending to selected systems, it ends. my code for RecvThread goes like this. is it because the recvfrom() is done in another thread? so that when another system sends a message, this thread completed its time slice or is not run by the CPU. hence it is not received? can this happen ? Please help me on this.
while (1)
{
buffer[0]='\0';
client_length = (int)sizeof(struct sockaddr_in);
memset((void *)&client, '\0', sizeof(struct sockaddr_in));
bytes_received=0;
bytes_received = recvfrom(sd, buffer, 4, 0, (struct sockaddr *)&client, &client_length);
if (bytes_received < 0){
printf("No Data is Found.\n");
closesocket(sd);
_endthread();
}
else {
if (strcmp(buffer, "XXX") == 0){
if (sendto(sd, current_time, 4, 0, (struct sockaddr *)&client, client_length) != 4){
printf("Error sending datagram.\n");
closesocket(sd);
}
else {
printf("\nReplySent");
}
}
else if(strcmp(buffer,"Yes") == 0){
printf("Got a reply for yes");
}
}//end of outer else
}//end of while
Thanks in Advance
KSS
|
|
|
|
|
you have a separate thread RecvThread for receiving, then why you receive it again here ?
fearless stallion wrote: bytes_received = recvfrom(sd, buffer, 4, 0, (struct sockaddr *)&client, &client_length);
VuNic
|
|
|
|
|
Hi,
Let me make it a bit more clear, My Application has two threads SendThread and RecvThread. I place the same copy of the Application on the Selected Systems. First The RecvThread is set to Bind at 54000 port no. And then the SendThread sends a Query "XXX" to all the Selected Systems and then ends itself. all those systems must also be running the RecvThread at their own end so the Code that I listed above is my RecvThread, which when gets the Message "XXX" replies back to the sender with "Yes". I am able to successfully send the reply message "Yes" but on the Receivers end(Initial senders) i am not able to get the Message. The code handles the both "XXX" and "Yes" messages but still.. Why is it so. is there any problem in the Code?..
KSS
|
|
|
|
|
Did you try the same with single UDP C/S application?, and one more question, your requirement seems that "Multicasting" would be the best option when you want to send to multiple users(clients), where you'll need to add an interface IP address and use ip_addmembership. but anyway, we'll first try your way.
VuNic
|
|
|
|
|
Hi,
Yes I did, in fact it was a simple Client/Server Application and it worked fine, then i changed it to use Threads.
you are right my application detects the number of machines on the network and sends a message to all of them and if it finds any answer then it adds that machine name to a file.
I want to make it more like SQLDMO which detects the number SQL servers running on the network. can Multicasting Help me ? will it not increase the network traffic? BTW what is problem with this code?...
One more thing when i start to debug it skips the Break points sometimes and just runs as if it is in general run mode.
Thanks a lot for the Reply.
KSS
|
|
|
|
|
Thanks a lot, i got it resolvesd, actually the RecvThread was sending to a sockaddr_in that was with in the sender thread and that SendThread was killed by the time it got the mrssage.
any ways thanks
KSS
|
|
|
|
|
Hi to all
Iam using CInPlaceEdit class whose author is "Aravindan Premkumar"
Its working very well. But I want to have a spinner control associated with the inplace edit box (Offcourse it's possible). I tried the following code its working but there are some problems associated with it which I'll discuss below.
Code:
step 1: I made the CSpinButtonCtrl object member of this class
class CInPlaceEdit : public CEdit
{
public:
CSpinButtonCtrl m_spinCtrl;
.......
};
Step 2: I made some changes in the following method
BOOL CInPlaceEdit::ShowEditCtrl(DWORD dwStyle, const RECT &rCellRect, CWnd* pParentWnd, UINT uiResourceID, int iRowIndex, int iColumnIndex,CString& strValidChars, CString& rstrCurSelection)
{
m_iRowIndex = iRowIndex;
m_iColumnIndex = iColumnIndex;
m_strValidChars = strValidChars;
m_strWindowText = rstrCurSelection;
m_bESC = FALSE;
if (NULL == m_pInPlaceEdit->m_hWnd)
{
BOOL bCreated = m_pInPlaceEdit->Create(dwStyle, rCellRect, pParentWnd, uiResourceID);
// I added following code in this method
CRect rect;
rect.left = rCellRect.left + 50;
rect.top = rCellRect.top;
rect.right = 20;
rect.bottom = rCellRect.bottom;
// are above 5 line correct way to obtain right location for spinner ctrl??
// If not how it could be done?
bCreated = m_spinCtrl.Create(WS_CHILD | WS_VISIBLE | UDS_ALIGNRIGHT |UDS_SETBUDDYINT | UDS_ARROWKEYS |UDS_AUTOBUDDY, rect, pParentWnd, IDC_SPIN);
m_spinCtrl.SetRange32(0, 1000);
UDACCEL uda;
uda.nInc = 20;
uda.nSec = 0;
m_spinCtrl.SetAccel(1, &uda);
return bCreated;
}
return TRUE;
}
after this I removed the PostMessage(WM_CLOSE) statement from OnKillFocus()
The spinner ctrl is getting displayed & the edit box values are also changing but only when user clicks on spinner button .
PROBLEMS:
1)Though while creating spinner button I have given style as UDS_ARROWKEY it is not working.
2) When User resizes the grid column multiple spin button ctrl gets created.
Please tell me where i am going wrong.
if any one have achieved this please help me how it could be done.
Thank you
|
|
|
|
|
Just a guess...
You are creating the spin control in the wrong place. This function get's called multiple times and everytime it creates a new spin control.
Shoaib Patel wrote: Iam using CInPlaceEdit class whose author is "Aravindan Premkumar"
You will receive a better answer from him.
Nibu thomas
Software Developer
|
|
|
|
|
hello Nibu
your guess was , that method is getting called multiple no. of times but I checked its not the case.
Actually I have almost created the spin button control it is working when user clicks on it but when user presses up or down key to change the value of buddy it increaments it first time & after that it doesn't.
And when user resizes the grid column it is having some problem. I think the problem is because of its position.
If you want I can send you the sample application & the document of scenarios.Please help me.
You said I'll get better answer from him ( Do u mean "Aravindan Premkumar"??)
Do u know his email id. i tried searching it but I didn't found it.
Thank you
|
|
|
|
|
hi,
As i created 5 buttons at runtime (getting values from user).
Simultaneously i want to add event to those button which i created at runtime.
how & where could i add the button cliked event in our code .
reply early
send reply
|
|
|
|
|
You can override OnCommand for this purpose. Look up MSDN for more help.
Nibu thomas
Software Developer
|
|
|
|
|
Check the id of the button that was clicked in the OnCommand function and perform the tasks required over there .
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
thanks , i got it from ur reply...
send reply
|
|
|
|
|
Hi maharaja pandian,
////In file h///////////////
CButton m_Button3;
afx_msg void OnBnClickedButton3();
////////In file Cpp/////////////
#define IDC_BUTTON3 12000
ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
///////In you function////////////////
m_Button3.Create("Butotn3",WS_CHILD|WS_VISIBLE|BS_NOTIFY,CRect(0,0,20,20),this,IDC_BUTTON3);
void CssDlg::OnBnClickedButton3()
{
MessageBox("button3");
}
|
|
|
|
|
thanks for ur reply,
but during the runtime only i know ,how many buttons are requried.
i created like
CButton bt[]=new CButton (noofval);
bt[0].create(....);
bt[1].create(....);
.
.
.
like that i created, but i want to add cliked event to that each button
send reply
|
|
|
|
|
You can use Oncommand in your project but if you know about buttons
you can use this code (example you created 10 buttons dynamic) then
you can use this way.I use this way and this is safe and I think it's easy
|
|
|
|
|
thanks , i got it from ur reply...
send reply
|
|
|
|
|
Does anyone know whether you can have more than one Column in a CComboBox ? Seen this in an Access App. If yes: how to do ?
Modified: Meant Column rather that row !
-- modified at 7:20 Monday 20th March, 2006
|
|
|
|
|
What do you mean by more that one row in a combo box?
Nibu thomas
Software Developer
|
|
|
|
|
All right: a ComboBox keeps al lot of items listed while opened. I used ComboBoxes a lot so far.
It´s content could look like this, just one row is keept by ComboBox Element and displayed:
Fred
Harry
Paul
Thomas
I seen this in ACCESS in a different shape:
1 Fred
2 Harry
3 Paul
4 Thomas
ACCESS is capable of holding more than one row in a ComoBox Element.
|
|
|
|
|
RadioOpa wrote: I seen this in ACCESS in a different shape:
1 Fred
2 Harry
3 Paul
4 Thomas
It is easy to display strings like this...
When you add an item make sure you get the index to the item and then use
CString's Format function.
CString str;
str.Format("%02d Fred", nIndex);
m_cmb.AddString(str);
Well to create multicolumn list box use LBS_MULTICOLUMN .
Nibu thomas
Software Developer
|
|
|
|
|
Thanks, but this is not a ListBox but a ComboBox. In a ListBox you can easily create more than one column and select items and it´s columns as
m_Liste.InsertColumn( 0, "ID");
m_Liste.SetColumnWidth( 0, 40 );
m_Liste.InsertColumn( 1, "Customer");
m_Liste.SetColumnWidth( 1, 160 );
m_Liste.InsertColumn( 2, "Country");
m_Liste.SetColumnWidth( 2, 40);
It appears that ComboBoxes do not support this feature so I need to format the string as suggested. I´ll use CString members as mid... for getting what I´m after.
|
|
|
|