|
WS_TABSTOP will work only if you host your control in a dialog - so for 'free' tabstops' you'll need to use CFormView (which is a dialog).
If you plan to keep CView, you'll have to check for WS_TABSTOP (in PreTranslateMessage, for example) and change the focus.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi,
I wonder, how much bytes or kilos will add to my ATL DLL file to include this handy header...
If I want to make a light weight component is a good idea to use it ?
Thanks, Bye !
Braulio
|
|
|
|
|
Hello Braulio:
As I know,adding some header files does not effect on size or performance of component so much.
I used ATLControls.h one time and I remember the realease version of component still very small.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Can I build an ActiveX that gives you ability to translate from one language to another language.
Hung Son
|
|
|
|
|
ActiveX can do everything,But for this purpose I don't think it is good idea to write it as ActiveX because the size of your ActiceX will become so huge(I can't imagine how much) and it caused very bad performane.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
But that's an exercise which my teacher give us !
Hung Son
|
|
|
|
|
You could use an ActiveX control to get the input and display the translated output. Using the ATL Appwizard is a good start. A composite control would probably be your best bet.
It would probably be better to build each seperate language as a COM server that could be called from your ActiveX control.
Michael
|
|
|
|
|
I need to create an ActiveX control that uses tree controls. I am very familiar with the CTreeCtrl MFC class and would prefer to use this in the control.
Ordinarily I would just add the controls I needed to a dialog resource and then use ClassWizard to add the revelant member variables and event handlers. I'm very new to ActiveX control creation and I don't seem to be able to find a way of doing what I want to.
Does anyone know how this can best be achieved?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Derek Lakin wrote:
need to create an ActiveX control that uses tree controls. I am very familiar with the CTreeCtrl MFC class and would prefer to use this in the control
In the last step of creating your project,choose in "create control based on" SysTreeView32 .
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I already thought of that but I actually need two tree controls inside my ActiveX control.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Derek Lakin wrote:
I actually need two tree controls inside my ActiveX control.
You mean you don't know how to create second one?
The same as when you create a control in windows appication.
Definr one ,then with Create(),SetWindowPos()
in OnCreate() and OnSize of
your ActiveX.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I've created an ActiveX control using the MFC ActiveX Control Wizard. As standard it inherits from COleControl.
I've added a handler for WM_CREATE which looks like this atm:
int CMyCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;
DWORD dwStyle = WS_CHILD | WS_VISIBLE |
TVS_HASLINES | TVS_DISABLEDRAGDROP;
UINT nFlags = SWP_NOMOVE | SWP_NOSIZE;
BOOL bCreate = m_tree.Create(dwStyle, CRect(7, 7, 70, 75), this, IDC_TREE);
if(TRUE == bCreate)
{
m_tree.SetWindowPos(&wndTop, 0, 0, 0, 0, nFlags);
}
return 0;
}
I've also added a handler for WM_SIZE as follows (I'm not worried about sizing yet):
void CMyCtrl::OnSize(UINT nType, int cx, int cy)
{
COleControl::OnSize(nType, cx, cy);
m_tree.SetWindowPos(&wndTop, 7, 7, 70, 75, 0);
}
The only other I've done is to remove the two default lines in OnDraw that fill the background white and draw an ellipse.
At the moment it draws absolutely nothing. I've stepped through and the creat calls, etc. succeed but I don't get a tree control drawn
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I think it has two reason:
First:
if(TRUE == bCreate)
{
m_tree.SetWindowPos(&wndTop, 0, 0, 0, 0, nFlags);
}
For the forth and fifth element you have to set width and height,here set them to 0,so yout reww control does not have any height and width so you can't see it.
Second:
You didn't add any item to tree control.you won't see anything until you add items.
Hope that helps
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Lets say I have two objects in my system: Cars and Trucks. They have similar functions: Start, Stop, SetPassengerCount.
Now I want to build Generic pool class so that I can hold and manipulate objects of the above classes, one pool for each class. The pool operations will be the same no matter the “type” of the pool.
When I instantiate a pool I want to tell it what type of pool it should be (Car or Truck) but I have no idea how to do this.
I tried to use void pointers but I really want to be able to “use” the objects from within the pool class. That is to say I want to “Start” , “Stop” the object but obviously I cant do this with void pointers.
I’ve searched the Internet but nothing I found really helps. Can someone suggest a few things that I should be looking into to solve this problem. I’m lost. Help.
|
|
|
|
|
Use a C++ feature called template classes. Any C++ book worth the price of paper is printed on should explain the ideas behind the template concept.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
class Pool<t>
{
};
Pool<car> MyCars;
Pool<truck> MyTrucks;
Good Luck,
Bill
|
|
|
|
|
Sorry, I lost some formatting in that post...
class Pool<T>
{
void Maintain();
T.Start();
};
To use it:
Pool<Cars> MyCars;
Pool<Trucks> MyTrucks;
MyTrucks.Start();
MyTrucks.Maintain();
Good Luck
|
|
|
|
|
I don't know why the formatting doesn't show up. What I was trying to tell you is to create a Template class to wrap either Trucks or Cars. For some reason, I can't get the less than and greater than signs to show up.
Sorry
|
|
|
|
|
If you insist on answering to me (instead of original poster), at least include the 'template' keyword in your example.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sorry, I thought I was. My screen resolution was a little to low. the original icon was out of sight
What do you mean by the "'template' keyword"? How does that help?
Thanks for the help,
Bill
|
|
|
|
|
Bill Wilson wrote:
What do you mean by the "'template' keyword"? How does that help?
I mean C++ 'template' keyword. The one you write when starting template class declaration
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am trying to build a PowerPoint presentation using automation in MFC and not getting real far. As usual, the code examples given by MS in MSDN on how to do this only shows the advanced topics and leaves the easy stuff as an exercise. The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color.
I was wondering if anyone knows of any documention and/or better examples on adding/formatting slides in a presentation. What I am trying to do is simple and shouldn't be this hard . I am adding text boxes which I figured out after many hours but I am unable to change the font color. I would like to do more once I figure out how the interface works.
Thanks!
|
|
|
|
|
Todd Hoop wrote:
The problem is that there is no offical documentation that I can find on doing the easy stuff like adding a text box and changing the font color.
I didn't play with automating PowerPoint - only with Excel and Word. The best way to get basic knowledge of the object model is to record some macros. You'll get the VB code in VBA Editor which you should be able to quite easily translate into C++ calls - method names will be identical. Just add textboxes and change the color.
Also, press F2 in VBA and you'll get Object Browser which presents objects, methods and properties.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz,
Thanks for the reply. I tried that path which does give an idea on how the objects come together but when implemented (changing font color in this case), I received errors stating that I am using objects that are not allowed in the current view. I believe it is from a .Select() call which is used to select the text to receive the font color change.
I will check out Objects Browser to see if it offers any clues.
Thanks!
|
|
|
|
|
Since a moment, I experienced a lot of problem with focus change between windows in a multithreaded application.
I have found some article in MSDN talking about 2 functions
LockSetForegroundWindow and AllowSetForegroundWindow
They seem very interesting to me but I cannot access to them
I have Visual C++ 6.0 and pack 5. What can be done to be able to use those functions.
If somebody know where I can found precise info concerning how works focus change, say it to me. Thanks
|
|
|
|