|
Use the OpenService() function of NT.
Use its related functions to manipulate services.
Hope this helps.
Jeremy Pullicino
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Hi,
Can you be a bit more specific.I din't get how to use this OpenService() function of NT for disabling a user account.Please explain it in detail
Thanks,
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
abhinarulkar wrote:
Learning is a never ending process of Life
In that case, take some time to learn how to use the function
Look for OpenService documentation in the MSDN - it is not very hard to use.
You are particularly interested in the ChangeServiceConfig.
Hope this helps.
Jeremy Pullicino
Professional C++ Developer
Done any hacking lately?
|
|
|
|
|
HI Abhi,
Use the foll function, its quite simple
NetGroupDelUser
|
|
|
|
|
Somebody PLEASE help me!!!
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q261003&
I found this article but it's incomplete on how to fully implement in my
application. In the example, is "CMyBrowser" an instance of "CHtmlView"?
Because :Exec is not a method of CHtmlView. Can someone
enlighten me on how to implement this code please?
Any assistance would be greatly appreciated.
Best Regards
|
|
|
|
|
Hi
Can anyone please tell me how do I color the Toolbar
Thanks,
San
|
|
|
|
|
How to display the data in mousemove event of mschart?
I need to display the value of series in mousemove event.
I need to draw crosshair in mouse move and if I have 4 series of line graph,I have to display the values at that instance for all the 4 series.
Any help would be appreciated.
Thanks in advance.
Be creative
Once your mind is streched by a new idea, it will never regain its original dimension
|
|
|
|
|
hello,
i Derived a Class from CWnd named CStarter
and in my Application Class i add the code
CStarter *pStarter ;
pStarter = new CStarter ;
bool bRet = pStarter->Create(NULL,NULL,WS_VISIBLE,CRect(0,0,0,0),NULL,10000) ;
and then there is an asertion popups..!!
and then i changed the argument 5 (HandleTo parent window)
to (CWnd*)GetDesktopWindow() ,then there is no assertion,but the return value is 0..
What is the reason,How i can solve it and create a CWnd here...
WUSIWUG
|
|
|
|
|
...to (CWnd*)GetDesktopWindow()...
Use CWnd::GetDesktopWindow() .
rechi
|
|
|
|
|
I've run across a bit of a problem using exceptions and references. Here is
some test code:
class B<br />
{<br />
public:<br />
virtual void fn() { cout << "in B" << endl ; }<br />
} ;<br />
<br />
class D : public B<br />
{<br />
public:<br />
virtual void fn() { cout << "in D" << endl ; }<br />
} ;<br />
<br />
B&<br />
foo( D& d )<br />
{<br />
return d ; <br />
}<br />
<br />
<br />
<br />
void<br />
main( int argc , char* argv[] )<br />
{<br />
try<br />
{<br />
throw foo( D() ) ; <br />
}<br />
catch( D& x )<br />
{<br />
cout << "Caught D: " << typeid(x).name() << endl ; <br />
x.fn() ; <br />
cout << "- b=" << dynamic_cast<B*>(&x) << endl ; <br />
cout << "- d=" << dynamic_cast<D*>(&x) << endl ; <br />
}<br />
catch( B& x )<br />
{<br />
cout << "Caught B: " << typeid(x).name() << endl ; <br />
x.fn() ; <br />
cout << "- b=" << dynamic_cast<B*>(&x) << endl ; <br />
cout << "- d=" << dynamic_cast<D*>(&x) << endl ; <br />
}<br />
}
And the output:
Caught B: class B<br />
in B<br />
- b=0012FF64<br />
- d=00000000
I would have expected that either 1) the D& catch handler would be invoked
since we are throwing an object of type D (even if we are using a B reference)
or 2) the B& catch handler would be invoked but the call to x.fn() would print
"in D"
My reasoning goes like this:
- I create a temporary object of type D and pass it into foo().
- foo() returns that same object via a B reference. But the *actual* type of the
object being returned is still D.
- While I could understand the compiler using the static type of the exception object
being thrown (in this case, B) to figure out which catch handler to use, since
the actual type of the exception object is D, surely D::fn() should be being called,
not B::fn().
GCC is doing the same thing so for once, it appears that MSVC is not in the wrong.
What's going on here and where's my misteak?
|
|
|
|
|
Well, first off you're not using pointers, you're using references. The virtual-ness of fn() is irrelevant because polymorphic calls only happen when dereferencing a pointer.
Second, foo() returns a B& . Since a B& object cannot be implicitly converted to a D& object, the D& catch is not invoked. That would be a downcast, which is not an implicit conversion. It doesn't matter what the "real" type of the object is. The return type of foo() is B& , end of story.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
>>> Well, first off you're not using pointers, you're using references. The virtual-ness of fn() is irrelevant because polymorphic calls only happen when dereferencing a pointer.
Not true. Polymorphism still works even if you're using references. For example:
<br />
D d ; <br />
B& x = d ; <br />
x.fn() ; <br />
prints "in D" i.e. even though we are using a B reference, the program knows that we really have a D object and calls the appropriate virtual function.
>>> Second, foo() returns a B&. Since a B& object cannot be implicitly converted to a D& object, the D& catch is not invoked.
As I said, I could understand if this was the case i.e. the compiler uses the *static* type of the exception to determine which catch handler to invoke. What I don't get is why, given that the actual object being thrown is a D, the virtual function mechanism doesn't seem to be working properly. Or at least, as I would expect
One of the guys at work here suggested that the object was being sliced, but since nothing is ever being *copied*, no slicing could possibly be taking place!
|
|
|
|
|
I wuz wrong! The exception *does* get copied.
From "More Effective C++", item 12:
Regardless of whether the exception is caught by value or by reference (it can't be caught by pointer — that would be a type mismatch), a copy of localWidget will be made, and it is the copy that is passed to the catch clause. This must be the case, because localWidget will go out of scope once control leaves passAndThrowWidget, and when localWidget goes out of scope, its destructor will be called. If localWidget itself were passed to a catch clause, the clause would receive a destructed Widget, an ex-Widget, a former Widget, the carcass of what once was but is no longer a Widget. That would not be useful, and that's why C++ specifies that an object thrown as an exception is always copied
So, since at the moment the object is being thrown, we have a B&, a B object is what we get. Sigh...
|
|
|
|
|
Michael Dunn wrote:
Well, first off you're not using pointers, you're using references. The virtual-ness of fn() is irrelevant because polymorphic calls only happen when dereferencing a pointer.
Yes? A reference is an auto-dereferencing pointer.
|
|
|
|
|
Is RasDial a blocking call? Meaning, does it only return after the connection has been established or if the connection has failed? I have got confusing results in my few experiments here And for non-coding reasons (mostly involving angry co-workers staring at me) I am unable to do further experiments
Any help would be hugely appreciated!
Thanks and regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
You can have RasDial work in a non-blocking fashion: just pass a suitable callback in the lpvNotifier parameter.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hello, the codegurus around the world.;)
Check the message called WM_RASDIALEVENT by RasDial,
and compare wParam with RASCS_XXXX.
So, we can check the process of dialing.
Good Luck
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
Nish,
Dundas offers a free RASDIAL class, which worked like a miracle for me!
Register first
http://www.dundas.com/products/downloads/register.asp?ProdID=4
VictorV
|
|
|
|
|
|
Hi all, I downloaded a program source code from internet and failed to compile it, the reason is a header file named "iphlpapi.h" could not be found on my computer.
Could someone tell me why I don't have it? I'm using VC++6.0 on Win2000pro(sp3). Thanks in advance.
|
|
|
|
|
|
I guess it only comes with VC7? I really need to compile that program but don't wanna install VC7. hmm...
|
|
|
|
|
|
Hello, the codegurus around the world.;)
After we install Microsoft Platform SDK, we must point the new
include and lib directory in Visual Studio.
Tools -> Options -> Directories Tab -> Include files and Library files
item in ComboBox -> Add the new directory.
(Sometimes, we had better change the order of these indice at some project.)
Have a fun.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|