|
Well... no unfortuantly.
Basically the problem is this - the user is logged into his machine at work as per normal then they open their browser and navigate to the intranet web page. Which happens to be served from an Apache web server running J2EE/JSP etc.
Now - as I know the user is currently logged into the domain, why can't that users credientials be sent to the server in order to identify who that user is without the user ever having to enter their user name and password.
You see, once the user logged into the domain when the booted their computer they should have a SID, why can't I then send that SID to the server to verify that user? If so - how?
Phil
|
|
|
|
|
philip andrew wrote:
Now - as I know the user is currently logged into the domain, why can't that users credientials be sent to the server in order to identify who that user is without the user ever having to enter their user name and password.
Because that machine does not belongs to the domain. That would be a huge security breach. If MS allowed what you're saying, as you navigate to any Web Site you could have your username/password stolen.
My latest articles:
Desktop Bob - Instant CP notifications
XOR tricks for RAID data protection
|
|
|
|
|
I'm trying to programatically print an app-generated temporary .txt file, wait until the file has been spooled to the printer, then delete the file. Here's what I'm doing:
generateFile (strFilespec);
long nStatus = (long) ::ShellExecute
(m_hWnd, "print", strPrintFile,
NULL, "", SW_SHOWNORMAL);
if (nStatus <= 32)
displayError();
deleteFile (strFilespec);
Because ShellExecute returns immediately after displaying the (unfortunately modeless) Print dialog, the file gets deleted before the user has an opportunity to respond to the dialog.
I could loop until I detect the absence of a top-level window named "Print" before deleting the file, but that solution reeks of cheddar. I also tried using ShellExecuteEx with the SEE_MASK_FLAG_DDEWAIT flag in the hope that I could the function to behave in a modal manner, but that didn't help.
Any ideas on how to spool a file to the printer in a modal manner would be greatly appreciated. Thanks!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You have the WIN32 spooler API here[^], allowing to enum printers and get the list of jobs.
Good luck!
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Thanks, Stephane. Unfortunately, I don't want to manually print the file (would've used standard MFC in that case). It's actually an .HTML file and I'm using the "print" verb to print it. I have a feeling I might end up using the "wait for window to close" hack.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I didn't say you had to do low-level printing. I thought you could enum the amount of jobs, do ::ShellExecute, then start a loop waiting for the new print job to end.
I agree that waiting for the print window to close may be just enough for your needs.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
__Stephane Rodriguez__ wrote:
start a loop waiting for the new print job to end.
Good point, although I'd prefer to not have the user wait for a successfully spooled job to end. If they were printing to a network printer, it might take time. Of couse, I could just wait for the job to be queued, and then continue.
But I think I'm going to go take a completely different tack: I'm going to delete the temporary print file(s) when the app starts.
Thanks for your replies, Stephane and Nish!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi,
This is a guess, so it might not work.
If you use ShellExecuteEx, then SHELLEXECUTEINFO::hwnd holds the handle to any message boxes that the system might produce during execution.
Now you could do something like this :-
while(true)
{
Sleep(1000);
if(!IsWindow(SHELLEXECUTEINFO::hwnd))
break;
}
deletefile(...)
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thanks, Nish! Still cheddarlike...
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Fortunately this cheese doesn't belong to the known stinking cheeses. Oh my goddish;P
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
|
hi evryone,
i m a beginer VC++ prog.
i have to make a prjct in VC++ for my college project whch will allow access to all desktops in a LAN.
i want to know abt the features reqd to implemnet it and any reference help if avlble.
THNX for any help
|
|
|
|
|
http://www.uk.research.att.com/vnc/index.html
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I have a program that was written on a Windows 2000 machine and runs without error on that platform or any earlier platforms. When I take the program to a Windows XP machine, the program fails every time it is run. On different XP machines, the program will reach different points before failing. Is there anything I can do to make my program run on an XP machine?
dinger
|
|
|
|
|
Is this proggy a RAS prog? The RAS structures differ between XP and 2K and cause a lot of trouble because you need to set the size member of the structs to sizeof structname, but this changes according to the underlying OS. Anyway I had this experience with RAS and you might have the same issue with some other APIs too. The solution is to maintain 2-3 different cpp files each with a different WINVER definition.
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
At the very least, you should install VC++ on one of your XP machines and use the debugger to find the exact point of failure.
Signature space for rent. Apply by email to....
|
|
|
|
|
Or if the XP machine is connected via LAN then try Remote Debugging - this works GREAT!
Gero
|
|
|
|
|
I have found that when I try to create a dialog to manage a thread, it fails to create. I am passing the same parameters to Create() as I found in the sample program from Microsoft so this part should be correct. I can only figure that there is some memory problem which I can't find or since the program was originally written on Win2K, it doesn't like the way it is being compiled on WinXP. The dialog boxes haven't changed since they were compiled on Win2K. The Win2K compiled program won't run on XP either. Any ideas?
dinger
|
|
|
|
|
Bit my bit I'm trying to make more use of STL, but it is a painfull process at times.
The following code is text book stuff, but I can't get it to compile. In particular I would like to call class member function which has a parameter from for_each(), find_if() etc.
Here is the code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
using std::vector;
using std::for_each;
using std::bind2nd;
using std::mem_fun_ref;
using std::string;
void Test_find();
int main(int argc, char* argv[])
{
Test_find();
return 0;
}
class Person
{
public:
Person() {};
Person( char* pszName ) { m_Name = pszName; }
int print()
{ std::cout << m_Name << std::endl; return 0; }
int printWithPrefix( std::string prefix )
{ std::cout << prefix << m_Name << std::endl; return 0; }
std::string m_Name;
};
void GPrint( Person person )
{
std::cout << person.m_Name << std::endl;
}
void
Test_find()
{
std::vector<Person> col1;
col1.push_back( Person( "Neville" ) );
col1.push_back( Person( "Cherryl" ) );
for_each( col1.begin(), col1.end(), &GPrint );
for_each( col1.begin(), col1.end(), mem_fun_ref( &Person::print ) );
for_each( col1.begin(), col1.end(), bind2nd( mem_fun_ref( &Person::printWithPrefix ), "person: " ) );
}
Blank lines somehow are missing above!
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
std::bind2nd requires that the function have two parameters. Otherwise, you can't bind anything to the second parameter Change Person::printWithPrefix() to accept two std::string arguments. The first will be the vector element, and the second will be the string bound with bind2nd.
I think.
|
|
|
|
|
Thanks, but...
The example I gave was straight from: "The C++ Standard Library" by
Nioclai M. Josuttis, so one would like to think it would work.
Changing printWithPrefix()to accept two std::string arguments gives:
for_each( col1.begin(), col1.end(), bind2nd( mem_fun_ref( &Person::printWithPrefix ), "person: ", "abc" ) );
d:\libs\tests\teststl.cpp(71) : error C2784: 'class std::mem_fun_ref_t<_R,_Ty> __cdecl std::mem_fun_ref(_R (__thiscall _Ty::*)(void))' : could not deduce template argument for '<Unknown>' from 'int (__thiscall Person::*)(class std::basic_string<char
,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)'
d:\libs\tests\teststl.cpp(71) : error C2780: 'class std::binder2nd<_Bfn> __cdecl std::bind2nd(const _Bfn &,const _Ty &)' : expects 2 arguments - 3 provided
g:\program files\microsoft visual studio\vc98\include\functional(189) : see declaration of 'bind2nd'
I'm not sure if you are right about bind2nd(), but having not used this before anything is possible. I just tried bind1st to no avail.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Well, seems to me there are three problems here:- The offending line should be using
mem_fun1_ref :
for_each( col1.begin(), col1.end(), bind2nd( std::mem_fun1_ref( &Person::printWithPrefix ), "person: " ) );
- Even so, the probem doesn't compile due to (what it seems to me) a bug in the STL implementation for VC++:
mem_fun1_ref is defined as returning a std::binary_function<T *, A, R> , when it should return a std::binary_function<T, A, R> !
- The last problem is that
bind2nd passes as its first argument a const reference, which doesn't match with what mem_fun1_ref expects; basically, the standard is broken in this aspect.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for that. Chris Losinger also suggested mem_fun1_ref which I tried, and also found didn't work.
I spent several hours on this earlier today, assuming it was simply my lack of understanding of STL and there had to be an solution.
The example in the book I refered to declares printWithPrefix as:
void printWithPrefix(..) const; but I had to change the return type to int and remove the const to get print() to work.
If anyone has STLPort etc. installed I'd be interested to know if this code works with them.
I'm sure this really should be so hard.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
You might try Boost.Functional[^]. It fixes a number of errors of the standard wiith respect to binders and functional adapters.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|