|
I want to use CSocket class, connect() in non-blocking mode. Is it possible??
|
|
|
|
|
|
Hi!
I have modified the sample application from MSDN lib and having a trouble: Custom Control with interfaces
CEdit
A
|
|
CParsedEdit
A
|
|
CParsedEditExport (for custom controls)
Now I change design pattern: extract interface from implementation, and enable RTTI in compiler option, theoretically:
CEdit IEdit(abstract as interface)
A A
| /
| /
CParsedEdit
A
|
|
CParsedEditExport (for custom controls)
Here is the code:
interface:
class IEdit {
public:
virtual void setText(TCHAR* text)=0;
virtual int getText(TCHAR* text, int count)=0;
};
class CParsedEdit : public IEdit, public CEdit {
public:
virtual void setText(TCHAR* text) { SetWindowText(text); }
virtual int getText(TCHAR* text, int count) { return GetWindowText(text, count); }
protected:
....
};
user:
class CWclsEditDlg : public CDialog {
public:
IEdit* Edit1()
{ return dynamic_cast<IEdit*>(GetDlgItem(IDC_EDIT1)); }
IEdit* Edit2()
{ return dynamic_cast<IEdit*>(GetDlgItem(IDC_EDIT2)); }
IEdit* Edit3()
{ return dynamic_cast<IEdit*>(GetDlgItem(IDC_EDIT3)); }
IEdit* Edit4()
{ return dynamic_cast<IEdit*>(GetDlgItem(IDC_EDIT4)); }
....
};
Does anyone know how to solve this?
Thanks.
Sovann.
|
|
|
|
|
Hi, everyone!
I have seen both help in Linux man and MSDN and still puzzled.
Who can tell me what is the major difference between the two APIs?
Cheers,
George
|
|
|
|
|
I've never heard of it, but according to MSDN, the recvfrom has two extra, optional parameters :
from [out] Optional pointer to a buffer in a SOCKADDR structure that will hold the source address upon return.
fromlen [in, out] Optional pointer to the size, in bytes, of the from buffer.
If the from parameter is nonzero and the socket is not connection oriented, (type SOCK_DGRAM for example), the network address of the peer that sent the data is copied to the corresponding SOCKADDR structure. The value pointed to by fromlen is initialized to the size of this structure and is modified, on return, to indicate the actual size of the address stored in the SOCKADDR structure.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
recvfrom is used with UDP to get the source socket address of a packet.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks, Smith!
I also find that recvfrom can get more src address information.
It is another useful usage of recvfrom.
Cheers,
George
|
|
|
|
|
hello every1
-VC7: in the IDE open an exe/dll file to examine the resources
-i can see the resources tree (dialogs, icons etc.)
-i can edit/copy any resource but only staying within this tree
Question:
-how to insert one of these resources (for example a complex dialog to use it as a starting point for layout a similar one) into an existing project?
thanks in advance for any tip
best regards
|
|
|
|
|
In VC 6, resources were a text format which you could copy between projects. I dunno if this is still the case tho.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
lbc wrote:
hello every1
-VC7: in the IDE open an exe/dll file to examine the resources
-i can see the resources tree (dialogs, icons etc.)
-i can edit/copy any resource but only staying within this tree
Using VC++ I personnaly usually have both the current resource tree open, and I do a open file, adding the other .rc file in the open windows. Then I can select and copy a resource from one of the trees, and paste it to the other.
VC++7 does not change anything to this.
Now if you are using VC++7 with a managed C++ project, it's of course a different matter. You can't copy/paste resources from/to a .rc to a .resx
In fact, what you need is a VC add-in. But I wonder how many years you have to wait before someone comes with such a useful tool (which should have been provided by the way by MS). These days, people on Cp seem to love articles for instance explaining how to crack a url, even though at the end they just use ::InternetCrackUrl(). As long as we are stuffed with this kind of sh*t, I am afraid you are unlikely to see anything good for you or for the overall dev community.
Good luck!
Back to real work : D-16.
|
|
|
|
|
add the resource to ur project,copy those resource you require into your resource. It may give some error when you compile update the string table if required
hope it solves your problem
|
|
|
|
|
udayGovekar wrote:
add the resource to ur project,copy those resource you require into your resource. It may give some error when you compile update the string table if required
What do you mean ? Aren't you saying that although you can copy/paste resources from two projects, it won't work in the end ?
udayGovekar wrote:
hope it solves your problem
Not mine, eh.
Back to real work : D-16.
|
|
|
|
|
you copy and pasted the rsource but still it might give you a compilation error because of ID not defined.
I have done simillar kind of work in one of my projects, it gave compilation error.
Delete the resouce you have added for copying into ur current project
|
|
|
|
|
It might giving u error saying some resource not defined, chek for that and update your string table
If still there is a problem then tell me what exaclty the error message is
|
|
|
|
|
I have to disagree then. I have just done a test and when I pasted the dialog and menus from another project, all the missing resource IDs in resource.h have been created.
At least it works for dialogs and menus. What are the kind of resources which raised issues for you ?
Back to real work : D-16.
|
|
|
|
|
Thank you both guys
>>Using VC++ I personnaly usually have both the current resource tree open, and I do a open file, adding the other .rc file in the open windows. Then I can select and copy a resource from one of the trees, and paste it to the other. VC++7 does not change anything to this.
you are rigth, i have tried again and this time it works as advertised
for some strange reason the 'paste' action was grayed before on the resource tree inside my vc7 IDE
thanks again!
best regards
|
|
|
|
|
Does anyone know some simple SMTP client sample?
How to comunicate with SMTP server by socket functions.
Than you
|
|
|
|
|
|
Hi.
How can I acces for painting the client area of the main frame window (derived from CMDIFrameWnd) in multi-doc application?
Thanks in advance...
Juntek
|
|
|
|
|
you have WM_PAINT message, that you can use to paint the client area
|
|
|
|
|
I've checked it already and it seems to not work, I'm afraid...
thanks
|
|
|
|
|
use this in ur mainframe.cpp file, this is not a member function
long FAR PASCAL NewMDIClientProc(HWND hWnd,WORD wMesg,WORD wParam,LONG lParam)
{
switch (wMesg)
{
case WM_SIZE:
{
}
case WM_PAINT:
{
}
}
}
|
|
|
|
|
I used the SetCursor() function to change the cursor when the mouse pointer is on a button or on a notified picture,that I've been told, but there's something I'm doing wrong. Can anyone send me an example on how to do it???...Please in Win32 application..
|
|
|
|
|
BOOL CISSimpleViewerDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (pWnd==(CWnd *)this)
{
if (nHitTest==HTCLIENT)
{
if ((message==WM_MOUSEMOVE) || (message==WM_LBUTTONDOWN) || (message==WM_LBUTTONUP))
{
if (m_bNeedGrabber)
{
if (m_hDIB!=NULL)
{
if (m_bMouseInImage)
{
if (m_bBtnDown)
{
SetCursor(AfxGetApp()->LoadCursor(IDC_CLOSEDHAND));
}
else
{
SetCursor(AfxGetApp()->LoadCursor(IDC_OPENHAND));
}
return TRUE;
}
}
}
}
}
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
Thank you for sending me that example, but i wanna do that in a Win32 application too... Could you please send another one in Win32???
|
|
|
|