|
Hello,
I need to place all the tabs of a property sheet in the same line and make the user scroll over them, and after reading the MSDN I've written this:
int CPSParametritzacions::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
this->EnableStackedTabs(FALSE);
if (CPSAutoRedimensionable::OnCreate(lpCreateStruct) == -1) return -1;
return 0;
} But it doesn't work...
I'm almost sure that I am missing something...
Thank you in advance.
|
|
|
|
|
what happens if you follow the MSDN example exactly. i.e.
int CMyPropertySheet::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
EnableStackedTabs(FALSE);<br />
if (CPropertySheet::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
return 0;<br />
}
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
int CPSParametritzacions::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
this->EnableStackedTabs(FALSE);
if (CPSAutoRedimensionable::OnCreate(lpCreateStruct) == -1) return -1;
return 0;
}
int CMyPropertySheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
EnableStackedTabs(FALSE);
if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
the only differences I see are in bold font... and I don't believe they are significant...
The fact is that this must not be the reason... (it's obvious why), but the other one... My problem is that the CPSAutoRedimensionable class it's a class derived from the base class property sheet and that I don't know why I can't call directly CPropertySheet::OnCreate from my CPSParametritzacions class.
Thank you in advance, and thank you for your interest too.
|
|
|
|
|
Hi....
I am doing a Project in which I want to close a selected port which is opened by another application. How can I Solve the Same? Which function to be used??Please Help
Thanks in Advance.
SAN
|
|
|
|
|
Do you have the source code to the other application? If so it would be easy to do. If not, I'm not sure if this could even be done.
Rob
|
|
|
|
|
What I need to do is move my existing resources from the executable into separate resource DLLs, separated by language. Does anyone have links to any tutorials, guides, or other articles about resource DLLs in general?
Jon Sagara
I have no complaint with the “mentoring concept” or the marriage concept or the sex concept. But if you pay for any of those, something’s wrong.
-- John T. Reed in The real estate B.S. artist detection checklist [^]
|
|
|
|
|
|
Microsoft Press used to have a book on Localization/Globalization.
It was pretty good at the time.
C++/MFC/InstallShield since 1993
|
|
|
|
|
dear all,
i want to write a small utility which runs in the background and detects
system shutdown.
but i have no idea about how to go about it
any suggestion will be greatly appreciated
thanx
|
|
|
|
|
|
thanx for ur timely reply
can u post some sample or direct me to some url which shows the same
thanx a ton
|
|
|
|
|
I'm trying to create a popup menu for my tree control. I've got some code and the sample I have seems to use a CPoint pointer for the x and y locations of the mouse. Can I get access to a CPoint object somehow in the code I have?
void CSacmanSetupDlg::OnRclickSacmanSetupTree(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
bool bDone = false;<br />
HTREEITEM hSelectedItem;<br />
<br />
CMenu newMenu;<br />
newMenu.CreatePopupMenu();<br />
bDone = newMenu.TrackPopupMenu(TPM_LEFTALIGN,15,15, <br />
AfxGetApp()->m_pMainWnd,NULL);<br />
hSelectedItem = this->m_SetUpTree.GetSelectedItem();<br />
<br />
*pResult = 0;<br />
}
Sample I'm working from...
void CAppButton::OnRButtonDown(UINT flags, CPoint point)<br />
{<br />
CMenu menu;<br />
CMenu *submenu;<br />
menu.LoadMenu(IDR_LAUNCH);<br />
submenu = menu.GetSubMenu(0);<br />
ClientToScreen(&point);<br />
submenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,<br />
point.x, point.y,<br />
AfxGetApp()->m_pMainWnd,NULL);<br />
}
|
|
|
|
|
GetCursorPos() will return the current position of the mouse in screen coordinates. From memory (so i may be wrong), TrackPopupMenu() wants coordinates in client coorindates, so you may need to convert it first.
Dave
|
|
|
|
|
Actually, TrackPopupMenu needs screen coordinates (your memory must be fading... ). You can pass the results of GetCursorPos() straight to TrackPopupMenu().
However, for this app you might want to use GetMessagePos(), which returns the screen position of the mouse when the last message retrieved with GetMessage() was generated.
Cheers,
Ryan
|
|
|
|
|
Many thanks, I am unworthy!
|
|
|
|
|
El debugero says that Track PopupMenu is returning a zero...what gives?
bool bDone = false;<br />
int x,y;<br />
HTREEITEM hSelectedItem;<br />
DWORD mousePosition;<br />
mousePosition = ::GetMessagePos();<br />
x = GET_X_LPARAM(mousePosition);<br />
y = GET_Y_LPARAM(mousePosition);<br />
<br />
<br />
CMenu newMenu;<br />
newMenu.CreatePopupMenu();<br />
bDone = newMenu.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,x,y, <br />
AfxGetApp()->m_pMainWnd,NULL);<br />
if(bDone)<br />
Beep(678,46);<br />
<br />
<br />
hSelectedItem = this->m_SetUpTree.GetSelectedItem();<br />
<br />
<br />
*pResult = 0;
|
|
|
|
|
If this is the exact code you're using, then the problem is that you're not adding items to the menu before you call TrackPopupMenu(). You have to either call newMenu.LoadMenu() to load a menu from a resource, or call newMenu.InsertMenu()/AppendMenu() to create the menu items at runtime.
At the moment, you're trying to display a menu with no items in it.
Ryan Binns
He who laughs last... thinks too slowly.
|
|
|
|
|
With this code I get a menu but it's about 1 mm thick. I don't see any functions that let me adjust the size or shape of the new menu...
void CSacmanSetupDlg::OnRclickSacmanSetupTree(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
int x,y;<br />
int menuHandle;<br />
bool bDone = false;<br />
char * newItem = "Does It Work?";<br />
<br />
UINT nPosition = 0;<br />
HTREEITEM hSelectedItem;<br />
DWORD mousePosition;<br />
<br />
mousePosition = ::GetMessagePos();<br />
x = GET_X_LPARAM(mousePosition);<br />
y = GET_Y_LPARAM(mousePosition);<br />
<br />
<br />
CMenu newMenu;<br />
<br />
newMenu.CreateMenu();<br />
newMenu.InsertMenu(nPosition,MF_POPUP,menuHandle,newItem);<br />
<br />
<br />
newMenu.EnableMenuItem(1,MF_BYPOSITION);<br />
newMenu.TrackPopupMenu(TPM_CENTERALIGN,x,y,<br />
::AfxGetMainWnd(),0);<br />
if(bDone)<br />
Beep(678,46);<br />
<br />
<br />
hSelectedItem = this->m_SetUpTree.GetSelectedItem();<br />
<br />
<br />
*pResult = 0;<br />
}
I'm vexed...
|
|
|
|
|
You can't adjust the size or shape of the menu (not without using owner-draw anyway), but 99.9% of the time you won't have to. Windows will automatically size the menu based on its contents.
What you have done here is created a menu with a single item in it - a submenu that has no items, and you haven't given the submenu a name. If an item's name has no characters, then nothing is displayed and the menu is very thin, which is exactly what is happening.
To add useful items to your menu, use the following:
<br />
newMenu.InsertMenu(nPosition, MF_BYPOSITION | MF_STRING, ID_MENU_ITEM, strMenuText);<br />
Where:
ID_MENU_ITEM is the menu item identifier of your menu item
strMenuText is the text of your menu item ("Cut", "Copy", etc...)
Ryan
He who laughs last thinks too slowly.
|
|
|
|
|
Is the ID_MENU_ITEM a menu resource that I create in the resource editor? If so, what is the difference between load menu and insert menu? I'm not a work right now so I can't take a look at the documentation...
|
|
|
|
|
adonisv wrote:
Is the ID_MENU_ITEM a menu resource that I create in the resource editor?
NO! As I said before, ID_MENU_ITEM is the identifier of a menu ITEM, not a whole menu. If you want to load a menu from a resource, then you have to use LoadMenu(). All this is in the documentation.
Ryan
He who laughs last thinks too slowly.
|
|
|
|
|
Thanks man, that sucked! I went the Load Menu route, although the instructions you gave me worked as well. I had to create a menu called ID_INITIAL_MENU. Then in the properites section, I had to check popup. Then create ID's and captions for each new popup I wanted in the menu. Once the menu was associated with a class I was able to add message maps that allow me to do something when the pop up menu's were selected. I think those were the steps I really needed. Thanks for putting up with me though...;P
|
|
|
|
|
How do i read JPEG ,GIF files to get the following info ...
1.Image Width
2.Image Height
3.Monochromw or color
4.Frame Rate ( for Gif)
Can some one give the code along with the Header structure of JPEG,GIFF
|
|
|
|
|
Take a look at CXImage - http://www.codeproject.com/bitmap/cximage.asp
Dave
|
|
|
|
|
Hi,
In a dialog-based application, i have a a worker
thread which read 256k data from Cdrom at one times (step).
But it failed with memory leak. Would you please
provide me a safe thread method to be used for my problem?
I see many example code of the "thread", but i don't know
which one is best for my problem.
Thanks in advance!
chen
|
|
|
|