|
Your font is destroyed at the end of OnInitialUpdate. Make it a member of view class.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
hello
I have a dialog based application, and in aboutbox I want to put my email, sth like;
Contact : me@myserver.com
Now I want is, when the user moves the mouse over my email address, the cursor will change shape to "hand" and when the user clicks on this email, application will open the default email client and fill the fields subject and email address.
How to do this?
Regards
Monka
|
|
|
|
|
|
Try:
<br />
CString sEmail;<br />
sEmail.Format ( IDS_MAILTO, "me@myserver.com", "Hello World!!" );<br />
ShellExecute ( 0, _T("open"), sEmail, 0, 0, SW_SHOWNORMAL );
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
hi,
i need to implement a wizard and create the dialog templates in memory (the pages and controls will be created dynamically). how do i do that ?
from what i ve seen so far : i must create a DLGTEMPLATE dlgTempl in memory so that propsheetpage->pResource points to the address of the dlgTempl. then set propsheetpage->dwFlags .... | PSP_DLGINDIRECT.. however it seems i need more help, cause i fail to create the dialog template.
could someone please help ?
tia, giorgos
giorgos
|
|
|
|
|
OK, bear with my this is my first attempt at VC (I've been using Borland)
I want a split SDI window with a tree to the left and various, probably CFormView s to the right according to which node of the tree is selected.
Is there a nice way to create a set of alternate views and switch between them, or is it really going to be necessary to create a brand new view every time I switch? Has anyone tried, for example, to produce an overloaded CRuntimeClass and smuggle an existing view in that way?
When you overwrite a pane does the old view get deleted (as opposed to destroyed)?
[Frankly I this CreateView method seems pretty perverse why on earth not take a CView argument and, if you want to use it the way Microsoft assume, put the "new" in the arguments list]
|
|
|
|
|
Check the FormSwap app described in Dec'98 issue of MSJ (C++ QA by Paul DiLascia). In MSDN, check the 'Periodicals' section - it should be there. If not, go to msdn.microsoft.com and use the search facility.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Can't seem to find it. Search gives hundreds of matches for CSplitterWnd but no relevant for FormSwap - and the only online periodical under MSDN is the MSDN mag.
|
|
|
|
|
MSDN comes in two flavors: one is online at msdn.microsoft.com, searching for FormSwap works for me there.
The other MSDN is on your harddisk (I'm assuming you've installed help and docs). From VC++ IDE:
1) Go to 'Help' menu
2) select 'Search...'
3) type FormSwap
4) press 'Display'
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
have you looked at the splitter section on this site?
|
|
|
|
|
Yes, and it was quite helpfull in clarifying the situation but it doesn't give me the kind of solution I want.
What I really want to do is put an _existing_ view into a pane. To have a small set of view objects and plug in the appropriate one at the appropriate time.
Unfortunately there's no "SetPane" method. This (to my mind) baddly designed CreateView method insists on creating a new view every time it's called. It looks to me like having this CRuntimeClass structure they are so pleased with they just couldn't resist using it. And, AFAIKS, it makes the call far less flexible without simplifying it a jot.
If you wanted to create a new view for a pane it could just as easilly have been done something like
SetPain(0, 1, new CFormView(ID_DLG), ..
Subsequent to posting the query I've tracked down another improved splitter class, which allows several views to be added to the splitter and switched between written by Caroline Englebienne. I'm hopeful that will fill the bill. It still looks like a clumsy work arround for something which could so easilly have been made simple.
|
|
|
|
|
#include <iostream>
using namespace std;
struct C;
struct D {
void operator*(D) { cout << "one\n"; }
} C;
struct E {
void operator*(E) { cout << "two\n"; }
} F;
struct F;
int main(){
C* C;
F* F;
return 0;
}
I got the above code from a C++ site. This code prints "one" "two" on the screen. Can anybody explain why is it printing so?
void (*p[10]) (void (*)());
|
|
|
|
|
C* C looks like declaration of pointer to C, but it isn't. It's a call to operator* overloaded in struct D. To make code clearer, put the space between first 'C' and asterisk - you'll see that this is an expression, not the declaration:
C * C;
This also applies to F* F (or rather F * F).
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thank u very much. Its only after ur reply I am thinking that C* C; is not a pointer declaration. Now, everything is quite clear and very simple.
Thank u once again.
void (*p[10]) (void (*)());
|
|
|
|
|
Hi
Iam trying to create a CRichEditCtrl ( like a popup wondow ) to display a certain text within a CListCtrl when the length of hte text in one of the column of the ListCtrl exceeds 256 characters.
This i smy problem :
y = 10 ( say )
CRichEditCtrl* myCtrl -= new CRichEditCtrl;
myCtrl->Create(WS_VISIBLE | WS_POPUPWINDOW | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY , CRect(x,y - 20, x+ 70, y - 90 ),
this, 5001);
where this refers to the Handle of the Parent Window
the application crashes at this point. Pl. explain me the reason.
regards
Sankar
regards
Sankar
|
|
|
|
|
It seems that rich edit can't be a popup window - it must be a child. That's what MSDN says about CRichEditCtrl styles:
"Apply the following window styles to an edit control:
WS_CHILD - Always."
You should create a popup as CWnd-derived class. This popup window should have one child - CRichEditCtrl, probably occupying the whole client area.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
(Sorry, I'm cross posting this to both the VB and C++ forums as it covers both).
I have a common problem - I need to show the modeless forms which reside in a VB ActiveX Dll, called from an MFC client app.
I know that it isn't possible to show a modeless form in a VB ActiveX DLL (unless VB itself is also the client), because the modeless form needs to hook into a message loop to receive windows messages. The MSDN docs state that VB looks for something called the 'component manager' on the client to hook into which MFC doesn't provide.
Has anyone worked out how to get around this? Is is possible to mimic the functionality of the component manager in the client app, or at least the parts the modeless form is looking for? What is the myterious interace the VB is looking for? Am I on a hiding to nothing here?
Thanks
|
|
|
|
|
Hi there,
Is anyone knows how to determine installed browsers and java engines versions using Visual C++ ?
Best regards, Kiril Kostov
|
|
|
|
|
Call me stupid, but how do you Navigate to html stored in RAM, rather than a file or URL? Am I going to have to create a temporary cache file first?
|
|
|
|
|
|
You can use resources like this.
res://module_name/ resources_name
good luck,
Dror
|
|
|
|
|
Hello, Everybody
I just used paintlib and jpeglib to save my screen capture as a JPEG file. In some application it works but in some it does not work. Don't know why. If you know any source code to do the screen capture and save it as JPEG, please give me an direction. Thank you very much.
|
|
|
|
|
this code will capture the screen and put it in a HBITMAP, you just then have to save it to a file
CDC dcScreen;
CDC dcMem;
CRect rc (m_lLeft,m_lTop,m_lRight,m_lBottom); // set this to be screen coords of window you want to grab
dcScreen.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
// create a memory DC compatible to screen DC
dcMem.CreateCompatibleDC(&dcScreen);
// create a bitmap compatible with the screen DC
HBITMAP hbmp = ::CreateCompatibleBitmap(dcScreen.m_hDC, rc.Width(),rc.Height());
// select new bitmap into memory DC
HBITMAP bmpOld = (HBITMAP)::SelectObject(dcMem.m_hDC,hbmp);
// bitblt screen DC to memory DC
dcMem.BitBlt(0, 0, rc.Width(),rc.Height(),&dcScreen, rc.left, rc.top,SRCCOPY);
// get screen image
hbmp = (HBITMAP)::SelectObject(dcMem.m_hDC,bmpOld);
|
|
|
|
|
I need to save struct to file as text file(not binary)
How can I do it.
Please detail if you can.
Thanks
|
|
|
|
|
Assuming your struct has integers, use CString::Format() to make a string representation of the numbers, and write that string to the file.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|