|
Hi,
I just want to guess a solution. I dont know if it works or not.
In the destructor
<br />
delete this;<br />
I hope it works.
Mustafa Demirhan
|
|
|
|
|
I'm in a project writting the CTreeCtrl in the CTreeView, which look like Windows Explorer.
Is anyone know how can I include the Network Neighbourhood control in to my CTreeCtrl?
Thanks.
|
|
|
|
|
|
Hi,
Does anybody know an way by which I can convert an multi page RTF files to multiple BMP files without GUI(background process)..any samples would be highly appreciated..
Thanks for ur help
saravana
|
|
|
|
|
Does anybody have a demo project showing how to change the dropdown to MS Calender in order to select a date?
I found some code at codeguru.com, but I was not able to get it working on my system (VC++ 6.0, Win2k)
|
|
|
|
|
Have alook at this
LRESULT SomeDlg::OnPaint(.....)
{
hDC = ::BeginPaint(m_hWnd, &ps);
MyPaint(hDC);
::EndPaint(m_hWnd, &ps);
}
Now I pass this hDC from MyPaint to various functions which in tern pass it further for simple Line and Text drawing. But I seem to loose this hDC automatically and the routines won't paint. Does anybody have idea ? I have checked everywhere and am sure that none of the statements are altering this hDC in anyways. HELP !!!!!
|
|
|
|
|
Are you certain that the routines aren't just drawing outside your bounding rectangles?
Does the same code work if it's not in a function?
|
|
|
|
|
Hi,
I've been stumped by this (or am just too blind!) problem. I am trying to get the number of characters before the caret in a Rich Edit Control. Is this possible? If not all the characters before the caret, then even the number of characters before the caret in the particular line - i'm using a multiline rich edit control.
Does anyone know how to do this?
It's kind of similar to the col num value in most word processors, which wordpad or notepad don't have.
Thanks in advance,
Jignesh
|
|
|
|
|
D0H!
I found out just incase anyone cares...
The EM_EXGETSEL does the magic. I never called that as I thought it would return 0,0 if nothing is selected, but it does return the correct ranges.
Jignesh
|
|
|
|
|
I have a SDI application with multiple views.
However I only implemented Printing Routines in 1 specific view. The other views only contain temporary information, which is not suited for printing.
I can active the print commando via the menu or via a toolbar button. The handler (as i said before) is in the specific view routine.
The problem I get is that sometimes this view looses focus, because i'am scrolling (for example) in another view.
When I want to do some printing I find the menu and toolbar button greyed an inactive. Only after i activated or give focus back to my "most important" view, I can do my printing activity.
I don't like this approach and hope someone has a straightforward solution,
Thanks in advance,
Bert....
|
|
|
|
|
why dont you tie the message handling of the view to the mainframe instead of the view ... that way it always is available whatever view is visible ... then you just find the view window (from the doc template iterator) you want to print
|
|
|
|
|
Can somebody please give me an example of getting the html source of a document that is loaded in a CHtmlView, into a CString?
I know of the function GetHtmlDocument() , but I don't know how to use it.
Any help you could give me would be very much appreciated.
Yours
James
|
|
|
|
|
Use the GetLocationURL() function instead. It returns the URL as a CString. Below is its usage copied straight from the online MSDN Library.
CHtmlView::GetLocationURL
CString GetLocationURL( ) const;
Return Value
A CString object containing the URL of the resource currently displayed in the WebBrowser.
Remarks
Call this member function to retrieve the URL of the resource that the WebBrowser control is currently displaying. If the resource is a folder or file on the network or local computer, the name is the UNC or full path of the folder or file.
Applies to Internet Explorer and WebBrowser.
Johnas
|
|
|
|
|
Using the IWbemServices::ExecNotificationQueryAsync returns
WBEM_E_ACCESS_DENIED.
Even the Microsoft sample project "tempconsumer", comming with Microsoft WMI SDK, returns this error.
Thanks for your affords...
|
|
|
|
|
My drawing method takes lot of time when I resize. How can I make this fast also I loose the DC automatically somewhere in between and hence has to call GetDC before each major drawing proc.
|
|
|
|
|
It depends on what do you draw and how do you draw. There is not enough information. Some ideas:
1) do not load bitmaps in the drawing code, pre-load them.
2) do not do unnecessary conversion of bitmaps, for example, convert resource bitmap to DDB.
3) break up big bitmaps, especailly for Windows 9X.
4) cache calculation results.
5) check bounding rectangle returned by BeingPaint.
6) check system region to limit drawing.
...
www.fengyuan.com
|
|
|
|
|
You shouldn't "lose" the DC when drawing. You should *ONLY* draw in the OnPaint or OnDraw methods of MFC (or in response to WM_PAINT messages if your doing SDK development). You shouldn't be drawing at any other time.
|
|
|
|
|
Hello!
I have an SDI application with a FormView. On OnInitialUpdate() I do this:
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
To get the size of the window so that only the controls are visable. This works very well, but now I want to start the program minimized. then the above will not work, and I get a standard sized window with my controls in the upper left corner.
How do I get the resized window when I start the app minimized?
// Mike
|
|
|
|
|
Hi Mike,
I just want to guess a solution. In fact, i dont know if it works or not.
Call the following lines in OnInitialUpdate()
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
ShowWindow(SW_MINIMIZED)
I hope this works!
Best regards
|
|
|
|
|
Hello!
Thank for your reply! unfortunally it didn't work. I've change the ShowWindow(..) to theApp.GetMainWnd()->ShowWindow(SW_SHOWMINIMIZED); The first variant only minimized the view.
But somewhere in MFC there is a call to OnSize which makes my app to restore directly.
I have to come up with some clever scheme to only restore when the user clicks on the icon and not when MFC resizes the window.
All ideas are wellcome!
// Anders
|
|
|
|
|
Hi,
i have found an article in the MSDN how to make an Win32-application (without MFC) which
is based on a dialog. But the article and the example source code is for Win 3.1 and doesn't
work with Win32.
Does anyone of you have a skeleton app which is based on a dialog? A link to a
tutorial would be fine, too.
Thanks,
Chris
|
|
|
|
|
Saying "doesn't work with Win32" is quite vague.
There is an abundance of SDK (no MFC) samples provided with Visual C++.
|
|
|
|
|
Yes, you are right, sorry. I should have said:
"doesn't work with the Platform SDK without MFC."
I have found an article in the MSDN about my problem, but it was from 1996 for Win 3.1.
But i have found the solution nevertheless, it was in my DialogBox() call. I wasn't
specifying the resource correctly.
|
|
|
|
|
Here is the short version: I have several classes, some templatized, that inherit from a common abstract base class. I want a way to check at run-time whether a pointer points to an object that inherits from the base class. Because I am using templates, I can't use the MFC IsKindOf().
I have several templatized classes that derive from an abstract base class, following the GoF Bridge pattern:
<br />
class AbstractDataItem<br />
{<br />
public:<br />
virtual ~AbstractDataItem() = 0;
};<br />
<br />
template<class Ty_> class ConcreteDataItem :<br />
public AbstractDataItem<br />
{<br />
public:<br />
virtual ~ConcreteDataItem();<br />
}<br />
<br />
class SpectrogramDataItem :<br />
public AbstractDataItem<br />
{<br />
public:<br />
virtual ~SpectrogramDataItem();<br />
}<br />
This summarizes the inheritance structure. Now I have a pointer and I want to check whether it points to something that inherits from AbstractDataItem. Because I am using templates, I cannot have AbstractDataItem inherit from CObject and use DECLARE_DYNAMIC/IMPLEMENT_DYNAMIC and use MFC's IsKindOf().
The standard C++ typeid() function seems only to give me the top-level class and does not provide a way to check forinheritance. I could try dynamic_cast<> and catch exceptions, but there is an awful lot of overhead in that and it's ugly.
I could exhaustively check the typeid against a list of derived classes, but that would kill my ability to subclass existing classes in the hierarchy---I'd have to go back in and rewrite my inheritance-testing list.
It would be nice if I didn't have to completely rewrite my own version of MFC's CObject and CRuntimeClass to handle templates and namespaces.
|
|
|
|
|
Basically, dynamic_cast<> is your best bet.
|
|
|
|