|
Google for "HTTP Proxy"
Signature space for rent. Apply by email to....
|
|
|
|
|
I need code piece, not the soft.
|
|
|
|
|
Hi,
This will sound very basic and silly!!!
but can someone help me out with finding out how to go about
doing a substr() in C++;
Thanks,
Brgds,
John
|
|
|
|
|
doing a substr() in C++;
You use CString.Mid() (this requires MFC), or
you use std::string.substr() (this is standardized and portable), or
us use strstr(), the plain old C-Library function.
Its up to you.
|
|
|
|
|
if i include winsock2.h in my program i get 64 errors and 11 warning and i don't know why. i've added the Ws2_32.lib to external dependencies.
here are the errors:
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(109): error C2011: 'fd_set' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(209): error C2011: 'hostent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(327): error C2011: 'in_addr' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(625): error C2011: 'linger' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(222): error C2011: 'netent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(241): error C2011: 'protoent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(185) : see declaration of 'protoent'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(229): error C2011: 'servent' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(173) : see declaration of 'servent'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(546): error C2011: 'sockaddr' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(385): error C2011: 'sockaddr_in' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(586): error C2011: 'sockproto' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(153): error C2011: 'timeval' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(395): error C2011: 'WSAData' : 'struct' type redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(329) : see declaration of 'WSAData'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1610): error C2375: 'accept' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1631): error C2375: 'bind' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1650): error C2375: 'closesocket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1669): error C2375: 'connect' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2091): error C2375: 'gethostbyaddr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2110): error C2375: 'gethostbyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2128): error C2375: 'gethostname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1711): error C2375: 'getpeername' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2201): error C2375: 'getprotobyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2184): error C2375: 'getprotobynumber' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2166): error C2375: 'getservbyname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(865) : see declaration of 'getservbyname'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2147): error C2375: 'getservbyport' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1732): error C2375: 'getsockname' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1755): error C2375: 'getsockopt' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1776): error C2375: 'htonl' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1793): error C2375: 'htons' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1810): error C2375: 'inet_addr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1827): error C2375: 'inet_ntoa' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1690): error C2375: 'ioctlsocket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1845): error C2375: 'listen' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(789) : see declaration of 'listen'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1863): error C2375: 'ntohl' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1880): error C2375: 'ntohs' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1900): error C2375: 'recv' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1925): error C2375: 'recvfrom' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1951): error C2375: 'select' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(1975): error C2375: 'send' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2000): error C2375: 'sendto' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2026): error C2375: 'setsockopt' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2048): error C2375: 'shutdown' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2068): error C2375: 'socket' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2493): error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2466): error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2416): error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2441): error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2363): error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2390): error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2536): error C2375: 'WSAAsyncSelect' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2516): error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2341): error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2239): error C2375: 'WSACleanup' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2273): error C2375: 'WSAGetLastError' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2290): error C2375: 'WSAIsBlocking' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2324): error C2375: 'WSASetBlockingHook' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2256): error C2375: 'WSASetLastError' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2221): error C2375: 'WSAStartup' : redefinition; different linkage
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(2307): error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(65): error C2440: '=' : cannot convert from 'int (__stdcall *)(WORD,LPWSADATA)' to 'int'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(65): error C2440: '=' : cannot convert from 'int (__stdcall *)(WORD,LPWSADATA)' to 'int'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(76): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(int,int,int)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(76): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(int,int,int)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(108): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(SOCKET,sockaddr *,int *)' to 'SOCKET'
d:\90GIG\MP3ORGANIZER\FileTransfer\main.cpp(108): error C2440: '=' : cannot convert from 'SOCKET (__stdcall *)(SOCKET,sockaddr *,int *)' to 'SOCKET'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(512): warning C4005: 'AF_IPX' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(540): warning C4005: 'AF_MAX' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(672): warning C4005: 'FD_ACCEPT' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(678): warning C4005: 'FD_CLOSE' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(675): warning C4005: 'FD_CONNECT' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(669): warning C4005: 'FD_OOB' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(663): warning C4005: 'FD_READ' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(569) : see previous definition of 'FD_READ'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(144): warning C4005: 'FD_SET' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(666): warning C4005: 'FD_WRITE' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock.h(570) : see previous definition of 'FD_WRITE'
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(455): warning C4005: 'SO_DONTLINGER' : macro redefinition
d:\Visual Studio .NET\Vc7\PlatformSDK\Include\WinSock2.h(638): warning C4005: 'SOMAXCONN' : macro redefinition
All help is very appreciated, thanks!
-Rune Svendsen
|
|
|
|
|
Include it before you include windows.h.
Signature space for rent. Apply by email to....
|
|
|
|
|
thank you
|
|
|
|
|
I want to somehow make my "About" box able to automatically write out the version of my program so I don't have to update it each time I make a new version.
How can this be done?
Something else
|
|
|
|
|
I guess u should follow
AfxGetResourceHandle then FindResource with lpType RT_VERSION then LoadResource then LoadString
Hope this help!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
HRSRC hVersionSrc = FindResource(NULL, (LPCSTR) VS_VERSION_INFO, RT_VERSION);
HGLOBAL hVersion = LoadResource(NULL, hVersionSrc);
void* pvVersion = LockResource (hVersion);
VS_FIXEDFILEINFO * pFfi;
UINT cbVerInfo;
VerQueryValue(pvVersion,"\\", (void **) &pFfi, &cbVerInfo);
Signature space for rent. Apply by email to....
|
|
|
|
|
Thank you all very much for the help
My "About" box is now automatically updated with the correct version number.
Something funny
|
|
|
|
|
Is there any way I can create a a CIPAddressCtrl with a drop down history like a combo box? Or, a CComboBox control whose edit box acts like a CIPAddressCtrl?
|
|
|
|
|
http://www.codeproject.com/miscctrl/customcontrol.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi!
I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this:
1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow
2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like:
DWORD dwProcessID;
::GetWindowThreadProcessId(hForeground,&dwProcessID);
::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1);
::PostThreadMessage(dwProcessID,WM_CHAR, 65,1);
::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1);
But this doesnt help.
Any help will be greatly appreciated.
Thanks for your time
Richard
|
|
|
|
|
Better to use FindWindow or FindWindowEx and SendMessage or PostMessage
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Good link also
http://www.codeproject.com/dialog/keystroke.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks so much for your quick reply, Papa (is that ur name ?)
|
|
|
|
|
Just a nick, my name is Johnny
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
For Win32 applications, not MFC
thanks all!
|
|
|
|
|
The majority of the articles on CodeProject for sockets programming use the Win32 Sockets functions rather than hte MFC CSocket & CAsyncSocket, its only the user-interface that is built in MFC usually. So you can grab most of the socks code and build your win32 app around what you can pick up.
|
|
|
|
|
can't seem to find it...
thanks.
|
|
|
|
|
Dear All,
Good Day ALL,
I have a problem in a program am working on, am using an OCX from microsoft in a MFC program this OCX is "Microsoft form 2.0 Label" the problem is when i run the program on my machine Background color of the label is the same as the BackGround color of the Main Form which is correct;But when i run it on Different Machine the Background color changes from Main Form Color plz help me how can i correct this.
Thank you all for help.
Best Regards,
Mohammad Zakarni
|
|
|
|
|
In the properties of the control, set the background color to:
-2147483633
(it'll change it to hex for you)
or you can do it via code:
CLabelControl* l = &this->m_yourLabel;
l->SetBackColor((long)GetSysColor(COLOR_3DFACE));
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Dear Nitron,
Thank you very much it worked...
|
|
|
|