Forum: C++ Sep 7th, 2009 |
| Replies: 8 Views: 326 You reminded me one of my interviews (that did not go that well :) ). Yes this is how you need to do it. |
Forum: C++ May 14th, 2009 |
| Replies: 3 Views: 360 int DisplayMessageBox()
{
int msgboxID = MessageBox(
NULL,
(LPCWSTR)L"Sample",
Cap,
MB_YESNOCANCEL
);
switch (msgboxID) |
Forum: C++ May 14th, 2009 |
| Replies: 4 Views: 257 See this
http://www.codeproject.com/KB/cpp/Colored_Conslole_Messages.aspx |
Forum: C++ Mar 20th, 2009 |
| Replies: 38 Views: 3,394 It is not a Vista problem. Vista uses same APIs to shutdown the system.
You certainly have required permissions and privileges if you can shutdown the system by Shutdown.exe
You just need to be... |
Forum: C++ Mar 20th, 2009 |
| Replies: 38 Views: 3,394 Shutdown.exe uses InitiateSystemShutdownEx.
I have used this code on Vista and it works for me. |
Forum: C++ Mar 20th, 2009 |
| Replies: 38 Views: 3,394 1) Your code lacks the required privilage. You would need Shutdown Privilage enabled for the process which initiates the shutdown.
2) On server OS not everyone has shutdown privilage, you need to... |
Forum: C++ Mar 20th, 2009 |
| Replies: 38 Views: 3,394 how about trying this
#include <Windows.h>
BOOL MySystemShutdown()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp; |
Forum: C++ May 7th, 2008 |
| Replies: 1 Views: 1,899 About Messages and Message Queues (http://msdn.microsoft.com/en-us/library/ms644927(VS.85).aspx)
This talks about everything. Please let us know if you have any question. |
Forum: C++ May 7th, 2008 |
| Replies: 7 Views: 5,969 The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
I suspect the window you are trying to hide processes this message and prevents itself from hiding.
... |
Forum: C++ May 7th, 2008 |
| Replies: 7 Views: 5,969 Does it happens with all the Windows or with any specefic Window ?
Are you trying to hide any window which you have created or any other applciaiton's Window ? |
Forum: C++ Feb 5th, 2008 |
| Replies: 4 Views: 722 You may not need to lear about .Net framework as such for your project. It is a underline layer which helps managed code to run your system(It is not the only thing it does).
Sometime Windows... |
Forum: C++ Feb 5th, 2008 |
| Replies: 6 Views: 1,479 What is the error? You can always redifine _WIN32_WINNT as per your target OS |
Forum: C++ Feb 5th, 2008 |
| Replies: 4 Views: 722 How long did you wait after the hung? Does it hang your machine?
What is the .NET framework you are using? It takes longer if you have installed new version of framework sometimes as long as five... |
Forum: C++ Feb 5th, 2008 |
| Replies: 2 Views: 1,764 If you are targetting Windows.You will need to have Windows SDK to build your application. Windpws SDK comes with all the required header files.
You can download the letest SDK from... |
Forum: C++ Jan 29th, 2008 |
| Replies: 6 Views: 1,437 Hello Jason,
Simply speaking you cannot execute any application on a remote machine. There are many problems doing this. Apart from the implementation limitations there are some major security... |
Forum: C++ Jan 3rd, 2008 |
| Replies: 4 Views: 763 What is the error? Linking errors are different than syntactical error one can't find them looking at the code. |
Forum: C++ Jan 2nd, 2008 |
| Replies: 5 Views: 1,273 You need to catch the exception. You need to write a catch block. If you let OS to handle your first chance exception it is going to simply terminate the process because OS does not know which way... |
Forum: C++ Jan 2nd, 2008 |
| Replies: 5 Views: 1,273 @obscured47 You can do anything once you catch the exception.
Why do you want to throw an exception to pause the execution? There could be better ways to do that.
Can you post small segemt of your... |
Forum: C++ Jan 2nd, 2008 |
| Replies: 11 Views: 2,519 You may like to overload couple of operators in MyStr class to make it friendly. |
Forum: C++ Jan 2nd, 2008 |
| Replies: 11 Views: 2,519 @Max_Payne
You can not initialize arrays the way you are trying. However, you have exposed a good problem. How to initialize a constant string inside a class?
I have been facing these kinds of... |
Forum: C++ Dec 28th, 2007 |
| Replies: 7 Views: 2,502 See this (http://www.codeguru.com/cpp/cpp/algorithms/article.php/c5129/) and this (http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree) |
Forum: C++ Dec 28th, 2007 |
| Replies: 7 Views: 2,502 Are you trying to write a balanced binary tree??
You should explore how AVL trees work. |
Forum: C++ Dec 28th, 2007 |
| Replies: 16 Views: 3,033 I believe we are confused in Initialization and declaration.
int i ; // declaration
int i = 10 ; declaration + initialization
i= 15 ; // assignment
You cannot only do initialization... |
Forum: C++ Dec 28th, 2007 |
| Replies: 16 Views: 3,033 Once you declare an array you just reserve some amount of memory. This memory contains garbage. if you try to print all values of the array just after delaring it you will see just garbage. See... |
Forum: C++ Dec 28th, 2007 |
| Replies: 5 Views: 839 >>ı selected debug from solutıon confıguratıon box.and then ı made breakpoınts then f5.but ıt dıdnt break the process and saıd that no labels were loaded
Do you see .pdb files created in debug... |
Forum: C++ Dec 27th, 2007 |
| Replies: 5 Views: 839 You can use Visul Studio breakpoints only if you launch the application in the debugger or if you choose to attach the running the process with the debugger.
can you let us know exact steps how are... |
Forum: C++ Dec 26th, 2007 |
| Replies: 30 Views: 2,919 See this
http://www.daniweb.com/code/snippet491.html
I wrote it long back.. There are many typos but you can see how do I document header of a function or a file.
However, this time your... |
Forum: C++ Dec 25th, 2007 |
| Replies: 9 Views: 1,183 @ Max_Payne
>>& toko: Are you reading: Teach Yourself C++ in 21 days [fifth Edition] ?
Cool !!
Anyways, that is a good book for starting!! |
Forum: C++ Dec 25th, 2007 |
| Replies: 3 Views: 1,293 @phalaris_trip
You can not do this.
void LoadFile (std::string filename, std::string key=filename)
{
//blah
}
default parameter should be known to the compiler while compilation. |
Forum: C++ Dec 25th, 2007 |
| Replies: 9 Views: 1,183 This is a classic example of Encapsulation in C++.
You hide data and code by using access modifiers private and protected.
If you don’t explicitly write an access modifier, by default it is... |
Forum: C++ Dec 25th, 2007 |
| Replies: 19 Views: 3,329 @Narue
I admit I was wrong. thanks for pointing me to standered C++ documentation.
The function main shall not be called from within a program. The linkage (3.5) of main is... |
Forum: C++ Dec 25th, 2007 |
| Replies: 3 Views: 2,422 Hello
This forum has tons of resources you can use to learn C++. Just have a look around...! |
Forum: C++ Dec 24th, 2007 |
| Replies: 3 Views: 1,056 I can’t say if you can design anything platform independent here. You have to call core APIs that too of kernel level. May be you want something like filter driver.
Intrusion are 99% not platform... |
Forum: C++ Dec 24th, 2007 |
| Replies: 19 Views: 3,329 @Narue
Why do you think it is a undefined behavior ? main is just like any other function once you call it within the application.
What is so special with main ? apart from it is a conventional... |
Forum: C++ Dec 24th, 2007 |
| Replies: 19 Views: 3,329 >You should not ever call main( ) from within you program, that essentially restarts a new instance of the program!
Calling main does not starts new instance of the program, you can verify it in... |
Forum: C++ Dec 24th, 2007 |
| Replies: 2 Views: 1,209 Try this..! Your code had one logical error. Can you tell me what was that ? :)
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
//the struct which represents... |
Forum: C++ Dec 24th, 2007 |
| Replies: 19 Views: 3,329 Okay..
Try this
// Menu.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h> |
Forum: C++ Dec 24th, 2007 |
| Replies: 19 Views: 3,329 Simplest is call main from every function you call in switch
ex
void opcio1(){
cout <<"How to\n\n"<<endl;
main();
}
However, this is not the best way, but I am sure it will give... |
Forum: C++ Dec 24th, 2007 |
| Replies: 6 Views: 630 What do you mean by original object the one used to call the function or the one which is passed or both ?
You need a copy constructor indeed.
Always declare a copy constructor and an assignment... |
Forum: C++ Dec 24th, 2007 |
| Replies: 6 Views: 630 Because of in class
int *data;
and "MSet2Check.data[j] = Reset;" in the method. It changes the value memory location pointed by data member of MSet2Check.
There are couple of solutions ... |