|
Which PSDK API's can use to change the master volume of PC speaker & Mic
|
|
|
|
|
anilFirst wrote: Which PSDK API's can use to change the master volume of PC speaker & Mic
Please check AuxsetVolume api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Hello !
Can someone make clear why in the beginning of most source codes programmers write following macros ?
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
and whats the use for #pragma once macro
|
|
|
|
|
- #pragma once is the microsoft way of telling the compiler that the file is included once in a compilation unit.
it is the same as
#ifndef __MYMACRO__
#define __MYMACRO__
#endif
for the debug macros, they allow to trace the stack, knowing the file reached...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 5:02 Wednesday 15th February, 2006
|
|
|
|
|
toxcct wrote: #pragma once is the microsoft way of telling the compiler that the file is included once in a compilation unit.
it is the same as
what I know #ifdef #endif and pragma once functionality is different
#pragma once maintains a "include file table" for include files during compilation . But their work is same.
never say die
-- modified at 5:10 Wednesday 15th February, 2006
|
|
|
|
|
sunit5 wrote: #pragma once maintains a "include file table"
yes, but the result remains the same.
moreover, #pragma is microsoft specific, which means that it won't work for another compiler (gcc for example)...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
toxcct wrote: moreover, #pragma is microsoft specific, which means that it won't work for another compiler (gcc for example)...
I dont think so
never say die
|
|
|
|
|
I can only second toxcct on that, #pragma once is not standard. There may be other compilers/preprocessors that also make use of it, so it is maybe not MS specific anymore, but it is definitely not standard.
~RaGE();
|
|
|
|
|
toxcct wrote: moreover, #pragma is microsoft specific, which means that it won't work for another compiler (gcc for example)...
I think most compilers today (including gcc) support #pragma once, but it is not mandated by the Standard.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
sunit5 wrote: what I know #ifdef #endif and pragma once functionality is different
#pragma once maintains a "include file table" for include files during compilation . But their work is same
Almost - #pragma once prevents the entire file from being brought in by the preprocessor again. The #ifndef/#define/#endif or #if !defined/#define/#endif constructs exclude a specific range (whatever is enclosed in the #ifndef block) from being brought in again. Anything before or after the block would be brought in again.
However, the common/general use of the latter makes it pretty much the same functionality as #pragma once , but it is incorrect to assume that they both do the exact same thing.
For example, place something like DWORD Some_Value outside of the #ifndef block of a header file and #include the file twice in a CPP file somewhere and compile that CPP file. You will get an error about a redefinition. Now, add #pragma once to the header file and
try to compile the CPP file again; the error will go away.
Lastly, #pragma constructs are compiler-dependent - but that does not mean that different compilers will not use the same #pragma s for the same thing (or even different things).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I think it is to use the special Debug version of new when you use new . This special version allocates more memory than asked for, to make room for memory leak info etc. So that when you do not de-allocate anything you got with new , you get a message in the output window about the leak.
About the THIS_FILE, I have no idea, never needed to know, too lazy to search.
As for #pragma once , it is to include the current file only once during compilation.
this is this.
|
|
|
|
|
big_denny_200 wrote: #pragma once macro
you usually find this statement in the header files ,this statement instruct the compiler to include the header file only once
big_denny_200 wrote: #ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif
this mean, if you compiling the application is debug mode define operator new as DEBUG_NEW which make debugging easy!
and for ___FILE___ macro please click this link :-
http://users.bestweb.net/~ctips/tip011.html[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
#ifdef _DEBUG
Checks if this a DEBUG build, if it is tell the compiler to handle everything until it encounters an #endif , if it's not a debug build it just skips this section of the source file.
#define new DEBUG_NEW
DEBUG_NEW is a special version of new which stores extra information about the memory being allocated (file name and source line the allocation was made), all we're doing here is overriding the standard version of new .
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;
THIS_FILE stores a copy the current source file being executed, useful for debug messages etc, eg.
char buffer[ 255 ];
sprinf( buffer, "An error occured in source file %s", THIS_FILE );
printf( buffer );
#pragma once just tells the compiler to parse a header file once per source file, else you could end up with hundreds of error messages where stuffs getting defined twice.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
If i dynamically create a CString object then will this object deallocate by itself after going out of scope or should we use teh "delete" operator to deallocate it?
|
|
|
|
|
|
I believe calling delete will be necessary to free the memory it occupied.
this is this.
|
|
|
|
|
Aby Skaria wrote: If i dynamically create a CString object then will this object deallocate by itself after going out of scope or should we use teh "delete" operator to deallocate it?
REMEBER ONE THUMB RULE for C++...
What ever you allocate ... Deallocate otherwise face leak
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
What about objects that call delete this;
|
|
|
|
|
Robert Edward Caldecott wrote: What about objects that call delete this;
ask the Objects
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Robert Edward Caldecott wrote: What about objects that call delete this;
Just yesterday I saw some code that was doing 'delete this'. Generally, I think we should stick away from doing this, but in the code that I was reading it fits in very well in the flow. So I think it is okay to use 'delete this' if you define the class and you yourselves use it, but it would be bad to use it in a library that will be used by someone else.
thanks!
|
|
|
|
|
Chintoo723 wrote: Just yesterday I saw some code that was doing 'delete this'. Generally, I think we should stick away from doing this, but in the code that I was reading it fits in very well in the flow.
Are you referring to a modeless dialog?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
One place where I did this was about 6-8 years ago when doing custom "in-place" modification controls for a very customized ListView control. The control supported editable submitems using various controls (edit, combobox, color picker, other custom controls).
The controls were dynamically created with the coordinates and information of the subitem being modified and they would create the specific GUI control and take control of the edit operation. When done, they would send information on the edit to the ListView control and would then delete themselves via delete this . But it was my class and I knew exactly what it was doing.
It just made it simplier than maintaining the lifetime of the object in the ListView control. (Not saying it was right or wrong.)
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello Friends,
My company has recently taken up a project on Remote Destop monitoring.
Can anybody help me rgd how to proceed in this project which is like VNC, destop controlling.
With Rgds
Girish
Software Developer
|
|
|
|
|
Hello Girish !
I did the project in VB which was monitoring the remote machine(along with capturin the remote desktop, loggin off user and shuting down the remote machin). In orger to get the remote desktop you need to capture the desktop, save it into a file as an image and send that file over network and display it on a form(as i did in vb). The form should not have titlebar, or any of the border property. make the form size as of your screen resolution. so that it appears as if you'r lookin your own desktop. The user even will not come to know which desktop is open...
-Malli...!
|
|
|
|