|
I see, I would go for an ownerdraw tab control without those spin buttons... examples see [1] and [2] (you must disable the drawing/handling of the buttons yourself).
Hope it helps
|
|
|
|
|
I was off with the family this weekend, so my reply is a little bit later than usual.
-> I just made a quick try of your suggestion and it did not work.
Interestingly as soon as I make a command handler for WM_PAINT, the control is not painted at all.
No mather if the OnPaint function body is empty or I call the base classes OnPaint (class wizard makes comment: don't call bas class), the control is not painted.
By the way, it seems, that CTabControl has no OnPaint function so that CWnd::OnPaint is called which more or less forwards the last command (WM_PAINT) to the window (control). That's what I ment with encapsulating API: sending a message to a control instead of doing any painting inside the class.
I have not thought about owner drawn tabs yet, because my documentation said that owner drawn tabs have fixed size. But I plan to change to VC2003 next week (to avoid to bother with problems or bugs that are solved allready in newer MFC versions. And for flat button support ). Also I might have time to go through the articles about owner drawn tab controls.
I did not try emediately to derive from CTabControl because I want to avoid to make da deviation of each class I use. Otherwise things get very hard to overview quiet quickly.
But ofcourse it's easier to spend 1min every time I open the project to get an overview than wasting hours for programming .
But I still want to understand what's happening and found out, that I have some fundamental wholes in my windows knowledge. It was no joke when I mentioned that the cause of the problem exists since Win 3.xx.
Regards
Leo
|
|
|
|
|
Chilli71 wrote: Interestingly as soon as I make a command handler for WM_PAINT, the control is not painted at all.
Have you tried:
class CTabCtrlLeo : public CTabCtrl { };
void CTabCtrlLeo::OnPaint()
{
Default();
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
}
|
|
|
|
|
It doesn't work yet, but I will get it work.
Thx!
The call to the base class CTabCtrl::OnPaint calls the base class function CWnd::OnPaint, which calls Default() and forwards the last message to the control.
So: yes, I tried to call Default() without success.
But due to your lates reply I double checked my try and found out, that the first line of my OnPaint was
CPaintDC dc(this);
and the second line
CTabCtrl::OnPaint();
So I just exchanged the order and, surprise, the tab control is painted again.
Finding out why I see no rectangle (following your proposal) should be a matter of a couple of minutes.
Maybe I can drop you a final success notice this week (rather at the weekend becaus I will be on a bussiness trip this week).
many thanks for your patience
Leo
|
|
|
|
|
So finially I've found a solution for the problem, even though I do still don't know the answer to my original question.
extern "C" UINT WINAPI RealGetWindowClassA (HWND, char*, UINT);
void CTestTabCtrl::OnPaint()
{CWnd* UpDownButton;
char Test[256];
UpDownButton = GetTopWindow();
RealGetWindowClassA (UpDownButton->m_hWnd, Test, sizeof(Test)-1);
ASSERT(!strcmp(Test, "msctls_updown32"));
if (UpDownButton)
{
UpDownButton->EnableWindow(FALSE);
UpDownButton->ShowWindow(SW_HIDE);
}
CTabCtrl::OnPaint();
}
So instead of overpainting the buttons I never display them.
Take care: UpDownButton is really a temporary window: It is dynamically created, when the number of tabs exceeds the number of displayable tabs. So if tabs are dynamically added and removed, retriving of the UpDownButton window pointer can not be done only once at initialization.
Regards
Leo
Edit: Typo in topic
|
|
|
|
|
Hi All.
With Crystal report 10 I go to generate the report file and through the DLL to runtime I go to modify the logon parameters....
With this code I go to set up the parameters of logon of the report...but there is a problem
when I set password ConnectionProperty has not been set..only password connection property....
void CDlgRptConnectionProperty::OnBnClickedOk()
{
_bstr_t bstParameterName,
bstParameterValue;
_variant_t vtValue;
IConnectionPropertyPtr pConnectionProperty = NULL;
IDatabaseTablesPtr pDatabaseTables = NULL;
INameValuePairsPtr pNameValuePairs = NULL;
IDatabasePtr pDatabase = NULL;
_bstr_t bstConnection;
HRESULT hr;
try {
pDatabaseTables = m_pReport->GetDatabase()->GetTables();
IDatabaseTablePtr pDatabaseTable = pDatabaseTables->GetItem(1);
pNameValuePairs = pDatabaseTable->GetConnectionProperties();
if( (m_typeRptConnection == ModifyConnectionADO) || (m_typeRptConnection == ModifyConnectionDAO) ) {
for( int nIndexParam = 0; nIndexParam < m_lstParameterConnection.GetItemCount(); nIndexParam++ ) {
bstParameterName = m_lstParameterConnection.GetItemText(nIndexParam,COL_0);
CString sParameterName(bstParameterName.GetBSTR());
if( sParameterName.Compare(ADO_PARAMETER_5) != 0 ) {
bstParameterValue = m_lstParameterConnection.GetItemText(nIndexParam,COL_1);
}else {
bstParameterValue = GetUserPassword(nIndexParam,COL_1);
}
IConnectionPropertyPtr pConnectionProperty = pNameValuePairs->GetItem(bstParameterName);
pConnectionProperty->PutValue(bstParameterValue);
}
}else if( (m_typeRptConnection == ReplaceConnectionADO) || (m_typeRptConnection == ReplaceConnectionDAO) ) {
pNameValuePairs->DeleteAll();
_bstr_t bstDllName;
if( m_typeRptConnection == ReplaceConnectionADO )
bstDllName = DLL_ADO;
else if( m_typeRptConnection == ReplaceConnectionDAO )
bstDllName = DLL_DAO;
m_pReport->GetDatabase()->GetTables()->GetItem(1)->DllName = bstDllName;
for( int nIndexParam = 0; nIndexParam < m_lstParameterConnection.GetItemCount(); nIndexParam++ ) {
bstParameterName = m_lstParameterConnection.GetItemText(nIndexParam,COL_0);
CString sParameterName(bstParameterName.GetBSTR());
if( sParameterName.Compare(ADO_PARAMETER_5) != 0) {
bstParameterValue = m_lstParameterConnection.GetItemText(nIndexParam,COL_1);
}else {
bstParameterValue = GetUserPassword(nIndexParam,COL_1);
}
pNameValuePairs->Add(bstParameterName.GetBSTR(),bstParameterValue.GetBSTR());
}
pDatabaseTables = m_pReport->GetDatabase()->GetTables();
long lTablesCount = pDatabaseTables->GetCount();
for( long lItem = 1; lItem <= lTablesCount; lItem++ ) {
IDatabaseTablePtr pDatabaseTable = pDatabaseTables->GetItem(lItem);
_bstr_t bstTableName = pDatabaseTable->GetName();
pDatabaseTable->PutLocation(bstTableName);
}
}
hr = m_pReport->Save(m_bstReportPathFileName);
}catch(_com_error e) {
theApp.DisplayComError(e,TRUE);
return;
}
OnOK();
}
Any idea...
Too many plans make the health badly!!
|
|
|
|
|
Hi
This is my first post to code project.When we copy some thing from word and click on Edit menu and select office clipboard, we will able to see content which we have copied in latest.If i open excel and go to Edit->Office Clipboard same data is available .And i am able to paste the data by selecting that data on office clipboard.
Actually this is vulnerability as my data is shared from word to excel when i want it only to available in word files only.What i want is to either clean office clipboard through some api or to disable sub menu item Edit->Office Clipboard so that no one is able to open offcie clipboard.
Let me tell you i have tried EmptyClipboard() which cleans windows clipboard but not office clipboard.I also tried OleSetClipboard(NULL) which is no way effective.
Please suggest some way to handle this office clipboard data.
Thanks in advance.
|
|
|
|
|
Pankaj Bohra wrote: ...so that no one is able to open offcie clipboard.
Are you on a shared PC?
Pankaj Bohra wrote: Please suggest some way to handle this office clipboard data.
According to Microsoft, there is no way to programmatically manipulate it.
"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
|
|
|
|
|
No i am not on shared PC.
|
|
|
|
|
Then why are you worried about someone else accessing your clipboard data?
"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
|
|
|
|
|
David, actually i am working on encryption and securtiy of data.And word is secured document for my scenario and excel is unsafe document.That's why i want to clear office clipboard or want to control over it.
|
|
|
|
|
Hi,
I am using Web Browser Control (IWebBrowser2) in C++ and renders a html page in it. In my html page I have a tree view control. I want a pointer to this tree view control (embedded in html page) in my C++ code. How would I get the pointer to this tree view control.
Any help would be appreciated.
Regards,
Paresh.
|
|
|
|
|
I want to built a DLL in which we can pass parameters to call a jar file and the return values of the Jar file should be available to the calling application.
Do anyone know How to perform this ?
Thanks in advance.
Nikhs
Nikhil Trivedi
|
|
|
|
|
Nikhil Trivedi wrote: ...pass parameters to call a jar file...
What do you mean by "call a jar file?"
"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
|
|
|
|
|
DavidCrow wrote: What do you mean by "call a jar file?
I meant to say that I want to unpack(Execute) a jar file from visual C++ app. and then get the result in the visual c++ for furthur processing. Suppose I am using jar file to generate an auth. number by passing a variable to the jar file, and want the auth number back in the visual c++ app. so that I can process it according to my requirement.
Thanks for your answer.
Nikhs
Nikhil Trivedi
|
|
|
|
|
Nikhil Trivedi wrote: I meant to say that I want to unpack(Execute) a jar file from visual C++ app. and then get the result in the visual c++ for furthur processing.
Use CreateProcess() for this.
"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
|
|
|
|
|
hi everyone! good day!
i just wanted to ask whats the difference between declaring a variable like this
TEST* pTest;
with
LPTEST pTest; // see code below
typedef struct
{
...
} TEST, *LPTEST;
thanks!
newbie
|
|
|
|
|
there's none... because LPTEST is just a synonym for being a pointer to a TEST .
but for readability reasons, i prefer using the TEST* notation
|
|
|
|
|
toxcct wrote: lisibility
Frenglish for "readability", huh tox'? From the french word "lire"?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
oh sh*t ! rotfl, you're damn right... i'm changing it immediately !
|
|
|
|
|
It was good though, it made me laugh as well.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
tnx a lot for the answers!
great help!
newbie
|
|
|
|
|
They are the same, basically it's only the MS way to fight the pointer notation fear...
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.
|
|
|
|
|
Hello,
im like to use more stl library as before, and therefore i need some help from the comunity
for better understanding how they work!
Ok, i know now how to use vectors, loop over them and serch in them.
Now i need to know more about maps, i try to make my map but i recive an error!
This is my try:
map<string, CMyObject>NewMap;
but this is not the right way , how to make my own map?
I found an example with two params, but in the MSDN is a samle with 4 params!?
Thanks for help!
termal
-- modified at 4:48 Friday 4th May, 2007
|
|
|
|
|
termal wrote: but this is not the right way
yes it is...
what error are you getting exactly ?
is it at compile time or runtime ?
|
|
|
|