|
I have developed an application and i want its exe should be executed as soon as my system starts, like a service.
Please help me.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
create a shortcut of exe in the following location
C:\Documents and Settings\<username>\Start Menu\Programs\Startup
regrds,
Ashok
|
|
|
|
|
You won't be able to convert an .exe to service if that is not implemented to be a service.
maybe mentioned links might be helpful.
MSDN Ref[^]
Intro[^]
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Do you want to run your app or you want to make service
|
|
|
|
|
I want my exe to be executed as soon as system strats.
Which way i can do it better?
Thank you.
KIRAN PINJARLA
|
|
|
|
|
If you to run your app you can use from Registry and for how to use i think i saw two classes on codeproject that are working with Registry you can see them,anyway you can wrok with registry functions its not hard
|
|
|
|
|
kiran.pinjarla wrote: I have developed an application and i want its exe should be executed as soon as my system starts, like a service.
If you want to start your application as soon as your system starts up...
Then make an entry for your application path in the following registry key...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run .
Or else you will have to rewrite your exe to act as a service too.
|
|
|
|
|
Thank you so much for ur information.
Nibu babu thomas wrote: Or else you will have to rewrite your exe to act as a service too.
How can we do this?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: How can we do this?
You should be watchful. Coz there are plenty of restrictions on services, so many of the windows related tasks won't work as smoothly as you would expect. Any way here[^] is a nice little article by Nishant Sivakumar which will get you started on windows services.
|
|
|
|
|
Thank you.
Nibu babu thomas wrote: Then make an entry for your application path in the following registry key...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run.
How to do this programatically?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: How to do this programatically?
Take a look at CRegKey . It's quite simple. Try by yourself.
|
|
|
|
|
Nibu babu thomas wrote: Take a look at CRegKey
Thank you so much.
Nibu babu thomas wrote: Try by yourself.
Sure.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: How to do this programatically?
RegOpenKey() , RegSetValueEx() , RegCloseKey() , ...
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
kiran.pinjarla wrote: I have developed an application and i want its exe should be executed as soon as my system starts, like a service.
Take a look at this article. Start Your Windows Programs From An NT Service[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi!
Is there any way that I can configure print dialog to inform if printing is done successfully or not.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Hi,
Can you say How to convert a CString value to a char value.
Thanks in advance.
|
|
|
|
|
CString csStr("Test");
char* pbuff = csStr.GetBuffer(csStr.GetLength())
Rinu Raj
|
|
|
|
|
LPSTR GetBuffer(int;
KIRAN PINJARLA
|
|
|
|
|
Hi,
This link may be helpfull to u?
Look into this..
http://www.flounder.com/cstring.htm
regds,
Ashok
|
|
|
|
|
Two people have correctly told you how to get a char *, although neither told you that you need to call ReleaseBuffer() on the string when you're done with it. But if you want to access a single char from the string, you can use index notation to access one character at a time.
CString s("sucka");
char u = s[1];
This is assuming a non Unicode build, of course.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Nor did they mention that if you don't need to modify the string a simple assignment will do the trick. i.e.
LPCTSTR pStr = s;
Steve
|
|
|
|
|
Well just for curiosity sake, I guess one needs to call ReleaseBuffer() only if the buffer supplied is manipulated with, like data is altered.
Does one have to always call ReleaseBuffer(), i mean if he is just calling GetBuffer() just to convert it to form easy for display or copy etc??
|
|
|
|
|
Every call to GetBuffer should have a matching call to ReleaseBuffer . GetBuffer and ReleaseBuffer should only be used on code which alters the string. If you just want to inspect use operator LPCTSTR . Using this operator is automatic, ie:
const char *pData = MyCString;
As Christian suggested however, both of these methods should only be use when using a CString with code that knows nothing about CString s - In general use CString 's member functions to manipulate it's contents.
Steve
|
|
|
|
|
hey, thx for the info. will ensure that for further coding.
|
|
|
|
|
cpp_prgmer wrote: Does one have to always call ReleaseBuffer()
Yes. A call to GetBuffer requires a call to ReleaseBuffer. Failing to do so results in a memory leak.
cpp_prgmer wrote: i mean if he is just calling GetBuffer() just to convert it to form easy for display or copy etc??
There is no need to call GetBuffer for thos purposes. CString has an (LPCTSTR) operator to convert to const TCHAR* implicitly, so in non-UNICODE builds, that operator returns a const char* .
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|