|
Hello,
is there any possibility available to get the projectname during the compiletime? I need the projectname as string...
Best regards
Hansjörg
|
|
|
|
|
Can you more explain Im not sure you need to GetModuleBaseName or no?
|
|
|
|
|
1) Get the value of project name from the project property
if you are using VS2005,
vsproperty->c/c++->preprocessor->preprocessor definitions: PROJECT_NAME=$(ProjectName)
2) Now use the PROJECT_NAME Macro from above in your code,
#define STRINGIZE(_x) #_x
#define STRINGIZEVALUE(_x) STRINGIZE(_x)
char projectName[]= STRINGIZEVALUE(PROJECT_NAME);
|
|
|
|
|
Rajkumar R wrote: #define STRINGIZE(_x) #_x
#define STRINGIZEVALUE(_x) STRINGIZE(_x)
Clever.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi friends
How to calculate system measurement like When i was ON my PC my application run automatically calculate system time how to do it ?please give your suggestion.
Thanks and Regards
Nisha.S
|
|
|
|
|
Your query is not too much clear to me. I think you want to display the time for which your application has been runnning. So, when your application starts do a GetSystemTime() and store the values in some variable. Later you can again do a GetSystemTime() and calculate the difference.
In essesnce you must state your problem more clearly if you expect to the point solution from CP members.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
k..currently i create one tool
i want to create "Total usage of System time"
1. When the user logging him/her PC at that time my application counting the
time(it means running hours)
2. Suppose When user shut down or log off at that time my application close
close the time finally it will return total no of calculating system
hours. This is my tool ...give the procedure how i can start that project
or send me some URLs please..
Regards
Nisha.S
|
|
|
|
|
To run as a user process you have to add its path in registry. Copy the following and make a file named setup.reg:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"AnyName"="C:\\Program Files\\YourAppFolder\\YourApp.exe"
and run it. Don't forget to edit to match your application.
To run as ser5vice look at this article:
http://www.codeproject.com/KB/system/xyntservice.aspx[^]
Now the second part - how to calculate time:
Its easy use GetSystemTime API
http://msdn2.microsoft.com/en-us/library/ms724390.aspx[^]
|
|
|
|
|
Are you needing to know how long the computer was up and running? I mean - the time elapsed between boot and shut down? In that case, GetSystemTime is not what you need. Google for Find windows uptime[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Do you need to GetProcessTimes ?
|
|
|
|
|
thanks 2 your replays..
yes hamid i need get process time calculation ....
By
Nisha.S
|
|
|
|
|
|
Im writing a registration database program in C++ that :
Allows the user to enter prompted information in a struct, the user then has the choice of performing the menu options such as adding a student, deleting, lookup a student, add course, etc. At any time the user should be able to view the existing student files.
How do save the student information to an Outfile that can be accessed.
Do I put outfile code in every function???
I'm lost. Can provide code if needed.
|
|
|
|
|
Does outfile mean a text file ? Use iostreams, ofstream to be precise. You can write a handler for << and just stream the objects directly, it's very nice.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you want o write your values toa file?
|
|
|
|
|
It appears to me that Serialization[^] is what you're in need of.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
dajones05 wrote: How do save the student information to an Outfile that can be accessed.
Do I put outfile code in every function???
It sounds as though you are putting the cart before the horse. Do you know how to read from and write to a file? Do you know how to get input from the user? Do you know how to interact with a database via code?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How to convert the Multibyte local windows code files to Unicode format file?
Which API can I call?
|
|
|
|
|
Jeem Ge wrote: Which API can I call?
MultiByteToWideChar()
|
|
|
|
|
|
Best Regards to Naveen and Hamid, I see.
Thanks
|
|
|
|
|
You're welcome.
|
|
|
|
|
Hello , I wanted to re-ask my previos question , since I made some progress. And I want to clear some stuff in my head.
1. BUFFERING "STEREO" STREAMS : I use the code below . Generally 8000 bytes passed to callback function.
Since my each sampleis 16bit , that is about 4000 samples for each call. So I defined CHANNEL_SIZE as 2048 which is approriatefor total sample count. I made it 2048 as power of 2 because I will implement FFT .
What do you think about that buffering approach ?
.................................................
#define CHANNEL_SIZE 2048
double leftChannel[CHANNEL_SIZE] ;
double rightChannel[CHANNEL_SIZE] ;
..................................................................
STDMETHODIMP BufferCB( double SampleTime, BYTE * pBuffer, long BufferSize )
{
unsigned int nSampleCount = BufferSize/2 ;
short* pStream = (short *) pBuffer ;
for( i = 0;i<nSampleCount/2 ; i++)
{
leftChannel[i] = ((double)(*pStream)) ;
pStream++ ;
rightChannel[i] = ((double)(*pStream)) ;
pStream++ ;
}
}
2. MULTITHREADING : Can you compare using sample grabber and creating threads for signal processing for performance (especially CPU usage ) ? In my first approach , I created thread for FFT since my FFT task didnt include changing samples , it was just about spectral analysis.
3. DATA FORMATS, CONVERSIONS : I get my each sample as 16 bit. When I looked some DXSDK9 audio samples , they declare "signed" shorts for samples. So I am confused about declaring sample variables as signed , since they can store negative values.
Also I have question marks about getting double or float values from shorts , and replacing shorts with new floats or doubles after making some signal processing. I can understand dividing short values by 32768(2^16 / 2 ). But what about "vice-versa" ?
Thank you very much for reading,
BEST REGARDS,
Akin Ocal
|
|
|
|
|
I added MS ParamEqu filter ( which is a DMO ) into my graph using IDMOWrapper interface.
I want to manipulate parameters of it ( gain,bandwidth,center freq) programatically in my code.
When I searched for this , I found IMediaParams Interface ( http://msdn2.microsoft.com/en-us/library/ms785964(VS.85).aspx)
But I am not sure that it will solve my problem.
If you experienced changing parameters of a DMO fitler programatically , can you give me advices about that ?
For example I didnt understand "envelope" concept. Also sample code for using that interface would be very good.
Best Regards
|
|
|
|
|
Can you do a LoadLibrary in a DLL I seem to be having problems ???
|
|
|
|