|
|
Hello
I need to apply margins to CEditView text while printing through a page setup dialog. these should be visible in print preview also.
any help ?
Thanks
|
|
|
|
|
hi all
i have made a SDI application
please help me
when i right click on a menu item
it will not show the event handler on menu item
// I double click on IDR_MAINFRAME and i will show mwnues
i add a tool menu and a dependent item under this but when i right
click on it it will not show event handler
thanks
hi
|
|
|
|
|
Can you more explainn do you want when you right click it shows a contextmenu or you want to fire an event?
|
|
|
|
|
I'd hoped since CHtmlView was derived from CFormView that I could use dialog templates to put controls over the HTML. Isn't that *why* it was derived from CFormView?
But CHtmlView has no constructor with a template parameter as CFormView(templateID) does.
And here I'd got a CDhtmlDialog test program working so well, thinking it would be easy to port to an existing MDI CFormView program I need the technique in
I don't think I can pass a templateID to protected CFormView(templateID) in the base initialization
although CHtmlView can, because its *directly* derived from CFormView, unlike my class.
// What CHtmlView does
CHtmlView::CHtmlView()
: CFormView((LPCTSTR) NULL)
{
}
// And I can't after deriving from CHtmlView
// error C2614: 'CMfcieView' : illegal member initialization: 'CFormView' is not a base or member
CMfcieView::CMfcieView()
: CFormView(IDD_MYDIALOG)
{
}
|
|
|
|
|
Hi,
If you want your CDhtmlDialog to be used in any of your view you can make it a modeless dialog and make a client of View window.
I prefer CDhtmlDialog, since It has already loaded with event sinks, while if you want CHtmlView to get events from controls like button click you need to code a little.
|
|
|
|
|
Sounds promising, thanks for your response.
Do you know of any examples, or a code snippet?
|
|
|
|
|
Hi,
I used similar method in my project, I used modeless CDHtmlDialog there.
I think there are lots of article in codeproject for CDhtmlDialog, please search.
MSDN example DhtmlExplore will give you a good start, it demonstrates dynamic
content on html page.
Best Regards
Raj
|
|
|
|
|
I think I already understand the CDHtmlDialog techniques.
I'm trying to figure out what you meant by "and make a client of View window".
Something like this? (which hasn't worked for me yet )
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
CDummyDlg *pDummy = new CDummyDlg();
BOOL res = pDummy->Create(IDD_DIALOG1, NULL);
return res;
/*
return m_wndSplitter.Create(this,
2, 2, // TODO: adjust the number of rows, columns
CSize(10, 10), // TODO: adjust the minimum pane size
pContext);
*/
}
|
|
|
|
|
WhiteSky has posted a link to document, which uses CDhtmlDialog Code and made a CView based class. You may try this,
And if you want modeless dialog method, would I like to know want's the problem, Does it isn't compiled or run time problem.
pDummy->Create(IDD_DIALOG1, NULL);
you are passing "NULL", you need to pass "this", then only it becomes the client of CChildFrame.
Moreover, I expect you to create a client of view. since you are making client of frame window, the document has no View object, this will cause problem.
Best Regards
Raj
|
|
|
|
|
I'd seen that sample, but it's not using any dialog templates.
Like you, I think I'd prefer to use CDHtmlDialog, if I could figure out how to display the dialog in the view
|
|
|
|
|
Ok,
Its simple,
1) create a modeless dialog of CDhtmlDialog.
Create a dialog resource and add class derived from CDhtmlDialog.
To make it modeless implement a default contructor and implement a simple create function
BOOL CYourModelssDHTMLdlg::Create(CWnd* pParentWnd)
{
return CDHtmlDialog::Create(IDD_DIALOG1, pParentWnd);
}
use create() function in your CView OnCreate() / equavalent.
int CYourView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
m_yourModelssDHTMLdlg.Create(this);
}
Note: set the dialog style to WS_CHILD, WS_VISIBLE, No BORDER , NO TITLEBAR use resource designer or on your code (precreateWindow()).
2) On your Views OnSize()
void CYourView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
m_yourModelssDHTMLdlg.MoveWindow(0, 0, cx, cy);
}
You might have missed it so you thought its not working.
Try this, this requires a time of 5~10 minutes.
Note: remember dialog style, resize and the dialog might have ok and cancel button this will cause the dialog to exitin its default behaviour.
I didn't explored CDHtmlDialog::EnableModeless, try this when you get time
Best Regards
Raj
|
|
|
|
|
|
how to send mail from vc++ program.
I want to sent same message at same time to both yahoo as well as google.
How to do this
|
|
|
|
|
|
i cant find correct document for send mail from vc++.
I have used the csmtp.but it doesnt support to send mail to yahoo and google and others.
I can only send mail to my company id using csmtp
what is a problem.
what to do for that
|
|
|
|
|
prathuraj wrote: cant find correct document for send mail from vc++.
Why you dont use of MAPI I think it will be solve your problem(you can find a lot of articles about it on my previous reply)
|
|
|
|
|
I try to collect words like Bmw or K1200S (letters and digits)
Before i add the _istdigit it worked fine .but when i put _istdigit so it could collect
digits too it dont return me values
And in debug i have that error on CString variables (CString arrays too)
In some google search i found something about pointers .so it should have
some problem on array ?
my code:
f.e m_Query = "BmW K1200S";
oid CInfoRetrievalDlg::GetQuery()
{
CString str = m_Query;
CString sp[100];
CString word = "";
int z = 0;
for ( int i = 0 ; i < str.GetLength() ; i++)
{
if ( i == 0)
{
if ( 0 != _istalpha( str.GetAt(i) ) || 0 !=_istdigit(str.GetAt(i)) )
{
word = word + str.GetAt(i);
}
}
if ( i > 0)
{
if ( i < (str.GetLength() -1))
{
if ( 0 != _istalpha( str.GetAt(i) ) || 0 !=_istdigit(str.GetAt(i)))
{
word = word + str.GetAt(i);
}
if ( 0 == _istalpha( str.GetAt(i) ) && 0 == _istdigit(str.GetAt(i)) && (0 != _istalpha( str.GetAt(i-1) ) || 0 !=_istdigit(str.GetAt(i-1)) ))
{
QueryWords[z] = word;
word.Empty();
z = z +1;
}
}
if ( i == (str.GetLength() -1) )
{
if ( 0 != _istalpha( str.GetAt(i) ) || 0 !=_istdigit(str.GetAt(i)) )
{
word = word +str.GetAt(i);
QueryWords[z] = word;
z = z +1;
}
if ( 0 == _istalpha( str.GetAt(i) ) && 0 == _istdigit(str.GetAt(i)) && (0 != _istalpha( str.GetAt(i-1) ) || 0 !=_istdigit(str.GetAt(i-1)) ))
{
QueryWords[z] = word;
z = z +1;
}
}
}
}
m_QueryWords = z;
}
|
|
|
|
|
I am a beginner in c++ programming, and I am studying topic about c++ template these few days. I tried to implement a template that have the definition and implementation in .h and .cpp files as follow:
// tpl.h
template <class ttype="">
class tpl
{
private:
int test ;
public:
tpl() ;
int get_test() ;
} ;
// tpl.cpp
template <class ttype="">
tpl::tpl()
{
test=1 ;
}
template <class ttype="">
int tpl::get_test()
{
return test ;
}
But linker errors come out when I compiled the above codes in ms-vc++6.0. I am disturbed by this problem. Could anyone helps me? thanks a lot !
BR
Yuwen
|
|
|
|
|
|
Hi Steve, I am just reading your given article on template, I think it will help me a lot. thx!
|
|
|
|
|
|
Hi,
Your Template arguments are not clear please use pre tags.
BTW, I search the html code, you are missing template argument in the function definition
template <class tType>
tpl::tpl()
{
test=1 ;
}
use
template <class tType>
tpl<tType>::tpl()
{
test=1 ;
}
Best Regards
Raj
-- modified at 0:24 Wednesday 6th June, 2007
|
|
|
|
|
Hi Rajkumar_R, thx for your reply! I am just reading an article called How To Organize Template Source Code, I think it will help to solve my problem. BTW, could you pls tell me how to paste my codes with messages using pre tag ? thx !
|
|
|
|
|
Hi,
Iam also new to this forum,
However,
1) code can be posted in between <pre> and </pre> tag
like,
class CYourClass
{
private:
int m_iVariable;
}
2) whenever you need to use < or > symbol use < or > respectively which is available in the compose window formatting panel.
Best Regards
Raj
|
|
|
|