Search Results

Showing results 1 to 40 of 122
Search took 0.01 seconds.
Search: Posts Made By: dubeyprateek ; Forum: C++ and child forums
Forum: C++ Sep 7th, 2009
Replies: 8
Views: 326
Posted By dubeyprateek
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
Posted By dubeyprateek
int DisplayMessageBox()
{
int msgboxID = MessageBox(
NULL,
(LPCWSTR)L"Sample",
Cap,
MB_YESNOCANCEL
);

switch (msgboxID)
Forum: C++ May 14th, 2009
Replies: 4
Views: 257
Posted By dubeyprateek
See this

http://www.codeproject.com/KB/cpp/Colored_Conslole_Messages.aspx
Forum: C++ Mar 20th, 2009
Replies: 38
Views: 3,394
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
how about trying this


#include <Windows.h>

BOOL MySystemShutdown()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
Forum: C++ May 7th, 2008
Replies: 1
Views: 1,899
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
What is the error? You can always redifine _WIN32_WINNT as per your target OS
Forum: C++ Feb 5th, 2008
Replies: 4
Views: 722
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Solved: Linker Errors
Views: 763
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
@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
Posted By dubeyprateek
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
Posted By dubeyprateek
@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
Posted By dubeyprateek
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
Posted By dubeyprateek
Are you trying to write a balanced binary tree??
You should explore how AVL trees work.
Forum: C++ Dec 28th, 2007
Replies: 16
Solved: arrays proplem
Views: 3,033
Posted By dubeyprateek
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
Solved: arrays proplem
Views: 3,033
Posted By dubeyprateek
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
Posted By dubeyprateek
>>ı 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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Solved: Classes
Views: 1,183
Posted By dubeyprateek
@ 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
Posted By dubeyprateek
@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
Solved: Classes
Views: 1,183
Posted By dubeyprateek
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
Posted By dubeyprateek
@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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
@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
Posted By dubeyprateek
>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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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
Posted By dubeyprateek
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 ...
Showing results 1 to 40 of 122

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC