|
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
|
|
|
|
|
We create a dialog box from a Document View Application, it's fairly easy. But it should also be possible to do 'invert' this operation, i.e., using dialog based application as 'main window', a doc view program must start, for example, on clicking a button on the dialog box. I tried to make it using two three ways but I was only partly successful.
Suppose you have created a new dialog based MFC application. Add a button, call it 'Start Doc View'. On clicking this button, a Doc View application should pop up. I implemented something like this:
void C...Dlg::OnDocView( ) // click event for the button
{
ShellExecute(...); // Supply the name of Doc View EXE and path...
}
But this has a disadvantage that, if the dialog application is closed, the Doc View still remains on the screen. I don't want this disadvantage. What is desired is, if the dialog based app closes, the Doc View should also 'die'.
I tried to use Doc View as DLL (I saw one or two articles at CodeGuru). Built and copied the DLL (also .h and .lib files of Doc View) into the dialog-based project, but could not make much headway. Could also be my mistake.
I am also thinking of initiating a user interface thread (when the start Doc View button is clicked) and that thread, instead of showing its own window, calls ShellExecute(...) or calls the DLL for Doc View. Would it be correct?
Can you kindly provide a solution. Also, (if possible), a line by e-mail (rajeswarit@rediffmail.com) about your posting of article and/or your views would be my fortune.
With many thanks,
Yours sincerely,
Rajeswari
|
|
|
|
|
I have the storage opened in my appln using StgOpenStorage using the flags STGM_READWRITE|STGM_TRANSACTED|STGM_SHARE_DENY_WRITE. Now is it possible to thread the writing activity to various streams in the same appln using the same handle?
I wud say this shud b possible considering file s/m within document, but since the root storage is opened with flags mentioned it may not be possible? pls advise.
|
|
|
|
|
Can you be more specific? What does "to thread the writing activity to various streams" mean? Are you asking if you can write to the storage using multiple threads?
Steve
|
|
|
|
|
yes my application has already the pointer to main storage using mentioned flags. now can i spawn threads each to write to to the child storages?
|
|
|
|
|
As ususal with COM, if you attempt this you'll have to marshal the interface pointers to the worker threads. Whether this will work as expected depends on the threading model of the storage object (which I'm not sure of).
Steve
|
|
|
|
|
sorry im not sure if i have got what you have explained. i have a thread wrapper class through which I intend to pass the necessary info to the thread, am i close to ur lookout?
could you provide me a small code sample to elaborate?
|
|
|
|
|
In general, it is illegal to pass COM interface pointers from one thread to another directly; they must be marshaled to the other thread. This is not a limitation but a feature however. For example say you have a COM object that is not thread safe and can only safely be called from one thread. In this case passing one of its interface pointers directly to another thread would be disastrous. If you marshal the interface pointer to the other thread COM sets up a proxy in the other thread and a stub in the object’s thread and things will seem to just work. In reality the calls to proxy send information to the stub which calls the real object so all calls to the object still come from it’s own thread and all the details of the inter-thread communication are hidden. The situation if the same inter-process. In short I think you need to look up marshaling.
Steve
|
|
|
|
|
How can i name the untitled SDI application?
|
|
|
|
|
AfxGetApp()->m_pMainWnd->SetWindowText
|
|
|
|