|
Hi,
I know I should not use Clipboard to exchange data, But I don’t have any option at this time. Actually I want selected text from Microsoft word application. So when ever user select text in the word I send WM_COPY message to word to copy this text to clipboard and I can take this text from it for my application.
Now to make sure that data will be available until it is pasted or replaces with another content by user I am storing all content from clipboard. And when my application finishes its work with clipboard I again copy old content to clipboard.
If you have any other solution to get selected text from Microsoft Word then please tell me so I can avoid use of clipboard for my application.
Thanks,
Priyank
|
|
|
|
|
priyank_ldce wrote: If you have any other solution to get selected text from Microsoft Word...
How about Word Automation?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In my project, there is VsFlexGrid. It has 8 columns. Some columns datatype is boolean. That is, This column will be displayed as set of Checkboxes.
My problem is that I need to disable the column which is having checkboxes. After disable the column, the checkboxes should be grayed out.
Please help me.
-Mohan-
|
|
|
|
|
Hi All
May you please give me some information about following topicts :
1. how may I play one avi file in one dialog box ?
2. how may I show one bmp file in one dialog box ?
Best regads
Mahdi
|
|
|
|
|
1 - by using DirectX or Windows Media Player
2 - BitBlt
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
do you have an example about bitblt ?
|
|
|
|
|
This site has articles on how to draw bitmaps on the background of a dialog. Googling bitblt will give you tons of info. StretchBlt is the other API you may need. The other question is how you load your image. A bmp can be loaded with LoadImage, to load a jpg or gif, check my articles on GDI+.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
yes one example is on MSDN see BitBlt on MSDN.
|
|
|
|
|
(1)You can use of CAnimateCtrl or use of MCI functions
(2)You can open your file with CImage class and use of WM_ERASEBKGND for show it
<br />
#include AtlImage.h<br />
CImage m_Image;<br />
m_Image.Load("c:\\0.jpg");<br />
....<br />
void CAnswerDlg::OnPaint() <br />
{<br />
CPaintDC dc(this);<br />
m_Image.BitBlt(dc.m_hDC,0,0,640,480,0,0);<br />
}<br />
|
|
|
|
|
I am reading here c++ faqs Private inheritance section: http://www.parashift.com/c++-faq-lite/private-inheritance.html
There is an expression that i don't understand.They said :"Private inheritance makes all of the public functions of the parent class private in the child class".
So i understand that we can not reach them from derived class.But with "::" operator we can reach the functions.I don't understand the magic of this operator.I know it is scope resolution operator but is this also can reach private sections of the classes?
Or is this extraordiary rule for private inherintance.
class Wilma {<br />
protected:<br />
void fredCallsWilma()<br />
{<br />
std::cout << "Wilma::fredCallsWilma()\n";<br />
wilmaCallsFred();<br />
}<br />
virtual void wilmaCallsFred() = 0;
};<br />
<br />
class Fred : private Wilma {<br />
public:<br />
void barney()<br />
{<br />
std::cout << "Fred::barney()\n";<br />
Wilma::fredCallsWilma();
}<br />
protected:<br />
virtual void wilmaCallsFred()<br />
{<br />
std::cout << "Fred::wilmaCallsFred()\n";<br />
}<br />
};<br />
<br />
also<br />
class D_prot : protected B {<br />
public:<br />
using B::f;
}
|
|
|
|
|
sawerr wrote: So i understand that we can not reach them from derived class.
Not technically correct. It is more like copying every member of the base class into the child class, but putting it all under the private keyword. The child class can see (that is call) the base class' methods, but any outsiders would only be able to call the child class' public methods.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
Zac Howland wrote: It is more like copying every member of the base class into the child class, but putting it all under the private keyword. The child class can see (that is call) the base class' methods, but any outsiders would only be able to call the child class' public methods.
Not really. OP got it right, just used protected in his sample.
|
|
|
|
|
Nemanja Trifunovic wrote: Not really. OP got it right, just used protected in his sample.
Check again (he copied the example from the C++ FAQ):
lass Wilma {
protected:
void fredCallsWilma()
{
std::cout << "Wilma::fredCallsWilma()\n";
wilmaCallsFred();
}
virtual void wilmaCallsFred() = 0;
};
class Fred : private Wilma {
public:
void barney()
{
std::cout << "Fred::barney()\n";
Wilma::fredCallsWilma();
}
protected:
virtual void wilmaCallsFred()
{
std::cout << "Fred::wilmaCallsFred()\n";
}
};
also
class D_prot : protected B {
public:
using B::f;
}
For more information, check out this: http://www.gotw.ca/publications/mill06.htm[^]
And if you still don't believe me, try this:
#include <iostream>
using namespace std;
class Base
{
public:
Base() { cout << "Base::Base()" << endl; }
virtual ~Base() { cout << "Base::~Base()" << endl; }
void Print() { cout << "Base::Print()" << endl; }
};
class Child : private Base
{
public:
Child() { cout << "Child::Child()" << endl; }
virtual ~Child(){ cout << "Child::~Child()" << endl; }
void MyPrint()
{
cout << "Child::MyPrint()" << endl;
Print();
}
};
int main()
{
Child c;
c.MyPrint();
}
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
You're right. I didn't carefully look at his code, and it was a part of your comment that confused me :
It is more like copying every member of the base class into the child class, but putting it all under the private keyword
From the outsider's point of view it is correct, but the child class cannot access non-public members of base, and if you copy every member of the base to child's private section, all of them would be accessible from the child.
|
|
|
|
|
Nemanja Trifunovic wrote: From the outsider's point of view it is correct, but the child class cannot access non-public members of base, and if you copy every member of the base to child's private section, all of them would be accessible from the child.
The child class can access protected members, but no, it can't access private members.
As a side note, this is part of why it is recommended to NOT use private inheritance unless it is absolutely necessary (which it only is in very few cases) and instead use aggregation.
[sarcasm]Of course, my favorite type of inheritance is still protected .... [/sarcasm]
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
That's because you are using protected , not private
[EDIT] Forget it - didn't read the code sample well[/EDIT]
-- modified at 13:11 Friday 13th October, 2006
|
|
|
|
|
Hi
I am very new to VC++ ,I want to add a progress bar. Can anybody tell me how to put a progress bar in an application
Waiting for reply
|
|
|
|
|
You can see two examples of CProgressCtrl class on MSDN
|
|
|
|
|
Hi,
Use CProgressCtrl class or CreateWindow with PROGRESS_CLASS as its class name.
Regards
|
|
|
|
|
you can look at msdn sample CMNCTRL2. It has a sample of CProgressCtrl. but as a sample
//make a memebr variable
CProgressCtrl m_Progress;
//in OnInitDialog()
m_Progress.Create(WS_VISIBLE | WS_CHILD, rect, this, IDC_PROGRESS);
m_Progress.SetRange(0, 30);
//set the step by
m_Progress.SetStep(2);
//increment it
m_Progress.StepIt();
//or set position by
m_Progress.SetPos(26);
|
|
|
|
|
Javagal Srinath wrote: Can anybody tell me how to put a progress bar in an application
Like you would any other control. With your dialog template open in the resource editor, just select the control (in the Controls window) you want to add and then click the dialog. Move and size as needed.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to copy the items from the tree control that are selected using checkboxes into the File Open Dialog Box.To be brief my aplication consists of tree conrol and button in a form view.When i press the button File open Dialog Box is opening.Now i want to add the selected items from the tree control to that opened window.How can i do it.
Thanks.
|
|
|
|
|
Hi,
Open file dialog box is not designed for such functionality, it is common dialog box, though it is not impossible.
Use CopyFile, MoveFile functions to copy files to specified directory.
Regards
|
|
|
|