|
hmm, that solution seems nice, but the compiler gives me a C2683: "'node' is not a polymorphic type"
|
|
|
|
|
Ok, a polymorphic type is a class or struct that has virtual functions. The easiest way to make your node struct polymorhic is to add a virtual destructor
struct node
{
string label;
node *next;
virtual ~node() {};
}; You will also have to enable RTTI (run time type information) by setting the /GR compiler option (may already be done).
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
How can I get the path of "Temporary Internet Files" of the current user?
|
|
|
|
|
|
|
Hmmmmm,
I dont get it to work can you please send me a code exemple?
|
|
|
|
|
Which doesn't mean a whole lot if you do not provide any context. Do you get a compiler error? Linker error? Runtime error? Fired assertion? Unhandled exception? How about a code snippet of what you have and what it is doing?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yeah here Is sample Code
TCHAR szInternetCachePath[MAX_PATH];
if(SHGetSpecialFolderPath(
NULL,//hwndOwner
szInternetCachePath, // lpszPath
CSIDL_INTERNET_CACHE ,// nFolder
FALSE /// fCreate: so you want to create that
))
{
MessageBox(szInternetCachePath,"You Internet cache folderpath");
}
else
{
MessageBox("Soory I am Failed");
}
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
|
I am creating an email client using c++ builder 6, but am having problems with the NMSMTP component. I am specifying the recipients address (using the NMSMTP1->PostMessage->ToAddress->Text=Edit1->Text; command) but am getting the error - '503 no recipient(s).' when I try to send an email. The program stops when it tries to run the NMSMTP1->SendMail(); command.
Any help would be greatly appreciated.
Cheers
Phil
|
|
|
|
|
I am running into something of a problem when I open one too many documents with my application. The application no longer opens any dialogs such as the new or open dialog windows. I get a system ping whenever I try to open a document in VC++ if I am running under debug and windows explorer is almost completely locked. I can click folders but it quickly goes back to the folder selected therefore doing nothing. I think the CPU meter from the Windows Task Manager is peaked at 100% but I have no way of checking where in the code things seem to be hung up. The system ping sounds like an error window but there isn't an error window appearing.
Anyone have any ideas? May I be outextending the memory? I have Database ADO connections open but I have programmed them to only have the focused window have connections to the database. The other windows will close the database connections until focused.
Hopefully I have given enough info.
Thanks!
|
|
|
|
|
This looks more like resource exhaustion rather memory exhaustion; I’ve seen similar behaviour when applications create too many socket connections with dedicated threads serving such socket connections.
|
|
|
|
|
Can you elaborate a little? I'm slightly confused. Resource as in Dialogue resource? Database connection resource? There isn't any internet logic nor do I think I have coded thread logic. I'm just trying to figure out where I should be looking in my code for this issue. I stepped through and noticed that the OpenDocument method will parse through fine however when it returns from this method into whatever method called it, then it starts to act this way.
Thanks!
|
|
|
|
|
Hi all,
I am trying to write a driver for a USB device. I have taken the following steps:
> Built checked version of BulkUSB from DDK samples.
> Adapted the .inf file provided with the sample so that the vendor and product id match those of the device I'm writing the driver for.
> Installed the driver using the wizzard - this seems to work fine and the device is reported as working properly.
However, no debug messages come out of the system, no matter what I do with the device (unplug/insert/attempt to connect etc).
Can anyone see anything I may have missed?
Thanks in advance,
Simon
|
|
|
|
|
What about checking if the drivers was loaded?
Don't try it, just do it!
|
|
|
|
|
|
Where did you expect to receive debugger message? You have to have some debugging monitor. I used MONITOR (Vireo Software) before 5 years which displays of debug output from device drivers, and provides driver loading/unloading facilities for Windows 95, 98, and NT. On Windows NT, a supporting kernel mode driver (DBGMSG.SYS) captures debug output sent to DbgPrint.
Now, I think you can find something similar on www.osr.com or through a seek on internet.
|
|
|
|
|
I am strugling with how to send or recieve the SIP request and responses, I want to know how they are done in VC++.
Thank you
|
|
|
|
|
hiho@ll
i have a little problem with malloc and realloc! (i must use it! can't use new or delete)
i have a struct which holds some information of a url
struct info{
char *info1;
char *info2;
};
and i have a array of those structures:
struct info **myurlinfo;
ok now i want to dynamically allocate and expand the array with malloc, realloc.
my code:
myurlinfo=(info**)malloc(sizeof(struct info*));
and later
myurlinfo=(info**)malloc(sizeof(struct info*));
and then the array elements
myurlinfo[i]=calloc(1,sizeof(struct info));
this works 3 times and then i get a heap exception
why?
i'm sure i have an allocation bug in my code
but whats wrong?
thx@ll
|
|
|
|
|
I think you are messing up with pointers :
ThinkingPrometheus wrote:
and i have a array of those structures:
struct info **myurlinfo;
No, there you don't have an array of those structures but an array of POINTERS to these structure. Why do you want to use an array of pointers instead of an array of structure ??
You could simply do that:
struct info *myurlinfo;<br />
myurlinfo=calloc(3,sizeof(struct info));<br />
for example to allocate an array of three structures... Then to access one of these structures:
myurlinfo[0].info2 (or [1] or [2] depending of the structure you want to access to)
Notice also that the members (info1 and info2) of your structures are not initialized yet so they point to invalid memory locations. It would be easier to use fixed sized arrays:
struct info{<br />
char info1[255];<br />
char info2[255];<br />
};<br />
In this case you won't need to allocate and free the memory yourself (you need to be sure of course that the strings won't be longer than the size you provided...)
Hope this helps
|
|
|
|
|
ok
hmm
it works for the malloc,
but it doesn't for the realloc
the problem is that i don't know how big the array will be
and the reason why i used struct info **myurlinfo was that i give it to a function
which means out of my function i use struct info *myurlinfo;
and to change the array i have to use in the function struct info **myurlinfo
i try to allocate the memory first with malloc();
(*myurlinfo)=(struct urlinfo*)malloc(sizeof(struct urlinfo));
and if i need a bigger array
realloc(*myurlinfo,sizeof(struct urlinfo));
first i had
(*myurlinfo)=(struct urlinfo*)realloc(*myurlinfo,sizeof(struct urlinfo));
but realloc returns a pointer to the NEW allocated buffer
but i need to resize the array
so it must be
realloc(*myurlinfo,sizeof(struct urlinfo));
but it doesn't work
if i resize the *myurlinfo i get a memory exception
why!?
thx
|
|
|
|
|
Are you sure you don't need something like this:
struct info
{
char *info1;
char *info2;
} *myinfo;
void main( void )
{
myinfo = (struct info *) malloc(sizeof(struct info) * 100);
myinfo[0].info1 = (char *) malloc(256);
myinfo[0].info2 = (char *) malloc(256);
strcpy(myinfo[0].info1, "some text here");
strcpy(myinfo[0].info2, "some more text here");
myinfo[1].info1 = (char *) malloc(256);
myinfo[1].info2 = (char *) malloc(256);
myinfo[2].info1 = (char *) malloc(256);
myinfo[2].info2 = (char *) malloc(256);
...
myinfo[99].info1 = (char *) malloc(256);
myinfo[99].info2 = (char *) malloc(256);
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
well
i think i needed both
thx@ll
|
|
|
|
|
Hi,
How do I get the following info
1.Data packets in per second
2.Data packets out per second
3.Errors for receiving packets per second
4.Errors for sending packets per second
5.Collisions per second
Advace Thanks.
dadsadasd
|
|
|
|
|