kishore


{ City } mysore
< Country > india
* Profession * sse
User No # 42970
Total Questions Posted # 0
Total Answers Posted # 10

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 51
Users Marked my Answers as Wrong # 32
Questions / { kishore }
Questions Answers Category Views Company eMail




Answers / { kishore }

Question { IBM, 10083 }

How to setup a timer?


Answer

We can set the timer using SetTimer method, this method
posts WM_TIMER message after every 'X' seconds configured,
The message will be placed in the message queue of the
application and application takes little time to take the
message and process so these are not accurate.

For accurate timers we have Multimedia timers,

To start a multimedia timer we can use

MMRESULT timeSetEvent(
UINT uDelay,
UINT uResolution,
LPTIMECALLBACK lpTimeProc,
DWORD_PTR dwUser,
UINT fuEvent
);

To kill a multimedia timer
MMRESULT timeKillEvent(
UINT uTimerID
);

Refers MSDN for more

Is This Answer Correct ?    0 Yes 0 No

Question { 4254 }

Name the most commonly used wizards?


Answer

App Wizard and Class Wizard

Is This Answer Correct ?    3 Yes 0 No


Question { 13792 }

What is LoadLibrary function returns?


Answer

HINSTANCE and HMODULE both are same. Because it is declared
as follows in windef.h

typedef HINSTANCE HMODULE;

NULL Indicates failure, otherwise a handle to the module.

Is This Answer Correct ?    1 Yes 0 No

Question { Samsung, 10171 }

how can u change button shape at run time


Answer

"Somil Vijay" is wrong here. SetWindowPos is used to resize
the dialog. "San" is right, see example below

CYourDialog::OnInitDialog()
{
....
CRgn oRgn;
oRgn.CreateEllipticRgn(10,10,100,100);

CWnd *pWnd = GetDlgItem(IDC_BUTTON_ID);

if(NULL != pWnd)
{
pWnd->SetWindowRgn(oRgn);
}
....
}

Instead of "CreateEllipticRgn" you can many other methods to
create the shape that is required for you.

Is This Answer Correct ?    9 Yes 0 No

Question { Satyam, 8309 }

If there is more than 100 control in a window how we can
change the Taborder of a controls


Answer

Open your dialog & Press CTRl+D and change the Tab order.
Tip:
Among 100 controls suppose you want to change the tab order
of only last 10 controls, then hold control key when you
click on 90th control. and click on 91-100 controls to
change order so that firstt 90 controls order doesn't get
change.

Is This Answer Correct ?    3 Yes 0 No

Question { 28984 }

What is CALLBACK? How it work?
what is the advantage of CALLBACK,
please explain with an example


Answer

Call back functions are related to function pointers. To
understand this see the syntax of standard "qsort" below

void qsort(
void* base,
size_t num,
size_t width,
int (
__cdecl* compare
)(
const void* elem1,
const void* elem2
)
);
(refer MSDN for more info on "qsort")

In above syntax The fourth argument is function pointer.
So when we call this function we will send the address of
"Compare" function to "qsort" function and "Compare"
function will be called by the "qsort" depending on the
logic inside "qsort" function. In this case "Compare"
function is called back by the "qsort". So "Compare" is a
call back function here.

Is This Answer Correct ?    8 Yes 3 No

Question { TCS, 3192 }

Program to open a file with First argument


Answer

void main(int nArgCount, char *szArgVector[])
{
if(nArgCount != 2)
{
printf("\nWorng number of argument\nSynatx: %s
",szArgVector[0]);
return;
}

FILE *fp = foepn(szArgVector[1],"r+");
//Process the file here
fclose(fp);
}

Is This Answer Correct ?    0 Yes 0 No

Question { Satyam, 6049 }

can main method be overloaded...???
How..????


Answer

Ravindranath,

You have forgot another one

1. int main(void) { ... }
2. int main (int argc, char** argv) { ... }
3. void main(int argc, char ** argv, char** environment)

Is This Answer Correct ?    5 Yes 1 No

Question { TCS, 32793 }

write a c program to find biggest of 3 number without
relational operator?


Answer

All above answers are wrong.

For "Manjeeth" answer, it does not work always, for example
a= -8, b = 2;
then
res = (int)(a/b)?a:b;
statement says a as big
res = (int)(-8/2)?-8:2;
res = in(-4)?-8:2
res = -8;

which is wrong.

The other two answers are using relational operators so it
does not answer the question. And finally the answer is

void main()
{
int nNum1, nNum2, nNum3;
int nRes,nSize, nBig;
nSize = sizeof(int) * 8;
printf("\nEnter 3 numbers");
scanf("%d%d%d", &nNum1, &nNum2, &nNum3);

nRes = nNum1 - nNum2;
nRes = nRes >> nSize -1;

nBig = nRes ? nNum1 : nNum2;

nRes = nBig - nNum3;
nRes = nRes >> nSize -1;

nBig = nRes ? nBig : nNum3;

printf("big num = %d", nBig);
}

Is This Answer Correct ?    18 Yes 26 No

Question { 3148 }

write a progam to compare the string using switch case?


Answer

switch(strcmp(str1,str2))
{
case 0: printf("\nBoth are equal"); break;
default:
printf("\nBoth are not equal");
break;
}

Is This Answer Correct ?    4 Yes 2 No