|
Hmmm, thanks. I guess i thought both pointers contained the same address but upon printing them out i see the copy contains its own unique address.
I haven't seen the 'reference to a pointer' frag before, do you know of a good resource that deals well with this kind of stuff?
The books i have only scratch the surface.
thanks again.
|
|
|
|
|
Tutorial at Cplusplus.com
This and many others can be found by Googling: C++ pass pointer by reference
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
How can I read Registry subkey using Win API
|
|
|
|
|
|
Hello:
Navigation in visual studio seems a big prob when u are working on a big solution, the bookmarks provided in VS only help us navigate within the same file , what if we have to go from one file to another of different projects , can any one recommend me some solution
Thanks
Muhammad Ahmed
Ahmed
|
|
|
|
|
|
I typically use a break point, not for the reason of breaking at that line of code, but for marking a line of code for later return. As a bonus, if the IDE is shut down, the break points are saved whereas bookmarks are not (they used to be in earlier versions of VC++).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
hi,
in my CXXXApp i got a member variable called myVar.
i want to get this member variable in other object, like a View.
i do :
<br />
tempVar = afxGetApp()->myVar;<br />
but the compiler won't let me,
what do u suggest for me to do?
obviously i cant create another object of CXXXApp...
is my syntax wrong?
|
|
|
|
|
AfxGetApp will return a CWinApp*, and this one doesn't have a myVar memeber, but your application has.
So all you have to do, is to cast the returned pointer into your application
CMyApp * pxApp = (CMyApp *)AfxGetApp ();
if(pxApp)
{
// Do the dance...
pxApp->myVar;
}
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Hey all,
I'm trying to get my MDI application to load a tool bar at startup in the hidden mode and then on a button press display the hidden menu.
My results thus far are that I can hide the tool bar on start up but when I do my button press, the tool bar remains hidden until I drag and drop another tool bar currently docked to the bottom of my main window.
Code extract provided:
------------------
Tool Bar creation
------------------
if (!m_imageProcessingToolBar.Create(
this,
WS_CHILD |
WS_MINIMIZE |
CBRS_LEFT,
IDR_TICS_COMMANDS) ||
!m_imageProcessingToolBar.LoadToolBar(IDR_IMAGE_PROCESSING))
{
TRACE0("Failed to create image processing toolbar\n");
return -1; // fail to create
}
m_imageProcessingToolBar.SetSizes(button, image);
m_imageProcessingToolBar.SetBarStyle(
m_imageProcessingToolBar.GetBarStyle() |
CBRS_TOOLTIPS |
CBRS_FLYBY |
CBRS_SIZE_DYNAMIC);
m_imageProcessingToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_imageProcessingToolBar);
----------------
un-hide tool bar
----------------
void CMainFrame::OnImageManipulation()
{
m_imageProcessingToolBar.ShowWindow(SW_MAXIMIZE);
}
If anyone can see the error of my way, I'd thank you so much.
Regards.
|
|
|
|
|
Try:
void CMainFrame::OnImageManipulation()
{
m_imageProcessingToolBar.ShowWindow(SW_SHOW);
}
or
void CMainFrame::OnImageManipulation()
{
m_imageProcessingToolBar.ShowWindow(TRUE);
}
See if one of those snippets work. Best of luck in your programming efforts.
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Thanks for the advice, but it's still not working.
I've tried all of the SW values that can go into the ShowWindow function and none of them make the toolbar re-appear without me having to drag and drop the default system toolbar.
|
|
|
|
|
Try coding your function like this:
ShowControlBar(&m_wndToolBar,
!m_wndToolBar.IsVisible(), FALSE);
RecalcLayout();
Sorry. I hope this suggestion helps.
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
The first example using ShowContolBar toggles the toolbar visibility. If you just want to show the toolbar, try coding your function like this:
ShowControlBar(&m_wndToolBar, TRUE, FALSE);
RecalcLayout();
Sorry. I hope this suggestion helps.
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Pure genius ;0)
Thanks a million, that worked a treat.
The RecalcLayout() line wasn't needed to make this work, what purpose does it serve?
Cheers again.
|
|
|
|
|
Glad to help.
RecalcLayout is generally used to tell MFC to reshuffle the visible controlbars when a toolbar/controlbar is added or removed from being docked (top/bottom/left/right).
MSDN Describes it this way:
Called by the framework when the standard control bars are toggled on or off or when the frame window is resized.
-Remarks-
The default implementation of this member function calls the CWnd member function RepositionBars to reposition all the control bars in the frame as well as in the main client window (usually a CView or MDICLIENT).
Override this member function to control the appearance and behavior of control bars after the layout of the frame window has changed. For example, call it when you turn control bars on or off or add another control bar.
Hope this helps.
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
I'm using Visual Studio 6..
But as you know we can not change font of some part such as classview pane..
It seem to be fixed to system font.. you guys might be able to see Sans serif font..
(I'm not pretty sure about that..)
Anyway My question is 'How can I change the system font?'
I'm actually using Korean Version Windows.
What I wanna use is the sans serif system font like what you guys using.
the System font that comes with Korean Edition Windows is not good looking...
I'd like to change it..
Does any know about that?
ps. sorry about that my question is out of programming topic..
|
|
|
|
|
To change the buttons' size of a SpinButton, I need to use CSpinButtonCtrl::Create() function. Now I added a SpinButton control on my dialog, what shall I do next?
|-|3llo Wo|2ld
|
|
|
|
|
Shuang. Wu wrote:
what shall I do next?
What is it that you are wanting to use the Spinner control for? Are you wanting it to be used with a Edit Control?
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Yes, with an Edit Control.
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
Place code something like this (minus the lengthly comments) in your host dialog's OnInitDialog() function like:
<code>m_spinner.SetBuddy(GetDlgItem(IDC_EDIT_BOX));</code>
<code>GetDlgItem(IDC_EDIT_BOX)->SetWindowText("0");</code>
<code>m_spinner.SetRange(0, 100);</code>
<code>m_spinner.SetDlgItemInt(IDC_EDIT_BOX, 0, FALSE);</code>
That should do it! I hope this clarifies things for you and aids you in your programming efforts. Best of luck on your projects!
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Thx. But what i want is to change spin button contro's size. I know CSpinButtonCtrl::Create can do, see:
BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
...
Parameters
...
rect
Specifies the spin button contro's size and position. It can be either a CRect object or a RECT structure
Thus, I want to know when I can call CSpinButtonCtrl::Create.
Or, do you have any idea to change the spin button contro's size?
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
|
hello
I,m new to mfc/windows.
I would like to find x-co-ordinate,y-co-ordinate ,height and width of 'OK' button on a property sheet in MFC.
Any help appreciated
Thanks
rajesh
|
|
|
|