|
you asked this 2 hours ago[^].
you're not on a chat room, so please be patient. and if you don't get answers then, consider revising the question
|
|
|
|
|
Thnx a lot for the beautiful piece of advise...
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
Have you included afxctl.h?
|
|
|
|
|
Hi,
Yes i have...thats the problem here
'afxctl.h' defines the following constants:
enum AFX_REG_FLAGS
{
afxRegDefault = 0x0000,
afxRegInsertable = 0x0001,
afxRegApartmentThreading = 0x0002,
};
This does not have the freethreading model constant...
If I pass 'afxRegApartmentThreading' as the parameter to the registering function then it works fine...but there's no constant for free threading model..
how can these be missing when MSDN articles say so..?
OR I am missing something here ? Help ...
Also, if the threading model is changed directly in the Registry..it works...n I can do the same using VC++ code...but I want to know where is the free threading model constant
Thanks in advance..
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
Apparently that was added in a later MFC version, sorry.
It's there in MFC 7.xx ... You're probably on version 4.xx?
Mark
|
|
|
|
|
AbbyIndian wrote: Also, if the threading model is changed directly in the Registry..it works...n I can do the same using VC++ code...but I want to know where is the free threading model constant
Here's the (I think) relevant code from MFC (the pstrThreadingModel value you want is szBoth
which is defined as "static TCHAR szBoth[] = _T("Both");"):
if (nRegFlags & afxRegApartmentThreading)
pstrThreadingModel = szApartment;
if (nRegFlags & afxRegFreeThreading)
pstrThreadingModel = szFree;
if ((nRegFlags & (afxRegFreeThreading | afxRegApartmentThreading)) ==
(afxRegFreeThreading | afxRegApartmentThreading))
{
pstrThreadingModel = szBoth;
}
if (pstrThreadingModel != NULL)
{
HKEY hkeyInprocServer32;
bSuccess = (::RegOpenKeyEx(hkeyClassID, _T("InprocServer32"), 0, KEY_WRITE,
&hkeyInprocServer32) == ERROR_SUCCESS);
if (!bSuccess)
goto Error;
ASSERT(hkeyInprocServer32 != NULL);
bSuccess = (::RegSetValueEx(hkeyInprocServer32, _T("ThreadingModel"), 0,
REG_SZ, (const BYTE*) pstrThreadingModel,
(lstrlen(pstrThreadingModel)+1) * sizeof(TCHAR)) == ERROR_SUCCESS);
::RegCloseKey(hkeyInprocServer32);
}
|
|
|
|
|
Hi....
Thnx a lot for the help....That version thing finally cleared my doubt..
And thnx for that code snippet...I have also used a similar piece of code which I found in some cpp file in the MFC folder....
Thank you
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
hello Gurus
plz tell me any site which explain
multi threading programming from basic.
thanks
Born To Code
|
|
|
|
|
|
Here[^] is one of the examples.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hi to All,
Could anyone help me, I don't know how to create compatible plug-in for windows media player & real player, Quick Time, etc., using visual c++? What should I do?
Advanced thanks
with regards
Ramana
A.Venkata Ramana
-- modified at 5:09 Tuesday 13th February, 2007
|
|
|
|
|
|
It looks like I chose the wrong time to work on this section of my progect. It clashes with the student's homework
Anyway, for the most part I have been able to enumerate just about everything I need, but I have a few problems.
1. I have the number of graphics cards, their Vendor names and current resolutions. But I have been unable to determine how much on-board memory they have.
2. I am unable to find any suitable method of enumerating the sound-cards.
|
|
|
|
|
I have to add a menu item on right clicking selected text, invoke my command handler and get the selected text, from any text document
1. How to add menu item to the existing windows generated menu
2. How to get the selected text to the menu handler program
Thanks
Anil
-- modified at 4:31 Tuesday 13th February, 2007
|
|
|
|
|
then, what's your question ?
where's your problem ?
what have you tried already ?
where are you blocked ?
|
|
|
|
|
I have to add a menu item on right clicking selected text, invoke my command handler and get the selected text, from any text document
1. How to add menu item to the existing windows generated menu
2. How to get the selected text to the menu handler program
|
|
|
|
|
Use WM_CONTEXTMENU .
The handler is called OnContextMenu ).
There you can use code like this:
CMenu menu; menu.LoadMenu( IDR_CONTEXT_MENUS);
CMenu* pContextMenu = menu.GetSubMenu( 1);
CMenu* pWorkMenu = menu.GetSubMenu( 2);
if( pWorkMenu) {
MergeMenu( pContextMenu, pWorkMenu);
}
pContextMenu->TrackPopupMenu( TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); Instead of MergeMenu , you might as well add an item.
For this to work, I have made a menu-resource where I place all my context menus as submenus.
The code that handles the selected menu item does so using the menu item IDs I gave in the resource.
The last paramter to TrackPopupMenu() defines theclass that is the parent for the menus and gets the command messages.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Can we add the menu item via registry as we add menu items, on right clicking files,folder etc
|
|
|
|
|
i think you're wanting this[^]
|
|
|
|
|
What do you mean?
Where you get your menu text and menu ID does not matter: CMenu allows you to add arbitrary text and numbers.
You may as well load it from registry entries.
If you want to change a menu from a menu bar, you would need to handle WM_INITMENU or override CWnd::OnInitMenu .
There you can modify the menu - to the point of assembling a completely different menu.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
hi,
can anybody tell me what this function is going to return,
WINGDIAPI BOOL WINAPI BitBlt( IN HDC, IN int, IN int, IN int, IN int, IN HDC, IN int, IN int, IN DWORD);
Thanks in advance
Siddharth
|
|
|
|
|
it returns a BOOL only.
what you see around are the calling convention (find the definition of WINAPI - it's certainly like __cdecl) and see also how's defined WINGDIAPI
|
|
|
|
|
thanks
|
|
|
|
|
Hi all,
This might be a stupid question, but does VS 2005 (VC++) have a media player component?
Many thanx,
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|