|
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
|
|
|
|
|
Yuwen Zhou wrote: BTW, could you pls tell me how to paste my codes with messages using pre tag ? thx !
Notice the "pre" button above the smileys?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yuwen Zhou wrote: BTW, could you pls tell me how to paste my codes with messages using pre tag ? thx !
Notice the "pre" button above the smileys? You might also want to make use of the "Preview" button.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thx all, I am using the pre tag and code button with the following codes, I think I can post code on board now.
<code>
template <class type>
class test
{
} ;
</code>
but why stuffs in < > still couldn't be displayed ? would you pls help me with this ? thx !
|
|
|
|
|
use the < > symbol button from "formatting" option in the compose window
|
|
|
|
|
For templates, the function definition (the body) must be in the header file. I don't remember the exact reason, but it is required by the compiler.
BTW, when you post code, use the pre or code tag.
|
|
|
|
|
Hi,
No man, its possible to define template function in cpp files.
|
|
|
|
|
Yes, but then you need to include this cpp file into the header file of the template class (which then is similar as having everythig in the header file). The compiler need a full knowledge of the class to instantiate a template type. See the link provided in the first reply.
|
|
|
|