|
thanks
the good thing about log4cpp was that it would just dump it to a file.
You can then go and read the file whenever you want.I think the file had various formats too(text,xml, etc..)
|
|
|
|
|
Did you overlook the CTraceList::setToDisk() and CTraceList::doSave() functions?
|
|
|
|
|
Use the Event Logging API - that's what it's there for.
See :
- ReportEvent()
- General-System-Event Logging on this site
I used to have a home rolled text file based logging class i used for years, but after switching to the Event Logger i can't see myself going back (except on WinCE where it isn't supported .
...cmk
|
|
|
|
|
hi
thanks
Eventviewer is good, but you don't want to log everything in it. For that kind of intense logging, something like a simple text file might be better.
|
|
|
|
|
I have been looking for something like this for a long time. There are several logging programs on this site and other places that I have tested but they all seem to lack some feature that I need and I just end up giving up on the idea. Let me know if you find anything good.
Thanks,
John
|
|
|
|
|
I have a DLL that communicates with a USB device. There is a function that people can call to make this communication happen (called GetAll). When the function GetAll is called, I create a dialog using DialogBox. It's a standard pop-up dialog with a progress bar to show the current operation.
However, if I unlpug the device I'm communicating with mid-way through, I close the current dialog box (with EndDialog) then open a new one (using DialogBox) to show the error message to the user. When I press OK, the system seems to get lost and never returns to the next line after the 2nd DialogBox call. This also occurs if I call MessageBox in pace of the 2nd DialogBox call.
Any suggestions on what's going on here?
Regards
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
One solution is to make sure the DLL terminates the communication process upon an error. Does the DLL spawn a worker thread?
Kuphryn
|
|
|
|
|
Hi,
can anyone tell me how to, (or show me an article which shows how to), use resizable columns in my apps. I mean columns like those in MS excel, where you can drag them to any size you want.
Thanks....
|
|
|
|
|
If you are using MFC, you'll want to use the CListCtrl (or CListView) class. Otherwise, create a SysHeader32 control on top of a SysListView32 control.
|
|
|
|
|
Hi,
I have something like:
Object* MyClass::MyFunction(int value)
{
Object* pObj = new Object(value);
if(!pObj)
return NULL;
else return pObj;
}
do I have to delete pObj? and if I have to delete it, how can I do it? Do I need to call a delete everytime everywhere?
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
You could have written:
CObject* MyClass::MyFunction(int value)
{
return new Object(value);
}
As new returns NULL if the allocation fails.
That said, what you are doing is bad coding practice as whoever calls the function needs to remember to delete the returned pointer, and its possible to use a function in such a way that you don't get a copy of the returned pointer, as it would get assigned to a temporary. So its very bad practice. See if you can do it in some other way.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
The gold rule: if you use new you must delete, if you use malloc you must free...
but the other person who has answered is right, it is a bad coding style, it can lead to lots of errors if the coder is not aware of that...
Hope this helps.
|
|
|
|
|
Hi!
I'm writing an app in VC++ 6 that uses ADO through the #import directive.
There are an unknown number of predefined queries in the database (access)
witch I need to execute and I wonder if there's a way of retrieving the
names of those queries using ADO.
I'm using a Connection Object and a RecordSet Object to obtain the results
of the queries but how can I obtain the queries?
thanks
/Anders
|
|
|
|
|
I believe that these are presented as Views to ODBC, so in an ODBC world, you would use SQLTables(...,"VIEW").
In the ADO world, I think that that translates to the OpenSchema method of the Connection object, passing adSchemaTables as the query type and "VIEW" for the criteria TABLE_TYPE.
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
Thanx for your reply. I'll try that but how can I tell the difference between a returned table and a returned query? Any Idea?
/regards Anders
|
|
|
|
|
Hmm, or maybe you meen that "VIEW" corresponds to queries only?
I guess I'll find out when I try it. Thanks for your help!
regards
/Anders
|
|
|
|
|
Hello
A colleague of mine told me not to use WaitCommEvent() since it's not 100% reliable.
Can anyone back this up?
Thanks,
Jonas
|
|
|
|
|
I had a problem recently on comEvReceive. About once in 3 million times it would OnCommEvent would be called for this but a character had not been recieved so I had to put a condition in my code to cover this.
Elaine (serial fluffy tigress)
The tigress is here
|
|
|
|
|
I want to realize splitter window in mfc extention dll. and i did so
1.Derived a class from CFrameWnd named "CMyFrame"
2.Derived a class from CView named "CMyView"
3.use construct function to declare a frame
CMyFrame myframe
4.Create myframe
myframe.Create(...)
5.Create view
myframe.CreateView(...)
when i execute the project ,there appears seriou error
can you tell me what is wrong?
note:in the function myframe.Create(...),
i set the parameter pContext = NULL. if the parameter can not be set with NULL,where i can get createcontext,because i do all above in extension dll
|
|
|
|
|
I need to reset an ata/ide device, but don't know how to do this. Anyone knows how to do this?
|
|
|
|
|
is it possible to bind a keyboard key [left alt] to a usb controller button?
im working on a project for school and i'v done tons of work and now i cant proceed with out doing this...ugghh im screwed. if anyone could help me that would be amazing.
im running win98 right now.
if you need anymore info i can do so.
thanks.
|
|
|
|
|
I have a LPSTR variable and I need to use the Split method to extract the necessary data.
|
|
|
|
|
Split() is part of VB and JScript. I'm not familar with it in C/C++. Either way, the first parameter is a string or an instance of a Regular Expression object identifying one or more characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. The return value is an array of strings split at each point where separator occurs in the source. The separator is not returned as part of any array element.
|
|
|
|
|
I've never used it, but I would image that the string class from the STL would accomodate you.
|
|
|
|
|
Two methods to consider are using the strtok function or simply doing it yourself in a loop like this:
void ProcessEMailAddresses(char *cpEMailAddresses)
{
char *cpDelimiter;
char *p = cpEMailAddresses;
char caEMailAddress[256];
while (p && *p)
{
caEMailAddress[0] = 0;
cpDelimiter = strchr(p,';');
if (!cpDelimiter)
cpDelimiter = strchr(p,','); // check for comma separator
if (cpDelimiter)
{
memcpy(caEMailAddress,p,cpDelimiter-p);
caEMailAddress[cpDelimiter-p] = 0;
}
else
{
strcpy(caEMailAddress,p);
}
if (caEMailAddress[0])
{
// process it!
}
if (cpDelimiter)
p = cpDelimiter + 1;
else
p = NULL;
}
}
<marquee SCROLLAMOUNT=3 scrolldelay=80 direction=right width=40% style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...</marquee>
|
|
|
|