|
Hi,
I am supposed to develop an application(yet to be done)which continuosly monitor the Application log in Windows 2003 and Windows 2008 servers (both seperately).
When ever an event is logged in the Application log corresponding event source, id and description is obtained and displayed in to the screen.
I have refferred MSDN and found that the notifyChangeEventLog() method will do this.
I have tried out a sample and was able to get event id alone, but not event source and event description.
Can some one please tell me how to obtain event description and source using c++ program.
Also please suggest me the best solution to develop this application.
Thanks in Advance
ARD
|
|
|
|
|
HI,
i have a TabCtrl which is created using Create function(using control variable) but not using resource...
Now how can i increase the font inside the TabCtrl
|
|
|
|
|
hello,
I want to read .csv files but the following code read many lines more than required.
std::ifstream DataStream(FileToRead);
istreambuf_iterator<char> iter(DataStream.rdbuf());
istreambuf_iterator<char> end_of_stream_iterator;
int NOOFCHAR =10;
char temp[255];
CString h ;
int ct =0;
while(!iter.equal(end_of_stream_iterator) )
{
vector<CString>v;
for(int i=0;i<FileObj.NumCols;i++)
{
DataStream.get(temp,NOOFCHAR,',');
DataStream.ignore(1,',');
h = temp;
v.push_back(h);
}
ct++;
DataStream.get(temp,NOOFCHAR,'\n');
iter++;
}
In the above code I should ct = 2331 but I get the valu of ct = 198520
what must be wrong . and why the program doesnt end at line no 2331
Pritha
|
|
|
|
|
prithaa wrote: and why the program doesnt end at line no 2331
Where are you telling it to end at line 2331?
Have you used the debugger to step through the code to see if you agree with what it is considering a line?
"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
|
|
|
|
|
why it's necessary to create iterator for a file buffer? you don't need to deal with internal buffer of a file. You can simply use other stream, string classes to get your task done. Just see a sample code below. it's plain and clear no? (Sorry it's not written myself. taken from some forums)
#include <iostream>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int main ()
{
ifstream inFile ("csv.dat");
string line;
int linenum = 0;
while (getline (inFile, line))
{
linenum++;
cout << "\nLine #" << linenum << ":" << endl;
istringstream linestream(line);
string item;
int itemnum = 0;
while (getline (linestream, item, ','))
{
itemnum++;
cout << "Item #" << itemnum << ": " << item << endl;
}
}
return 0;
}
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
thank you
for your replies
|
|
|
|
|
Hi All,
I have a com dll which i want to use without registering it so is it possible? i tried it this way but while trying to call its functions i am not getting its reference....
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Check this![^]
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
hi,
i read all the menifest stuff required...so there is no other way accept suggested one to do the thing...
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Hai All,
I have a shared folder in WAN(windows server 2003) and I have to access that folder through programming by hard coding the credentials(from windowsXP).
Regards
ranjith
|
|
|
|
|
The suspense is killing me. What's the question?
"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
|
|
|
|
|
|
Thanks for response
I have a shared folder in server ,I have to access the files from that folder to client system ,If we open that file directly it's asking username ,password of server .
My requirement is client should not know the server's password,we have to hard code the username and password.
Thanks®ards
Ranjith
|
|
|
|
|
Can you use NetUseAdd() ?
"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
|
|
|
|
|
Look for the ::WNetUseConnection()-API. The similar use is deomstrated here:
http://www.codeproject.com/KB/cpp/DrivesManager.aspx
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
sir
please send me coding in C for K-Nearest Neighbour algorithm for calculating
the distance between the training data(in binary or run-length encoded) and
test data ib the same format for hand written pattern recognition.
thank u
|
|
|
|
|
See here.
"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
|
|
|
|
|
|
I want select a certain area from an image, and I kenw in cximage exits selection layer,I wonder if the pointer "pSelection" is can be used to point to part of the image,not the whole image.
and the function BYTE* selectionGetPointer(x,y)
Suppose I gave the start coordinates x,y of a area,
if the return value can be regared as the pointer which points to the beginning pixels of a selectiron area ??
|
|
|
|
|
I have a service x dependent on a service y.
When I reboot the workstation the service x is started after y is started.
Soon service x dies out. Now I need to restart the service x for it to be up and running.
Any known issues with this type of behaviour please let me know?
|
|
|
|
|
tom groezer wrote: Now I need to restart the service x for it to be up and running.
Any known issues with this type of behaviour please let me know?
Sounds reasonable.
"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
|
|
|
|
|
In normal scenario of what is the expected behavior this dependent service need not to be restarted after it dies out on a reset. This is erroneous behavior. What could be the possible reasons for this?
|
|
|
|
|
Hi,
I have an MFC application.
I run a thread in middle. After completing the thread i have a message box that popsup. But messagebox doesnt have focus.
Can anyone let me know how to get the focus back to message box? Thanks in advance.
Code snippet:
....
RunCmd("test.bat", SW_SHOW);
MessageBox("dfas","fdifd",MB-OK);
.....
Test.bat has come command to format disk etc.
Regards..
|
|
|
|
|
|
Thanks for the reply. But that doesnt have the answer for my problem.
After launching a thread and completing the foucus is not going to main window.
In a dialog based application, I run:
WinExec("test.bat");
Sleep("5000");
MessageBox("sdosn"....);
MessageBox is not having focus. If i remove Thread executions in between (WinExec). Then i get the focus properly.
Any updates on this.
|
|
|
|