|
I am still wondering what exact mistake i was doing, all flags were set properly.. let me check in detail so I wont make it in future.
Thx so much again. !
Regards,
Supriya Tonape.
|
|
|
|
|
Also, if you remove the "WHERE LogonType = 2 OR LogonType = 10"
from the outer query, you can see all logon sessions, not just the
interactive ones.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yup Mark.
You really made my day U have gr8 weekend ahead!
Best Regards,
Supriya.
|
|
|
|
|
Supriya Tonape wrote: U have gr8 weekend ahead!
Thank you....you too!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Also in this code though I have kept 'logontype' as 2 and 10 to get only active user names, but it;s returning me all users those are Disc earlier...
|
|
|
|
|
Supriya Tonape wrote: but it;s returning me all users those are Disc earlier..
Which means what?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
actually i will check it.. I just need usernames who has active session.
|
|
|
|
|
Hi Mark,
I just realized that 2nd query which forms like "Associators of {Win32_LogonSession.LogonId=1121214} Where AssocClass=Win32_LoggedOnUser Role=Dependent" works for local machine but when I try to execute it on remote machine after above query executes, at next line it fails... Query execution passes but enumeration fails.. at below line,
HRESULT hr1 = pEnumerator1->Next(WBEM_INFINITE, 1, &pclsObj1, &uReturn1);
I have been trying different things to check out but no luck, any idea why it cud be happening or is there any change in query while running on remote machine ?
Regards,
Supriya Tonape
|
|
|
|
|
Hi All,
For some reason, when I add the following lines, to get the StartTime property value, the get function fails. Any ideas?
VARIANT vtProp2;
HRESULT hr2 = pclsObj1->Get(L"StartTime", 0, &vtProp2, 0, 0);
if(hr1 == S_OK)
{
SYSTEMTIME t;
int res = VariantTimeToSystemTime(vtProp2.dblVal, &t);
}
|
|
|
|
|
Hello, I read the MSDN but there were no example and I didn't completely understand how to use it.
I have two threads that both send data to the other thread and receive data from it.
Should I create IoCompletionPort in both threads and use ReadFileEx and WriteFileEx t read and write to/from the i/o completion port?
I'm confused because in MSDN has said that one shuld not use ReadFileEx & WriteFileEx. It says
<quote>
"After an instance of an open file is associated with an I/O completion port, it cannot be used in the ReadFileEx or WriteFileEx function."
Then How should I read and write to I/O Completion port? I'm confused can someone explain a bit please.
thanks.
|
|
|
|
|
Read this excellent article[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
I don't know anything about it, nor have I heard of it.
This is the closest thing I can find in MSDN:
About MSHTML[^]
If that's completely unrelated, then please kindly disregard
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
How do you know it exists?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That was lame - it wasn't Microsoft interface at all.
Sorry.
|
|
|
|
|
cool. Amazing there's NO Google hits on it!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Member 2845784 wrote: That was lame
Hehe. I would suggest a Lame forum that we could move threads to but it would have the effect of emptying all the other forums.
led mike
|
|
|
|
|
Member 2845784 wrote: it works for sure - I can use the interface
how are you using it? What is the source you use to obtain it?
Member 2845784 wrote: It's a real mystery why there's no information about this interface. I'm confused..
There is a fairly substantial history of MS implementing undocumented features. They may do this to use these features internally but do not intend to support them in the development platform.
led mike
|
|
|
|
|
Hi evrybody.
I 'm looking for an C++ implementation of cache management functionality.
Do you have a suggestion. Any model or pattern is acceptable.
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
The simplest thing for a simple object cache to do is just allocate objects en masse and manage them in a collection. For example, if your application deals with a lot of std::string objects, you can allocate up a bunch of them (e.g. 250) at startup, throw them on a std::stack and then pop them off the stack as required. If you exhaust the stack, allocate another 250 of them and put them on the stack.
When done with an object, "free" it by putting it back on the stack so that something else can use it.
In an active, stable system, the buffers of the string objects will stabilize over time by growing to a general size and then staying there, and multiple threads will be able to take advantage of locality with the objects.
This results in less overall allocations and existing allocations, both for the strings and their buffers, due to reuse instead of destruction and re-creation/re-allocation.
In applications that abuse string objects, you can see a decent performance improvement at the expense greater memory usage. (Although as I said, the memory usage stablizes over time.)
This approach also works well in threadpool situations where you have multiple worker threads waiting on an IOCPs -- the "context object" that is thrown to the pool of worker threads can come from a collection of reused objects which minimizes the overhead of context management. Same thing with data buffers, etc.
Performance can be further improved by allocating larger blocks of memory and then instantiating objects in that block of memory -- see placement new for more information. This further reduces the memory management your application needs to make, and "memory management" == time.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the interesting answer.
I already found what I wanted : Poco C++ library (has a lot of cache templates with diiferent strategies for object deletion).
(also will work in the context of an IOCP server where the pool of threads can act concurrently on the inner data that behind the context data passed to the queue, without the pbm of values corruption).
I have a big issue with performance and I try to find a way between acceptable optimization and acceptable code design.
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
hello everyone,
I want to write a program to record the event of keyboard, sb advise me to use journal hook.
//g_hLogHook is a global hook
if (g_hLogHook==NULL)
g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0);
It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs?
can anyone give me a answer?
ps:msdn
Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook.
now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ?
thanks for your answer
|
|
|
|
|
|
hi. I am trying to create a simple interpreter wherein it simply adds and subtracts.
Sample Input:
y = 5 + 8;
cout << y;
Output: 13
I have already started using stacks however it seems that it cannot pass through other commands after reading the input. Here's the code (Actually, I got this code from the net but it seems not to work):
#include<iostream>
#include<stack>
#include<string>
using namespace std;
int main(){
stack<string> syntax;
string word;
while (cin >> input) //after this, it no longer passes to the next syntax
{
syntax.push(word);
}
cout << "Number of words: " << syntax.size() << endl;
while(!syntax.empty())
{
cout << syntax.top() << endl;
syntax.pop();
}
cout.flush();
return 0;
}
Do you have any ideas? ![Confused | :confused:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|