|
Hello,
I need to obtain the list of installed applications as it appears in "control panel/installed applications".
Is there any way to programmatically retrieve that list?
Thank you.
DL
|
|
|
|
|
The Complete List of Installed Softwares kept in Registry
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\UNINSTALL
Enumerate all the keys under the node....
Renjith-The CPian.
|
|
|
|
|
I want something like CFormView, but instead of creating forms from resources. I've to create the child controls dynamically (by using CreateEx ). How can i do it ?
|
|
|
|
|
Take a look at my scrollbar example which creates a control dynamically in the view. The same methods applies for CEdit/CStatic etc...
http://www.codeproject.com/useritems/Scrollbar.asp
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I use Visual Studio with C++ and I'm trying to compile a project with multiple source files. Here's what I want to know: what are the rules about linking multiple source files? How do I specify a variable as accessible throughout all functions in all source files? I thought extern was supposed to do that. How and where do I put functions, global variables, macros, universal header file #includes and everything else?
|
|
|
|
|
Anonymous wrote:
I thought extern was supposed to do that
And extern did not do it ? It works usually pretty well.
Anonymous wrote:
How and where do I put functions, global variables, macros, universal header file #includes and everything else?
Try putting the whole in this very order :
#include
macros
functions
in the .cpp
and
#include
classes
in the .h
What are global variable ?
~RaGE();
|
|
|
|
|
I don't understand how code pages work with double-byte languages (e.g. Korean). I see how every other language can fit into a code page containing 256 characters because most languages are less than 40 characters. However, I see that Korea's code page is 949 and is 256 characters. How can this be, because there are thousands of Korean ideographs? Same for Chinese: it has 10,000 characters, so how can they only use a regular code page?
|
|
|
|
|
In Win2000, we could use Active Directory and Group Policy to install and maintain softwares. But how we could create and access the group policy to deploy or publish software in VC++ programming ???
Thank a lot.
Randall
|
|
|
|
|
hi all,
pls try to answer my question, thanks!
i found that the AfxBeginThread failed to create thread for my function after a long run.
in my program, i need to run a thread, terminated after few mins and restart it.
however, i found it failed to restart after it run for few days (around 3000 times restart).
it just return the NULL pointer to me. eventually, it crashed as i terminate the thread with such pointer.
so, anyone know any reason a AfxBeginThread failed to create thread?
(if i don't know the reason, it is hard for me to try any debug method. since i can't monitor the bug as it occurs after long run.)
thanks,
jim
|
|
|
|
|
HEY
i heard that AfxBeginThread() has some problems related with the releasing of memory when u terminate the thread.(releasing the kernal thread object).i think that may be the reason...but
_beginthreadex() is safe and smart among the thread functions...no probs even if u restart 10 ^300000 times..!!haha
Renjith-The CPian.
|
|
|
|
|
thank you for your answer!
but, would you give me some idea about _beginthreadex()?
thanks,
jim
|
|
|
|
|
Surely..
_beginthreaex(void* Security,unsigned int stacksize,unsigned __stdcall*startAddressof ur thread Function,void *argumentList,unsigned initflag,unsigned* threadID);
that function will returnes the ThreadHandle...
Renjith-The CPian.
|
|
|
|
|
hi,
i am using MFC. it seems that _beginthreadex() can't be use in MFC program...
do you have any idea?
thanks,
jim
|
|
|
|
|
|
I'm creating an MDI application. However, I wanna create the Doc/View/Frame on my own when the user has chosen an menu item (no in File New).
I coded like below, but I don't know how can I associate with a view ?
Besides, who'll manage the deletion of the Document ? Will the document be deleted when the user clicked the "X" button in the frame window ? I don't want the document be deleted as it will associate with another frame/view too, and I've to cache it.
<br />
CMultiDocTemplate *pTemplate=theApp.m_pScreenDocTemplate;<br />
<br />
CShirleyScreenDoc* pdoc = (CShirleyScreenDoc *) pTemplate->CreateNewDocument();<br />
<br />
CShirleyScreenFrame *pNewFrame = (CShirleyScreenFrame *) pTemplate->CreateNewFrame(pdoc, NULL);<br />
<br />
if(pNewFrame)<br />
pTemplate->initialUpdateFrame(pNewFrame, pdoc);<br />
Thanks ^^
|
|
|
|
|
As you need your document to be static I would create a document structure/class outside of a regular MFC type document that will store the cached data. You can then use
CMyDoc *pDoc = pTemplate->OpenDocument(NULL) ;
pDoc->m_pDataPointer = &CachedObject ;
which will create a normal document view/frame and attach a pointer to this global cached object. As long as you just set the pointer to NULL in the MFC document destructor and dont delete it, everything should work as you want.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Does anyone know of a way to select a menu item for a popup menu which uses TrackPopupMenu(). ie. I want menu item 2 selected when the menu pops up, so pressing return will select it.
I've tried;
for( int iPos = 0 ; iPos < 2 ; ++iPos )
::PostMessage( (HWND)pCurMenu->GetSafeHmenu(), WM_KEYDOWN, VK_DOWN, 0 );
item_id = pCurMenu->TrackPopupMenu( TPM_NONOTIFY | TPM_RETURNCMD | bMenuOptsExtra,
pt.x, pt.y, Thread_pCWnd(), NULL
);
but it doesn't work. Any other ideas?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Don't know if it will work, but have you looked at ::SetMenuItemInfo()?
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
Don't know if it will work, but have you looked at ::SetMenuItemInfo()?
Thanks. Yes I have but there isn't anything there which helps. In fact there is nothing in the entire Menu API which does this that I can see, which is why I'm stuck.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Call SetDefaultItem() on the menu popup before you track it is a possibility.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I think that displays the item in bold, but doesn't highlight it.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
I think that displays the item in bold, but doesn't highlight it.
Yes that's right. It is difficult to get any usefull info on SetDefaultItem(). Best I've come up with is it is used with drag and drop. It doesn't help me though. Thanks anywayz.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Neville, me thinks subclassing CPopupMenu should easily give you what you want.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi Ravi, I'm actually using Bruno's excellent CNewMenu code. This does subclass the menu but a) I am a little reluctant to start mucking around in the subclass code and b) I can't work out what I would do here anyway. Any suggestions?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi Neville,
I haven't looked at Bruno's article, but off the top of my head I'd do this:- Store the preselected id in a member variable.
- Override the handler for "mouse on new menu item" (not
WM_MENUSELECT ) and clear the member variable.
- In the
OnDrawItem() override, draw the item as selected if its id matches the member variable's value (if non-zero). If the member variable is zero (i.e. has been cleared), just call the base class OnDrawItem() . I think the tricky part is handling the message "mouse on new menu item". I hope these thoughts end up being helpful and not a waste of time!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|