|
Usefull the information was but it was not what I was looking for.
This information can be set by right click, properties, summary tab. Where is this infomration stored and how does one retreive the information?
|
|
|
|
|
Hi Kaptain Krunch,
Please list file extensions.
Thanks,
Jeff
|
|
|
|
|
They can be TXT, PDF, DOC, BAT and so on. I don't think that its related to the file extension as any file I check has the properties/summary tab. This is on XP anyway.
|
|
|
|
|
|
Hi,
I have stored some data into vector
<br />
std::vector<Item *> m_cache;<br />
std::vector<Item *>::iterator m_iterator ;<br />
Can you please let me know how to clean this vector.Currently i am doing m_cache.clear();however it is not deleting the memory allocated for the Item * element.
Thanks
-- modified at 12:29 Tuesday 1st November, 2005
|
|
|
|
|
you need to iterate the vector to delete each item.
std::vector<Item *>::iterator m_iterator = m_cache.begin();
while ( m_iterator = m_cache.end() )
{
Item* p = *it;
delete p;
++it;
}
but some STL guru might give you an single line algorithm to do this.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
std::vector<>::clear() just set the vector empty.
you would have to iterate on each element of you container to delete it first, the call clear()
for example :
std::vector<Item*> m_cache;
std::vector<Item*>::iterator m_iterator;
for (m_iterator = m_cache.begin(); m_iterator != m_cache.end(); m_iterator++) {
delete (*m_iterator);
}
m_cache.clear();
another solution, much object oriented however, would be to create you how vector-derived type, and overload the clear() function with the code above...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 12:37 Tuesday 1st November, 2005
|
|
|
|
|
well thank you for your help however i think it should be
<br />
for (CACHE_ITERATOR it = m_cache.begin();it != m_cache.end();it++)<br />
{<br />
delete ((Item *)*it);<br />
}<br />
m_cache.clear();<br />
|
|
|
|
|
|
I need some help. I’m working on a project with some schools that involve Windows and “hosts” file work. The network I’m working on requires several pre defined domains that need to be assigned to a different IP address which is achieved through using the hosts file.
The problem that I’m running into is that a hosts file over 150K will start to crash the Dnscache service under Windows 2000 and XP. I have to disable this service in order to have everything work. The problem with doing this is that resolving a host without Dnscache has considerable latency issues and an overall slow connection time without the Dnscache service running. It doesn’t matter if the hosts file is 1K or 300K, without DNS caching, it is very slow.
I would very much appreciate it if someone could assist me or even just write a small C or C++ win32 console app that can be run and installed as a service through the command line using the “sc config” and “net start” commands. It would need to be able to replace the Dnscache “dnsrslvr.dll” service. This service is nice but not very robust when it comes to actually using the hosts file for what it was designed for.
Really, it doesn’t have to load the whole hosts file into memory like the Dnscache “dnsrslvr.dll” service does. All this program would need to do is pre allocate a small chunk of memory and then just monitor domain name requests. When the IP address is returned from the DNS server out on the web or from the hosts file, it would just need to cache it into memory. The initial connection would still be the time required to ask the DNS server or hosts file for the IP address but after that, the site would load faster because all of the graphics, applets and so on would already be pointing to the IP address.
I would even be willing to compensate a bit for the time spent doing this. I know time is valuable. Please contact me at jamie@unitedcomputerservice.com
I will also keep checking the post here. Thank you in advance for anyone who could help me in this effort. I write code but this one is a bit out of my area to be comfortable. Is there any way that someone could help?
|
|
|
|
|
Hello,
I found this program online. I think it might be written in C.
Can someone convert this to Visual C++ for me?
I would like to show my wife that she cannot visualize what a googolplex is.
Thanks,
Eric
<br />
#include <stdio.h><br />
#include <stdlib.h><br />
<br />
int main (int argc, char *argv[])<br />
{<br />
int *vals, *ptr, max;<br />
<br />
if (argc == 2)<br />
max = atoi (argv[1]);<br />
else<br />
max = 100;<br />
<br />
printf ("1");<br />
<br />
if ((vals = malloc ((max + 1) * sizeof (int))) == NULL) {<br />
fprintf (stderr, "Error allocating memory.\n");<br />
return 1;<br />
}<br />
<br />
memset (vals, '\0', (max + 1) * sizeof (int));<br />
<br />
while (!vals[max]) {<br />
*(ptr = vals) += 1;<br />
<br />
while (*ptr == 10) {<br />
*ptr++ = 0;<br />
*ptr += 1;<br />
}<br />
<br />
printf ("0");<br />
}<br />
printf ("\n");<br />
free (vals);<br />
return 0;<br />
}<br />
<br />
|
|
|
|
|
AFAIK, it's impossible to represent a googolplex, it should be bigger than the largest number you can think of ...
much bigger than 100 digits in a number.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
ericelysia wrote: Can someone convert this to Visual C++ for me?
Why? What significance would objects, encapsulation, inheritance, abstraction, or polymorphism have on this? Why not just write 1010100 on a piece of paper and show that to her?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I just want her to see all of the zeros going and going and going.
Is that what that C code is doing (100 ^ 10 ^ 100) ?
If so, why does it look more complex?
Thanks,
Eric
|
|
|
|
|
ericelysia wrote: I just want her to see all of the zeros going and going and going.
printf(" 100\n");
printf(" 10\n");
printf("100 = 1");
int i = 0;
int j = 0;
for (i = 0; i < 100; i++) {
for (j = 0; j < 100; j++) {
printf("0");
}
}
this will print the following :
100
10
100 = 1000000000000...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 12:39 Tuesday 1st November, 2005
|
|
|
|
|
ericelysia wrote: Is that what that C code is doing (100 ^ 10 ^ 100) ?
I did not look at the code that close, but a googleplex is 10 raised to the power of a google, or 10 ^ (10 ^ 100).
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
some already answered you, but my question is much based on the code.
why do you want to convert this sample into "Visual C++" code ?
if it is C, it will compile. just copy it into a .c file instead of a .cpp...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
OK, thank you. I did not know that. That's what I will do.
I would also like to be able to understand the code. Is the C version of this program much different from the C++ version?
Eric
|
|
|
|
|
ericelysia wrote: Is the C version of this program much different from the C++ version?
C++ when created wanted to conserve with few exceptions the C language as a subset.
so, C code will mostly compile on a C++ compiler...
now, if you'd really like to change it into pure Standard complient C++, you would have some little changes such as malloc with new , free with delete , using classes, namespaces, etc...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thank you for your time.
Eric
|
|
|
|
|
My application is using Windows Media Device Manager 10 SDK to interface with portable devices. Which my app will download wma to device with bit rate such as 32kbps, etc. However, there are certain portable devices only support 48kbps and up. So, I hope that before downloading, my app could tell if the plug-in device got the capability to play with the low bit rate wma files.
IWMDMDevice::GetFormatSupport() is where I started but it lead me to nowhere. Anyone has idea about this? Or simply it is just cannot tell the bitrate supported by a portable device? Thanks in advance.
|
|
|
|
|
Hi All
I looking API of MFC method to find current file version (special build description) .
[I have pointer to this current file].
Can someone help me ??
Thanks.
-- modified at 10:00 Tuesday 1st November, 2005
|
|
|
|
|
|
Looking though some people's code I often see if statements of the form
if (23 == x)
rather than
if (x == 23)
Is there any reason for doing this? I'm sure there is !!!
|
|
|
|
|
It is to prevent typo errors,
if (x=23)
will compile and do undesired things, assign x the value of 23 and always be true
if (23=x)
will not compile
its good practice to put the constant on the left and variable on the right
|
|
|
|