|
Hi,everyone!I want to write a program about bitmap transparency.Although I know the API function TransparentBlt(),I need an half-transparency function.How should I do?Thank you!
|
|
|
|
|
Use the AlphaBlend API method, check out MSDN ....
hope this helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi ,
Iam using the following code to load an icon
HICON hIconImage;<br />
hIconImage = (HICON)LoadImage(NULL, MAKEINTRESOURCE (IDR_ICON ), IMAGE_ICON, ICON_SIZE, ICON_SIZE, LR_LOADTRANSPARENT|LR_CREATEDIBSECTION );
But hIconImage is NULL after the loading.
Regards,
FarPointer
|
|
|
|
|
Your first parameter of the LoadImage is
(Taken from MSDN "hinst
[in] Handle to an instance of the module that contains the image to be loaded. To load an OEM image, set this parameter to zero."
so why do you use NULL? use something like AfxGetInstanceHandle()....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
if icon is in resoruce use
LoadIcon(AfxGetApp()->m_hInstance,name icon);
|
|
|
|
|
Hey folks:
If you only want to have one instance of your .exe running, how can you detect that it is already running, and then exit gracefully?
(MFC is OK, but no .NET please), and I'm a noobster so please keep that in mind when answering :P
|
|
|
|
|
Go look at the FAQs on CP. This is an old question and I am sure it is covered in one of them.
INTP
“Testing can show the presence of errors, but not their absence.”
Edsger Dijkstra
|
|
|
|
|
There are lots of ways of doing this. One is to use a mutex (see the CreateMutex API): You call CreateMutex with a unique name (a name which contains a GUID is the smartest choice) to create a mutex. Then if the call succeeds you call GetLastError and if it returns ERROR_ALREADY_EXISTS you're not the first one so you bail. There are ways you can do it using COM also.
Steve
|
|
|
|
|
I think any named kernel object will do, it does not have to be a mutex.
|
|
|
|
|
Yes, there is no need to use a mutex if you prefer some other option. As I said, there are many ways this can be done.
Steve
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
If I had a dollar for every time this question was asked here I could pay off my kitchen remodel ...
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
------ Build started: Project: Project4a, Configuration: Debug Win32 ------
Compiling...
Impl.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(112) : error C2011: 'fd_set' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(54) : see declaration of 'fd_set'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(147) : warning C4005: 'FD_SET' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(88) : see previous definition of 'FD_SET'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(156) : error C2011: 'timeval' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(97) : see declaration of 'timeval'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(212) : error C2011: 'hostent' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(153) : see declaration of 'hostent'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(225) : error C2011: 'netent' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(166) : see declaration of 'netent'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(232) : error C2011: 'servent' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(173) : see declaration of 'servent'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(244) : error C2011: 'protoent' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(185) : see declaration of 'protoent'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(400) : error C2011: 'sockaddr_in' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(321) : see declaration of 'sockaddr_in'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(410) : error C2011: 'WSAData' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(331) : see declaration of 'WSAData'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(470) : warning C4005: 'SO_DONTLINGER' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(411) : see previous definition of 'SO_DONTLINGER'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(527) : warning C4005: 'AF_IPX' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(469) : see previous definition of 'AF_IPX'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(555) : warning C4005: 'AF_MAX' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(488) : see previous definition of 'AF_MAX'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(561) : error C2011: 'sockaddr' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(494) : see declaration of 'sockaddr'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(601) : error C2011: 'sockproto' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(503) : see declaration of 'sockproto'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(640) : error C2011: 'linger' : 'struct' type redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(540) : see declaration of 'linger'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(653) : warning C4005: 'SOMAXCONN' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(553) : see previous definition of 'SOMAXCONN'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(679) : warning C4005: 'FD_READ' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(571) : see previous definition of 'FD_READ'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(682) : warning C4005: 'FD_WRITE' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(572) : see previous definition of 'FD_WRITE'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(685) : warning C4005: 'FD_OOB' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(573) : see previous definition of 'FD_OOB'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(688) : warning C4005: 'FD_ACCEPT' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(574) : see previous definition of 'FD_ACCEPT'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(691) : warning C4005: 'FD_CONNECT' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(575) : see previous definition of 'FD_CONNECT'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(694) : warning C4005: 'FD_CLOSE' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(576) : see previous definition of 'FD_CLOSE'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1626) : error C2375: 'accept' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(744) : see declaration of 'accept'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1647) : error C2375: 'bind' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(749) : see declaration of 'bind'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1666) : error C2375: 'closesocket' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(754) : see declaration of 'closesocket'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1685) : error C2375: 'connect' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(756) : see declaration of 'connect'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1706) : error C2375: 'ioctlsocket' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(761) : see declaration of 'ioctlsocket'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1727) : error C2375: 'getpeername' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(766) : see declaration of 'getpeername'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1748) : error C2375: 'getsockname' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(771) : see declaration of 'getsockname'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1771) : error C2375: 'getsockopt' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(776) : see declaration of 'getsockopt'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1792) : error C2375: 'htonl' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(783) : see declaration of 'htonl'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1809) : error C2375: 'htons' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(785) : see declaration of 'htons'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1826) : error C2375: 'inet_addr' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(787) : see declaration of 'inet_addr'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1843) : error C2375: 'inet_ntoa' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(789) : see declaration of 'inet_ntoa'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1861) : error C2375: 'listen' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(791) : see declaration of 'listen'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1879) : error C2375: 'ntohl' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(795) : see declaration of 'ntohl'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1896) : error C2375: 'ntohs' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(797) : see declaration of 'ntohs'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1916) : error C2375: 'recv' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(799) : see declaration of 'recv'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1941) : error C2375: 'recvfrom' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(805) : see declaration of 'recvfrom'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1967) : error C2375: 'select' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(813) : see declaration of 'select'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(1991) : error C2375: 'send' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(820) : see declaration of 'send'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2016) : error C2375: 'sendto' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(826) : see declaration of 'sendto'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2042) : error C2375: 'setsockopt' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(834) : see declaration of 'setsockopt'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2064) : error C2375: 'shutdown' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(841) : see declaration of 'shutdown'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2084) : error C2375: 'socket' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(845) : see declaration of 'socket'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2107) : error C2375: 'gethostbyaddr' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(852) : see declaration of 'gethostbyaddr'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2126) : error C2375: 'gethostbyname' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(857) : see declaration of 'gethostbyname'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2144) : error C2375: 'gethostname' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(859) : see declaration of 'gethostname'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2163) : error C2375: 'getservbyport' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(863) : see declaration of 'getservbyport'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2182) : error C2375: 'getservbyname' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(867) : see declaration of 'getservbyname'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2200) : error C2375: 'getprotobynumber' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(871) : see declaration of 'getprotobynumber'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2217) : error C2375: 'getprotobyname' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(873) : see declaration of 'getprotobyname'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2237) : error C2375: 'WSAStartup' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(877) : see declaration of 'WSAStartup'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2255) : error C2375: 'WSACleanup' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(881) : see declaration of 'WSACleanup'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2272) : error C2375: 'WSASetLastError' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(883) : see declaration of 'WSASetLastError'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2289) : error C2375: 'WSAGetLastError' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(885) : see declaration of 'WSAGetLastError'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2306) : error C2375: 'WSAIsBlocking' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(887) : see declaration of 'WSAIsBlocking'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2323) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(889) : see declaration of 'WSAUnhookBlockingHook'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2340) : error C2375: 'WSASetBlockingHook' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(891) : see declaration of 'WSASetBlockingHook'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2357) : error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(893) : see declaration of 'WSACancelBlockingCall'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2379) : error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(895) : see declaration of 'WSAAsyncGetServByName'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2406) : error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(903) : see declaration of 'WSAAsyncGetServByPort'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2432) : error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(911) : see declaration of 'WSAAsyncGetProtoByName'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2457) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(918) : see declaration of 'WSAAsyncGetProtoByNumber'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2482) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(925) : see declaration of 'WSAAsyncGetHostByName'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2509) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(932) : see declaration of 'WSAAsyncGetHostByAddr'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2532) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(941) : see declaration of 'WSACancelAsyncRequest'
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock2.h(2552) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winsock.h(943) : see declaration of 'WSAAsyncSelect'
c:\documents and settings\ashu\desktop\project4a\project4a\Sockets.h(126) : error C2079: 'SocketListener::tcpAddr' uses undefined struct 'sockaddr_in'
Build log was saved at "file://c:\Documents and Settings\ashu\Desktop\Project4a\Project4a\Debug\BuildLog.htm"
Project4a - 58 error(s), 11 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
|
|
|
I do not know the answer, but please do no post every error message. Once they start to repeat them selves it becomes redundant and you are wasting sever storage space. You need to figure out why the first error says the type is a redefinition and go from there. If you solve that problem the rest of them will probably go away.
INTP
“Testing can show the presence of errors, but not their absence.”
Edsger Dijkstra
|
|
|
|
|
Redefinition usually means you have included a header file more than once.
Elaine
The tigress is here
|
|
|
|
|
There is an important nuance to note: I think Elaine's answer is correct for the first errors, where redefinition is the problem, but some other errors point out that the multiple definitions have different linkage. This would mean that the multiple inclusions could have some of the conditions change. For example, if this was in a header file:
#ifdef USE_C
extern C {
#endif
typedef struct {
int x;
int y;
int z;
} Vector;
#ifdef USE_C
}
#endif
Then if one inclusion defines USE_C and the other doesn't then you may get the diferent linkage error, because one will declare the structure as C and the other as C++.
Rilhas
|
|
|
|
|
Looks like it's becase your including both "winsock2.h" and "winsock2.h". It looks you're meant to pick one or the other - I'd choose "winsock2.h".
Steve
|
|
|
|
|
I use the class CTreeCtrl Created a Tree Control.
With the member function SetImageList() I can set images to the tree contrl.
Now,I want to change the image in a paticular TREEITEM,and there is no such function.
How can do that?
Thanks
Bruspark
|
|
|
|
|
|
Friends,
I've a property sheet with two property pages. What i want is that, whenever the user tries to swich to the second page, the data in the controls of current page should be validated and if the data is wrong, user should remain in the current page and not switch to the other page. How can i do so ?
Imtiaz
|
|
|
|
|
|
can anyone tell me how do I remove a substring from a string, like i have "abc.xml" and i want to remove ".xml" from it and in turn just get abc. How do i do it?
|
|
|
|
|
Type something like this. Again I haven't tested this.
---------------------------------------
string::size_type LastDotPos = YourString.find_last_of('.');
if ( LastDotPos != -1 )
{
string BeforeDot = YourString.substr(0, LastDotPos);
}
Steve
|
|
|
|
|
can anyone tell me how to check whether a particular substring is present in a given string or not? I have a string containing file name and I have to check whether the file is an xml file or not. So I have to look for ".xml" substring in that given string. How do we do that?
|
|
|
|
|
Try something like this. NOTE: I haven't tested this so your mileage may vary:
----------------
string::size_type LastDotPos = YourString.find_last_of('.');
if ( LastDotPos != -1 )
{
string Extension = YourString.substr(LastDotPos);
transform(Extension.begin(), Extension.end(), Extension.begin(), ::tolower);
if ( Extension == ".xml" )
{
// Ends in ".xml".
}
}
Steve
|
|
|
|