|
WinCVS is very nice!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi, I have setup our CVS server on a solaris machine for all our development. My development is primarily done with VC6 on another Win2K box.
By using Jalindi Igloo I get automatic SCC integration within VC6 just as if I were using Visual SourceSafe ( thank god I don't anymore! ).
So assuming you have CVS set up properly, get igloo from
Jalindi Igloo
It is a breeze to install and I have had almost no problems using it.
WinCVS is fine but does not integrate into VC6
One note (this applies to both WinCVS and Igloo): if you are using cvs and using ssh authentication then life is not so easy. This is partly in the way ssh works in WIn32 (or at least that is the claim). Each CVS command will need to be authenticated with a password (as opposed to a login you do once in pserver mode) which can be automatic if you have run keygen and uploaded the info to the server, otherwise a blank dos window will popup and you must enter your password - not very intuitive since there is no text in the DOS box to indicate this !
You can tell your authentication by looking at the CVSROOT that you use:
if it is
CVSROOT=:pserver:username@cvs_server_ip:/dir/to/cvsdir
this is the default pserver mode, which is what most people set it up for
anything else will use a different form of authentication
Cheers !
|
|
|
|
|
Hi ,
i can not create a MCI window that appears inside the client area of the MainFrame. They 're always outside. Any solutions about this ?
thanks for advance
|
|
|
|
|
Hello all.
I am developing a software for Japanese. This program to simulator user action. My software is failed when I catch WM_KEYDOWN message of Internet Explorer applications. Its parameter is not correct. wParam always is zero. This error only occurs when I type Japanese characters. Who can solve this problem please send it to me. My e-mail addres is Binhnvit@Yahoo.com
Thank you
|
|
|
|
|
Hi,
is your software unicode compiled ?
japanese,chinese do use extension char sets
DanielO
|
|
|
|
|
Hello,
i have to debug a service intensively. But it's not possible with normal
tools. So i want to write a little C++ Class which uses UDP Socket with one Function Send(CString _somewhat). All the other stuff should be hardcoded.
But i failed, because i don't have an UDP Example. I've tried mswinsck.ocx and the code from Nishant. But both looks not very smart for me.
Has anybode coded something like that or has a UDP Send via Socket
example for me?
Marco
|
|
|
|
|
Koep wrote:
But it's not possible with normal tools.
Well, it is possible, but there is a limitation - it is difficult to debug start of the service.
Try to put the call to DebugBreak() function to a place where you want to start to debug your service, it must be after startup code and there should not be any communication between your service and SCM after this call.
Or, design your service in a way, when you can compile two versions of it - one service version and one application version.
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
Or, design your service in a way, when you can compile two versions of it - one service version and one application version.
Thats the way i did it till now. But i use COM Interfaces and have to test all of Addref and Release stuff. Whats happend when DebugBreak() is executed ?
I can't get much information from the help.
The Service should be running again after the interruption.
Marco
|
|
|
|
|
Hi,
we recently discuss if std::vector gives me access to a linear memory chunck or not. For example 'Effective STL' from Scott Meyers mentions in item 16 that vectors "have the same underlying meory layout as arrays".... e.g. ideal for pasing data to API calls.
Well, the standard (http://www.sgi.com/tech/stl/[^]) on the other side does not literaly define this behaviour. So, the question is.... do STL implementation guarantee vector holds a linear memory (mean unsegmented here)?
Greets, Moak
|
|
|
|
|
I remember reading somewhere (CUJ ?) that C++ Standard Commitee is considering an addendum to the Standard which explicitly states that vector uses 'linear memory chunk' or whatever they decide to name it However, I can't provide you with a link. But I think you're safe with assumption that vector has linear buffer. Performance would be heavily crippled otherwise.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
The defect report to the standard committee is here
|
|
|
|
|
So, using vector to have a linear memory seems pretty safe.
As alternative there was mentioned std::valarray (hi looom2).
/Moak
|
|
|
|
|
Further to the other answers, 'Technical Corrigendum 1' to the C++ standard is apparently in progress. For more details w.r.t vectors, see this[^]
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Friends,
Am a windows programmer using MFC and visual c++ tool.Now the thing which is bothering me is .Net has come out and they say that applications can be created in a more Sophisticated and rapid way.Is is really true?How do you see the .Net platform from the application development angle.Will MFC and MFC functions be obsolete or dead in Visual Studio.Net??
Pls answer bit detailedly.
Thanks for reading.
waiting for ur answers.
Bye
|
|
|
|
|
Hi,
Not really! I can bet my life that you will not see C++ and MFC going away any time soon (personally, I hate MFC!). Yes, .NET does bring a lot of changes and I love the architecture of the platform. However, you can still program in the traditional C++ way without using the managed extensions.
Personally the choice of tools really depends on the applications you design. I work in the DSP environment mainly using C++. C++ till this day remains the language of choice when performance remains top priority. Managed code is not suitable for all applications.
However, I would definitely recommend starting to learn and develop using .NET
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hello again everyone,
A small question for the C++ gurus here I wasgoing through MSDN looking for some information about BEGINPAINT and ENDPAINT API calls. It says that they should only be called in response to WM_PAINT message. However, it does not go on to explain why it should be so? Anyone here knows why it cannot be called outside WM_PAINT.
I was trying to paint a control which needs to be updated with new data every second. If I use ::GetDC(hWnd of control), the update works fine. However, if I use
BEGINPAINT(hWnd of control, pointer to PAINTSTRUCT)
.... painting code
EndPaint(hWnd, PAINTSTRUCT)
Now, it does not update. It just makes one call and subsequent calls have no effect
I really do not understand why it is so. I would really appreciate it if someone sheds some light on it.
Thank you for taking the time to read this. Any help would be greatly appreciated.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
BeginPaint validates the update region for your window.
WM_PAINT messages are only generated when your message queue is empty, and your window has some portion of the window that is invalid. So if you call BeginPaint outside of the WM_PAINT handler, or ValidateRect(NULL) for that matter, you will be validating the entire window, and hence never receive a WM_PAINT message.
As long as you are not having any problems with the call to GetDC, you should continue to use that function. If you are experiencing problems, then you may want to work with the update region yourself, or invalidate portions of your window so that a WM_PAINT message is generated and you can handle the painting in your WM_PAINT handler.
Coincidentally, because the way that WM_PAINT messages are generated and the way that BeginPaint works, you should not generate WM_PAINT messages yourself, you should use RedrawWindow instead.
If you have any other questions don't hesitate to ask.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
pankajdaga wrote:
It says that they should only be called in response to WM_PAINT message. However, it does not go on to explain why it should be so?
Quote from MSDN:
The BeginPaint function automatically sets the clipping region of the device context to exclude any area outside the update region. The update region is set by the InvalidateRect or InvalidateRgn function and by the system after sizing, moving, creating, scrolling, or any other operation that affects the client area. If the update region is marked for erasing, BeginPaint sends a WM_ERASEBKGND message to the window.
This means that device context which BeginPaint initializes has clipping region which allows you to draw only on parts of client are which have been invalidated. If you call BeginPaint when window is not invalidated, your graphics operations will be totally clipped and you won't see anything.
If you insist on using BeginPaint every second, just call InvalidateRect in response to WM_TIMER message (or whatever you're using). However, there's nothing wrong with GetDC; actually, this is the API to use in this case.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
One more thing I wanted to add, I wrote two articles that explain how windows painting works and how to program with it. There is a beginner and an intermediate article, it may answer some of you questions about paint.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hey guys!
Thanks for the reply. Everything is clear now.
I knew that the window was not receiving any paint messages when I used BeginPaint. I just needed to know why I am just crazy for details. Usually, never satisfied if a thing works, I want to know why it does or does not work.
So, I subclassed my abstract canvas class into 2 new classes. One which uses GetDC() and one which uses BeginPaint and EndPaint. So, if I need manual updates I use GetDC(). If I need to do something in response to WM_PAINT, I use Begin and EndPaint
Personally, I did not think generating WM_PAINT myself was not a good idea. This I think is a much simpler and correct solution.
Thanks again. Any new ideas /suggestions welcome
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Does anyone know of any MFC controls of this nature...?
I'm aware of the WTL versions, but I have quickly grown tired of trying to figure out what was going wrong...
I've done all the obvious included wtl/include under project settings and included the nessecary incldes the author suggests...however I still get errors and i'm not interested in trying to figure it out right now...I just don't have the pateince..i'd rather right a owner drawn TAB control myself...using MFC...
So is there any...? Or are these all WTL/ATL...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
For a project we use overlapped sockets instead of CSocket (not thread-safe).
Everytime when a socket is accepted:
- the virtual function OnAccept is called, the socket is accepted
- A new thread is started
- new Events are created (m_hStopEvent, m_Read.hEvent, m_Write.hEvent, m_hEvent)
- The socket is 'attached' (see below for code)
but the events still arrive at the listening socket.
the WSAWaitForMultipleEvents goes off.
but WSAEnumNetworkEvents queries 0.
The implementation works fine for UDP (the same socket is used !)
Thanks in advance.
Greetings,
Niko
The code:
socket thread:
int CASyncSocket::SocketFunc()
{
WSAEVENT handles[]={
m_hStopEvent,
m_Read.hEvent,
m_Write.hEvent,
m_hEvent};
WSANETWORKEVENTS netEvents;
DWORD dwWaitResult;
DWORD dwTimeOut;
OnAttach();
for(;;)
{
if(m_ulTimeout == 0)
dwTimeOut = WSA_INFINITE;
else
dwTimeOut = m_ulTimeout;
dwWaitResult = WSAWaitForMultipleEvents(
sizeof(handles)/sizeof(WSAEVENT),
handles,
FALSE,
dwTimeOut,
TRUE);
if(dwWaitResult == WSA_WAIT_EVENT_0+3){
if(WSAEnumNetworkEvents(m_Socket, m_hEvent, &netEvents)!=SOCKET_ERROR)
{
if((netEvents.lNetworkEvents&FD_READ) == FD_READ)
{
_OnReceive(netEvents.iErrorCode[FD_READ_BIT]);
}
if((netEvents.lNetworkEvents&FD_WRITE) == FD_WRITE)
{
_OnSend(netEvents.iErrorCode[FD_WRITE_BIT]);
}
if((netEvents.lNetworkEvents&FD_CLOSE) == FD_CLOSE)
{
_OnClose(netEvents.iErrorCode[FD_CLOSE_BIT]);
}
if((netEvents.lNetworkEvents&FD_CONNECT) == FD_CONNECT)
{
_OnConnect(netEvents.iErrorCode[FD_CONNECT_BIT]);
}
if((netEvents.lNetworkEvents&FD_ACCEPT) == FD_ACCEPT)
{
_OnAccept(netEvents.iErrorCode[FD_ACCEPT_BIT]);
}
}
else
{
int iError = WSAGetLastError();
if(iError == WSANOTINITIALISED ||
iError == WSAENOTSOCK)
{
Close();
}
}
}
else if(dwWaitResult == WSA_WAIT_EVENT_0)
{
break;
}else if(dwWaitResult == WSA_WAIT_EVENT_0+1)
{
_OnReceiveComplete();
}else if(dwWaitResult == WSA_WAIT_EVENT_0+2)
{
_OnSendComplete();
}
else if(dwWaitResult == WSA_WAIT_FAILED)
{
break;
}
else if(dwWaitResult == WSA_WAIT_TIMEOUT)
{
_OnTimeout();
}
else
{
Close();
}
}
_OnClear();
if(bAutoDelete == true)
delete this;
return 0;
}
Accept function:
void CASyncSocket::Accept(CASyncSocket& SocketToAccept) const
{
ASSERT(SocketToAccept.m_Socket == INVALID_SOCKET);
SAcceptedSocket as;
int iLength=sizeof(sockaddr);
sockaddr sockaddress;
as.s = ::WSAAccept(m_Socket, &sockaddress, &iLength, NULL, 0);
as.addr = CIPAddress(sockaddress);
SocketToAccept.Attach(as.s,as.addr);
}
bool CASyncSocket::Attach(SOCKET s, const CIPAddress& Peername)
{
if(s!=INVALID_SOCKET){
Close();
m_Peername = Peername;
m_Socket = s;
if(Init() == true) // starts the thread
{
return true;
}
}
return false;
}
|
|
|
|
|
Niko Tanghe wrote:
Everytime when a socket is accepted:
- the virtual function OnAccept is called, the socket is accepted
- A new thread is started
I might be wrong, but on purpose of a asychronous socket class is that you can handle all sockets with on thread context, so you have:
1) no disadvantages from context switches (very effective)
2) and need less semaphores when accessing common data (also no shared memory block).
in the past I tried to access CAsyncSocket derived from two threads and failed hard. I used a second thread to clear up dead sockets, which failed with a nice assert. Now, I use just one thread context for handling my whole server. The GUI or other stuff _can_ (not has to) still run in different threads.
Hope it helps a bit.
|
|
|
|
|
Hello,
In my CDialog, I use the following line to send a command to a dialog bar:
(((CMainFrame *)AfxGetApp()->m_pMainWnd)->m_SchedDlgBar1).PostMessage(ID_TEST);
My m_SchedDlgBar1 class has the following:
BEGIN_MESSAGE_MAP(CDiagGlobalSched, CDialogBar)<br />
...<br />
ON_COMMAND(ID_TEST, RefreshSchedBar)<br />
END_MESSAGE_MAP()
I have overidden the CMainFrm class's OnCmdMsg to see if this message ever shows up:
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) <br />
{<br />
TRACE1("id:%d ", nID);<br />
if (m_SchedDlgBar1.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) return TRUE;<br />
<br />
return CMDIFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);<br />
}
... and based on nID never being equal to ID_TEST (and my code not executing the designated function) it never shows up!? I've looked at examples and my code is exactly how they show it should be.
Where did my message go? Why did it not show up?
thanks!
JennyP
|
|
|
|
|
Use 'PostMessage(WM_COMMAND, ID_TEST)'.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|