|
That was more or less my answer, but I have to agree that yours is more elegant
|
|
|
|
|
The basic_string::size() returns array size of <element> but not always the same to the character length.
Some new characters have 4 bytes (means wchar_t[2]) in each one character at the new unicode specification named JIS2004 in Japan.
They are so called surrogate-pair and someone said some characters have 6 bytes in some other countries. (I have not checked the specification yet. )
|
|
|
|
|
Do you mean you want to write the wstring to a file? With the null-terminator? Or what?
Anyway - the amount of memory taken up by the string data (i.e. the characters pointed at by the c_str() or data() methods) is size() * sizeof (std::wstring::value_type) (not including the null terminator).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Why am I getting this error?
Error 1 error C2228: left of '.checked' must have class/struct/union
Here's my code.
UpdateData(TRUE);
m_Summary += m_Name;
m_Summary += char(13);
m_Summary += char(10);
m_Summary += m_Address;
m_Summary += char(13);
m_Summary += char(10);
m_Summary += m_Phone;
if (m_Small.checked==true)
{
m_Summary += "Small Size 5.00";
}
UpdateData(FALSE);
|
|
|
|
|
Ryuk1990 wrote: if (m_Small.checked==true)
{
m_Summary += "Small Size 5.00";
}
How is m_Small declared?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
When I do view declaration, it shows me this code.
public:
int m_Small;
|
|
|
|
|
Ryuk1990 wrote: Error 1 error C2228: left of '.checked' must have class/struct/union
That is exactly what the error says.
Fundamental data types do not have any members that you can call that way.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
So how should the code be rewritten?
|
|
|
|
|
That totally depends on why m_Small was declared.
My guess would be
if (m_Small == true)
or
if (m_Small == TRUE)
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
use a #define and then do the checking.
|
|
|
|
|
Hi,
Using Vc++ how would i know whether i have inserted disk in the Drive of my machine ..and if inserted how can i get the drive in which i inserted the disk...
|
|
|
|
|
|
You do not need to call RegisterDeviceNotification .
You simply handle the WM_DEVICECHANGE message.
The system broadcasts the message to all top level applications.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Superman is correct in that you simply need to handle the WM_DEVICECHANGE message. I thought you might be interested in the Microsoft support article below:
How to receive notification of CD-ROM insertion or removal[^]
It also describes how to detect the CD/DVD removal by checking for the DBT_DEVICEREMOVECOMPLETE event.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi
I'm new to programming - but do use AHK a lot
Where do I start learning?
Is there a tutorial or disucssion board for n00bs?
Thanks
|
|
|
|
|
Learning CPP language wrote: Where do I start learning?
Books, Web sites, etc. Pick up a free compiler (e.g., Visual Studio Express) and just start tinkering.
Learning CPP language wrote: Is there a tutorial or disucssion board for n00bs?
Yes, the one you are on now is for C / C++ / MFC.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi I have a machine with several network interfaces that route through different NAT VPNs.
I've created a testing application that bind()s to one of these interfaces before calling connect(), which works excellent in Windows 7. When I try the same thing in Windows XP, bind() succeeds, but connect() fails with 10065 (WSAEHOSTUNREACH) after some seconds of blocking. I checked Wireshark, and there isn't even one single packet sent/received on each interface.
Any ideas what may be the problem?
Don't try it, just do it!
|
|
|
|
|
OK, this is probably a stupid question (so I won't be unhappy if I get a stupid answer ) but are you sure the host is reachable through that interface on the XP host? Have you checked with some other network application?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
 yea it is reachable. When i switch the default gateway to the interface i want to use i can reach the hosts.
the routes should be fine.
===========================================================================
Schnittstellenliste
0x1 ........................... MS TCP Loopback interface
0x2 ...00 0c 29 70 8c 43 ...... VMware Accelerated AMD PCNet Adapter - Paketplaner-Miniport
0x10004 ...00 0c 29 70 8c 39 ...... VMware Accelerated AMD PCNet Adapter
===========================================================================
===========================================================================
Aktive Routen:
Netzwerkziel Netzwerkmaske Gateway Schnittstelle Anzahl
0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.28 1
0.0.0.0 0.0.0.0 192.168.179.1 192.168.179.130 100
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.178.0 255.255.255.0 192.168.178.28 192.168.178.28 1
192.168.178.28 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.178.255 255.255.255.255 192.168.178.28 192.168.178.28 1
192.168.179.0 255.255.255.0 192.168.179.130 192.168.179.130 100
192.168.179.130 255.255.255.255 127.0.0.1 127.0.0.1 100
192.168.179.255 255.255.255.255 192.168.179.130 192.168.179.130 100
224.0.0.0 240.0.0.0 192.168.178.28 192.168.178.28 1
224.0.0.0 240.0.0.0 192.168.179.130 192.168.179.130 100
255.255.255.255 255.255.255.255 192.168.178.28 192.168.178.28 1
255.255.255.255 255.255.255.255 192.168.179.130 192.168.179.130 1
Standardgateway: 192.168.178.1
===========================================================================
Ständige Routen:
Keine
Don't try it, just do it!
|
|
|
|
|
I think I've found the reason..
http://technet.microsoft.com/en-us/magazine/cc137807.aspx
Windows XP uses weak host model, Vista and later strong host model. There doesn't seem to be a way to configure this in Windows XP which is particularly ANNOYING!!
Don't try it, just do it!
|
|
|
|
|
Woah - your network-fu is way stronger than mine
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Heya,
So I am trying to work on a make environment that will let me create two libraries and then link against them.
The procedure goes like this:
1. create obj files for lib1 (about a dozen files):
*** Compiling .obj/common.o ...
g++ -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -I./proto -I/tmp/protobuf-2.1.0/include -I/tmp/protobuf-2.1.0/include/google/protobuf -I/tmp/protobuf-2.1.0/include/google/protobuf/io -c proto/common.pb.cc -o .obj/common.o
2. group the object files together into archive
ar rcs lib/libxproto.a ./.obj/cs_enums.o ./.obj/common.o ./.obj/converged_common.o ...<obj list="">
3. repeat for the second lib.
4. compile a few other objs for MY program:
*** Compiling ../BuildSupport/ExternalLinks/utilities/src/Thread.C ...
g++ -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -I./include -I../BuildSupport/ExternalLinks/utilities/include -I./proto -I/tmp/protobuf-2.1.0/include -I/tmp/protobuf-2.1.0/include/google/protobuf -I/tmp/protobuf-2.1.0/include/google/protobuf/io -I/tmp/OpenAMQ-1.4b3/ibase/include -I../BuildSupport/ExternalLinks/boost/include/boost-1_39 -I../BuildSupport/ExternalLinks/utilities/include -I../CaddyShack_Common/amq/include -I../CaddyShack_Common/id/include -c ../BuildSupport/ExternalLinks/utilities/src/Thread.C -o .obj/Thread.o
5. the final step is to compile the objs into an executable, link against the libs:
g++ -static -O3 -MMD -pipe -pthread -D_REENTRANT -DICL_MEM_DEFAULT_DIRECT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DBASE_THREADSAFE -march=native -Wall -Wno-write-strings -Wpointer-arith -Wno-ctor-dtor-privacy -Wmultichar -Wdisabled-optimization -Woverloaded-virtual -Wclobbered -Wempty-body -Wsign-compare -Wtype-limits -Wno-unused -Wuninitialized -L./lib -lxamq -lxproto <obj list=""> -o ../bin/circuit_accelerator
I get the following error:
./lib/libxamq.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
I tried using ranlib after it, and then just relinking still no good. I also am using the 's' flag when doing the ar, meaning i shouldn't have to do a ranlib.
any ideas on why i would be getting this error? Any ideas on how to resolve it? Thanks in advance!!!
|
|
|
|
|
Are you sure that this is the correct linking order: -L./lib -lxamq –lxproto?
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word.
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
I would investigate any difference in the build processes of libxamq.a and libxproto.a - it looks like ld can find an index in libxproto.a...
Also - I presume you've deleted libxamq.a and rebuilt it from scratch?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Figured it out!!!!
I was using the $< flag for a gcc build in the makefile. I had added a dependency and on some *.h files, meaning that gcc was now trying to compile those, creating some kinda bogus obj files. Thus the lack of an object index....I officially hate makefiles, and feel like an ass. Thanks soo much!
|
|
|
|