|
I wrote:
I have download the remote control code here from CP and can't get it to work (any more)!!
The problem is that it can't connect to the server over the LAN!!
Another Winsock app works just fine and it uses CAsyncSocket class...
I know this should be impossible for you to say whats wrong without code example. But you perhaps know something that I don't know...
Joaquín M López Muñoz wrote:
The error is descriptive enough... seems like the server is not running properly. Try issuing a telnet your_server_ip port where port is the port number used by the app to determine whether the server is running or not.
Yes, I've done that and the Telnet client came up and was connected to the server... so... is my LAN not working properly?
Do you remember this message ?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
You did a telnet aaa.bbb.ccc.ddd 5150 ? Please note the 5150 , which is the TCP port used by the app (I peeked inside the code). A normal telnet is no useful test.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Wll, I've used 5729 instead of 5150 because I've read in the Winsock FAQ that 5150 was a reserved port number so I change but now when I changed back it works... weird...
Well well...
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
So it is working? Congrats man
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How can I syncronise (..ize for you yanks) the column widths on two CListCtrl objects?
I have an app with two CList objects aligned vertically. I am already processing the OnNotify() to update the data in list2 depending on the selected row in list1.
When the column width is adjusted in list1, I would like list2 to update it's column to the same width. However I can't find the notification code in MSDN.
Any ideas?
Paresh Solanki
One Tequila Two Tequila Three Tequila Floor
|
|
|
|
|
You have to handle the message NK_ENDTRACK, which is sent when a column has been re-sized. The header control can be a bit funny in NT and not send the message with the correct control id (it has it set to 0). Here is some code which I have used in the past:
m_Methods.GetHeaderCtrl()->SetDlgCtrlID(m_Methods.GetDlgCtrlID());
void CSamplesFloat::OnEndtrackMethodList(NMHDR* pNMHDR, LRESULT* pResult)
{
CHeaderCtrl* pHeaderCtrl = m_Methods.GetHeaderCtrl();
if (pHeaderCtrl != NULL)
{
int nColumnCount = pHeaderCtrl->GetItemCount();
int width ;
for (int i = 0 ; i < nColumnCount ; i++)
{
width = m_Methods.GetColumnWidth(i) ;
m_OtherCtrl.SetColumnWidth(i, width) ;
}
}
*pResult = 0;
}
You just need to map the HDN_ENDTRACk for both list controls, and get one to size the columns of the other in each function.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
Thanks Just what I needed
Paresh Solanki
One Tequila Two Tequila Three Tequila Floor
|
|
|
|
|
Hi,
I am reading unicode text from an Access database and want to put it in a combobox. The problem is that the text in the combobox appears to be plain ASCII. If I copy the text from the combobox and paste it into Word or so, I see the correct text again?
What should I do to get the unicode text displayed correctly, or is this "behavior by design"?
|
|
|
|
|
Hello, I have doubts about MFC7.0:
where can I get it?, is it free? do I have to buy it?
is used in order to get the graphical possibilies of XP and in order to get improved MFC controls and classes?
where can I get informed about that?
As always thank you very much...
|
|
|
|
|
I think if you install visual studio.net you can get it.And of cource it is not free(poor microsoft )
Also if you want xp visualization in MFC6 or later for all platform check this:
http://www.codeproject.com/useritems/themewrapper.asp
Mazy
|
|
|
|
|
when a modeless dialog is visible, I click mouse outside the dialog ,
windows send what message by the dialog?
Thank you very much!
|
|
|
|
|
When a dialog have loses the focus or get focus it's WM_SETFOCUS
with WPARAM I think with TRUE if the dialog is on focus or FALSE if not....
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Thank: Vladimir Georgiev, Rickard Andersson
the Message is : WM_NCACTIVATE
|
|
|
|
|
Windows sends WM_NC(something) that stands for No Client.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
How can I get a rotated standard region(such as: ellise region, roundrect region)?
HRGN hRgn = CreateRectRgn(0,0,220,120);
DWORD size = GetRegionData( hRgn, 1, NULL);
RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size);
GetRegionData(hRgn, size,pData);
double a = 0.5; // 0
xform.eM11 = (float)cos(a);
xform.eM12 = (float)sin(a);
xform.eM21 = -xform.eM12;
xform.eM22 = xform.eM11;
xform.eDx = 0;
xform.eDy = 0;
HRGN hNewRgn = ExtCreateRegion(&xform,pData->rdh.nRgnSize,pData);
// failure! why ?
GlobalFree(pData);
DeleteObject(hRgn);
DeleteObject(hNewRgn);
Thank you very much!
|
|
|
|
|
Try with
HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thanl: Joaquín M López Muñoz, now, I can get the rotated region!
the modify codes:
DWORD size = GetRegionData(hRgn, sizeof(RGNDATA), NULL);
RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size);
GetRegionData(hRgn, size,pData);
a = 0.5; // 0
xform.eM11 = (float)cos(a);
xform.eM12 = (float)sin(a);
xform.eM21 = -xform.eM12;
xform.eM22 = xform.eM11;
xform.eDx = 0;
xform.eDy = 0;
HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);
GlobalFree(pData);
DeleteObject(hRgn);
CodeProject.com Forum problems or suggestions?
Reply to a Message
Here you can reply to a message in the current discussion thread
Forum Visual C++
Subject: Re: How can I get a rotated region?
Sender: Joaquín M López Muñoz
Date: 2:45 31 Jan '02
|
|
|
|
|
how do i get a button to check if text has been entered into an edit box?
|
|
|
|
|
QnD way:
In the "on click" message handler for the button, call UpdateData(TRUE) to save the contents of the edit box into it's associated member variable (I assume you're using DDX). Then check the length of that string to see if the user entered anything.
Jon Sagara
What about ?
|
|
|
|
|
Use Class Wizzard to add a message map function to the EDIT Control, that will invoke its handler when it being edited. EN_UPDATE is the message you must add a handler for. Thus, this function will invoke everytime the contents of the edit control is changed.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Hi everyone. I have a control bar with a combo box on it, in which I want to put in all of the names of the fonts installed on the system (just like Word does, for example).
Is there an MFC or API method of getting a list of the fonts installed on the system? I serached through MSDN without much luck, maybe I am using the wrong words to search on? I only need to get the names of the fonts (like they appear in Word).
|
|
|
|
|
How about EnumFontFamiliesEx(...) ?
Jon Sagara
What about ?
|
|
|
|
|
void SNDLL_API SetFontSizeToCombo( HDC hDC,LPCTSTR lpszFamily,CComboBox & Box )
{
Box.ResetContent();
TEnumSizeDataStru Data;
Data.pComboBox = &Box; Data.yPerInch = GetDeviceCaps(hDC,LOGPIXELSY);
EnumFontFamilies(hDC, lpszFamily, (FONTENUMPROC)ProcEnumSizeToCombo, (LPARAM)&Data);
}
int APIENTRY ProcEnumSizeToCombo(
LPLOGFONT lpLogFont,
NEWTEXTMETRIC * lpTEXTMETRICs,
DWORD fFontType,
LPVOID lpData)
{
CComboBox * pComboBox = (((TEnumSizeDataStru *)lpData)->pComboBox);
LONG yPerInch = ((TEnumSizeDataStru *)lpData)->yPerInch;
CString strSize; strSize.Format("%2d",lpTEXTMETRICs->ntmSizeEM);
if( pComboBox->FindString(-1,strSize)==CB_ERR )
pComboBox->AddString(strSize);
return 1;
}
|
|
|
|
|
|
Hi, can anyone tell me how an ActiveX control can terminate its container application? I have seen this done but cannot work out how.
Also how can a control get the file location of the container application?
Any help at all would be appreciated.
Thanks, Worzle
|
|
|
|