|
When I tried this implementation of passing the CPropertySheet via the constructor, it compiles ok, but the control is not visible at runtime.
Constructor
CSettingsPage2::CSettingsPage2( CWnd* pParent )
: CPropertyPage(CSettingsPage2::IDD)
{
m_pParentWnd = pParent;
}
Instantiate the page and add it
m_pPage2 = new CSettingsPage2( this );
AddPage ( m_pPage2 );
Called on Page2's OnInitDialog
void CSettingsPage2::DefineList()
{
g_MyCListCtrl.Create ( WS_VISIBLE | WS_CHILD, rLocRelative2Page, m_pParentWnd, IDD_SOME_CONSTANT );
}
Page2's property page/tab appears ok, it's just that I can't see g_MyCListCtrl anywhere - even looked for the control using Spy++.
Is it an issue of page2's coordinates relative to CPropertySheet? Is it buried under all the property pages that CPropertySheet manages?
I'm stumped
|
|
|
|
|
Check whether the g_MyCListCtrl.Create() is success or not. Well, if its success, then the problem might be in the co-ordinates that you've specified.
Well, i suspect that most probably the control will be hidden under your property pages. My suggestion is to create the list control as child of the first visible PropertyPage. Then when your other property page became active, i.e. in CPropertyPage::OnSetActive() , call g_MyCListCtrl.SetParent() and set the current property page as new parent. Well, just try whether its possible.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks! you've been helpful and patient. I will try your suggestions.
Here is what I am doing wrong:
1) in the instantiation of the page, I forgot
m_pPage2 = new CSettingsPage2( this ); // pass the CPropertySheet pointer
2) I am testing the constructor of CSettingsPage2 to make sure I get a valid CWnd * for the CPropertySheet
3) I am also testing at the point of the list creation if m_pParentWnd is valid
So far, I get a runtime crash when included 1).
Thank you for the help. I guess it's now one of those Left to Student issues to resolve my problem.
|
|
|
|
|
okay. Just try. Well, if you need more help just ping back and wish you good luck!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
It worked! The problem I was getting was in my "own" Create function - I needed to initialize a couple of "its own" member variables.
So I passed in the parent window pointer (CPropertySheet), created my CListCtrl and tying the parent window back to the property sheet itself - it worked, sort of!
When I tied it directly to the property sheet, the CListCtrl got tangled up in the tabs of the current page and other tabs - i didn't have control over it and moving it didnt help.
So I tried what you suggested, I used SetParent() to change the parent of the dynamic CListCtrl to the current page. It worked great and just how I wanted it - moving the entire dialog had no side effects, I had full control of my CListCtrl.
Thanks so much! Now if someone asks me how, I know how to guide them too - whoo hoo!
John John
|
|
|
|
|
john john mackey wrote: It worked great and just how I wanted it - moving the entire dialog had no side effects, I had full control of my CListCtrl.
Wow!!! Great!
john john mackey wrote: Thanks so much! Now if someone asks me how, I know how to guide them too - whoo hoo!
I'm so glad to hear those kind words!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi,
How to get the enclosing rectangle for a circle?
|
|
|
|
|
by reusing the center point and the diameter
|
|
|
|
|
what do u mean by that ? can u give me an example or post links to tutorials
Basically im following a book in which we are developing a sketcher application so for that I need to get the enclosing rectangle for circle then with which I will draw the circle by getting the points from the mouse message handlers and providing it to the function which draws circles
NOTE: this is not an exercise, the book explains how to do that but im unable to understand it. I also have the code how to do it, but i wanna understand it. so I'm not cheating thx.
modified on Friday, December 12, 2008 10:37 AM
|
|
|
|
|
manzoor10 wrote: the book explains how to do that but im unable to understand it
Try harder.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It seems like you need to get rectangular coordinates that are used draw the circle using corresponding API.
If so, you need to get the first point (left,top) when the mouse button is down and get the last point (bottom, right) when the mouse button is released. Have a look at WM_LBUTTONDOWN and WM_LBUTTONUP messages, and if needed, WM_MOUSEMOVE... You can map them to OnLButtonDown, OnLButtonUp, etc., if you are using MFC.
I believe there will be sample codes in CP itself ( I didn't search yet... )
|
|
|
|
|
Oh, for the love of god! This makes finger-painting look like a fine-art.....
int radius;
POINT circleCenter;
RECT boundingRect;
boundingRect.left = circleCenter.x - radius;
boundingRect.top = circleCenter.y - radius;
boundingRect.right = circleCenter.x + radius;
boundingRect.bottom = circleCenter.y + radius;
|
|
|
|
|
manzoor10 wrote: enclosing rectangle for a circle
Actually it is a square (well, I know the square inherits from the rectangle ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: well, I know the square inherits from the rectangle
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Hi, I could not add a new .rc file to visual studio 2008 express edition, so I created a text .rc file and then added it using add existing item. That part worked okay. The resource folder now shows in visual studio 2008. BUT when I try to add files to the folder it tells me that the express version of the visual studio does not support resource file editing. Please help. How do I edit the resource file? Is there a way that I can create the resource script and it's files outside of the IDE? Please help!
|
|
|
|
|
Notepad! It's what I used to when programming windows 3 software...
You get an appreciation of the resources very quickly!
Or pay money for the grown up version... How much do you value your time?
Iain.
|
|
|
|
|
You may open the resource script as a text file inside the Visual Studio IDE . It is not difficult to edit it this way and you'll gain some insight.
Another option :
- Use
C# Express Edition to build up, visually, your GUI . - Develop a
C# program, exploiting the generated GUI (that is the C# code) to generate the corrensponding C++ resource script. - Write an article about, and post it at
CodeProject .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi @ all,
i´m recording speech with the capturBuffer of DirectSound.
Now I want to encode this in PCM recorded stream to a GSM Stream.
It is possible to do it with MS ACM?
Regards
Karsten
|
|
|
|
|
CrazyDogg wrote: It is possible to do it with MS ACM?
Definitely!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That´s nice .
Can you tell me how?
|
|
|
|
|
CrazyDogg wrote: Can you tell me how?
Take samples from the DirectSound buffer and run them through ACM to
convert them to a GSM stream.
I would start here:
Audio Compression Manager[^]
These will be the most important functions you'll need:
acmStreamOpen()
acmStreamSize()
acmStreamPrepareHeader()
acmStreamConvert()
acmStreamUnprepareHeader()
acmStreamClose()
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You've worked with these Mark? I mean at work?
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Definitely!
I've got a full working implementation using DirectSound for capture
and ACM for compression/decompression.
The GSM codec was the only built-in-to-Windows codec with a small enough granularity ("packet size")
for use with low latency real-time voice communication.
It works well, although I now use a different codec that's NOT implemented as an
ACM codec so the code is sitting dormant.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Heck I'm still not able to conclude the domain you are into! I think you'll load domains into your brain with few quick blinks of the eye - like Trinity learns to fly a helicopter. You should have got a rack of dvds labeld MEDICAL/NETWORKING/TELECOM/IMAGEPROCESSING.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
VuNic wrote: MEDICAL/NETWORKING/TELECOM/IMAGEPROCESSING.
Just add DATABASE and that's it - everything I do
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|