|
|
Here is the code snippet I am working on:
.....
CoInitialize(NULL);
CComPtr<iadsuser> pUser;
HRESULT hr = GetUserObj( L"DOMAIN02", L"user1", &pUser );
CString ErrMsg = _com_error(hr).ErrorMessage();
if( FAILED( hr ))
{
ASSERT( FALSE );
return false;
}
// Last login
DATE LastLogin = 0.0;
hr = pUser->get_LastLogin( &LastLogin );
ASSERT( SUCCEEDED( hr ));
CString LastLoginTime = FormatDate( LastLogin );
// Last logoff
DATE LastLogoff = 0.0;
hr = pUser->get_LastLogoff( &LastLogoff ); // this fails
ErrMsg = _com_error(hr).ErrorMessage();
ASSERT( SUCCEEDED( hr ));
CString LastLogOffTime = FormatDate( LastLogoff );
pUser.Release();
pUser = NULL;
CoUninitialize();
...............
Call to get_LastLogin() succeeds and I get correct time. Call to get_LastLogoff() fails. ErrMsg contains "Unknown error 0x8000500D"
Any ideas why get_LastLogoff() fails?
This is what I am trying to do: we have application that tracks the time user was logged on to Novell network. We are now retiring Novell Server and I need to get login/logoff time from Windows Domain controller. If there is another API I can use please let me know.
|
|
|
|
|
|
Yes, I posted yesterday on your blog. Do you have any clue where to set/enable it in AD services? The only place I can think of is Domain Security settings but I couldn't find this option anywhere.
Does call to get_LastLogoff() actually work in your source code?
|
|
|
|
|
JoeSchmoe007 wrote: Does call to get_LastLogoff() actually work in your source code?
No it doesn't.
Does the link help?
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
The link is irrelevant. It has nothing to do with retrieving this information programmatically.
|
|
|
|
|
Hi ,
I am using vS2005 for creating COM component in which I want to execute an EXE when Client program call my function in COM. So is there any function in ATL class library which will execute EXE and check the status of EXE execution.
Thanks
|
|
|
|
|
Atul23 wrote: So is there any function in ATL class library which will execute EXE and check the status of EXE execution.
There is standard WIN32 API for such purposes (see, for instance [^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
You can use WinExec(....) in COM. Try it out...
regards,
Sivaganesh
|
|
|
|
|
|
Hi!
I'm using a COM DLL from a third party to access some hardware. The main application is written in C# and I can create the object and use it on XP without problems using an interop assembly created with tlbimp.
When I try the same on Vista SP1, I get an AccessViolationException on the first method call into the COM object.
The really weird thing is: The COM DLL only crashes when I call my application outside of VS, i.e. when I'm not trying to debug it. When stepping through the code in VS (2005 SP1), everything works as on Windows XP! Running the same executable from the debug directory crashes...
Can anyone explain this behaviour or tell me where to look next?
Thanks in advance!
Update:
The DLL also crashes in VS when I turn off the VS host process or when I first start the application and attach the debugger. So the big question is: What exactly does this VS host process do to keep the DLL from crashing?
Regards,
mav
--
Black holes are the places where God divided by 0...
modified on Tuesday, August 19, 2008 7:05 AM
|
|
|
|
|
Just a guess - Does the COM DLL depend on any external files? If yes, ensure these file are located in the correct directory.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi!
Thanks for your reply, but I think that doesn't explain the behaviour. The DLL in question doesn't have any "unusual" dependencies and it does work on XP and when run inside VS...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Well once we had this problem when a colleague was using a 3rd party DLL in a .NET project using Interop. Hence I said I am guessing.
To find the cause of your problem, more details would be required.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi Sohail!
Just wanted to inform you (and everybody else interested) that the problem indeed was inside the 3rd-party dll.
They used ATL from VS2003 for their component and this caused a problem with Vista's DEP (an explanation can be found here[^]
Turning off DEP made the problem go away.
Jeez - how do people find out these things?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have marked your reply as helpful answer. Might help someone in future.
These problems are quite tricky. It's nice to hear that you are able to identify the cause.
Cheers,
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
has anyone a hint for me how to get the Folder recursiv to the drop target ? I implemented GetUIObjectOf in my IShellFolder derived class to handle riid == IID_IDataObject. Works fine for the first level (here my selected folder).
Where do i have to start when i want the Childs of that folder also be dragged ?
Happy for every hint
Kai-Uwe
|
|
|
|
|
I want to invoke a queued component which is in another system from the asp.
For the same system i am using get object.
this code is for the same server where the page and com + queued comp it is working
Set ObjQLoader = GetObject("queue:/new:Test.Class1")
ObjQLoader.Start trim(nextjob)
now i want to invoke the com+ queued comp which is in another location on ServerA.
is it possible through ASP to set the object of ServeA and invoke that queued component.
Set ObjQLoader = GetObject("queue:FormatName=DIRECT=OS:ServerA\private$\Test_0/new:Test.Class1")
ObjQLoader.Start trim(nextjob)
|
|
|
|
|
Is it possible to create a shell extension tool tip window that shows more than just text?
All the examples I've seen just return text, but I am trying to find a way to add controls, such as buttons and images to the window that appears when the mouse hovers over a file or folder.
Any ideas?
Thanks!
-JB
|
|
|
|
|
As start up, have a look at Dunn's series http://www.codeproject.com/KB/shell/shellextguideindex.aspx[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
Thanks, I didn't find what I wanted in that tutorial (he shows how to use text, but not anything else).
However, I think I have found what I was looking for here:
http://www.codeproject.com/KB/shell/ImcImageTip.aspx[^]
Having said that, I'd still appreciate any more info that anyone has on the subject!
Thanks again!
|
|
|
|
|
I need to issue post command in my code (ATL, VC2005).
TIA
--
md
|
|
|
|
|
|
Thanks a lot for your reply. The problem is that I don't know how to retrieve IWebBrowser2 from within Outlook.
--
md
|
|
|
|
|