BCB problem using ActiveX production Edit

Category: C/C++ -> ActiveX/COM/DCOM Author: tanjx119 Date: 2001-08-03 09:44:20
 
tanjx119
2001-08-03 09:44:20
I want to Edit Edit in red font when OnEnter, OnExit when Edit font is blue, how to write ActiveX.
how to attribute initial value (for example, change the background color to green Edit)
hoo_ja04
2001-08-03 10:00:02
usually the preparation of such components, and I are first compiled VCL components, and then compiled into a COM component
You can also try this, so do some simple
edithchen1
2001-08-03 10:17:51
to intercept the message ~ ~ ~ ~ ~ ~ troublesome way to go ~ ~ ~ ~ ~ ~ ~ ~
lffcoolcool
2001-08-03 10:27:50
no intercept messages and onexit event in onenter add execute code.
I tried. No problem.
into the active form, like the usual way to change Edit1-> font can be.
jennifer8537
2001-08-03 10:33:50
Will genliter (Xu Han): In the VCL component development, how to join OnEnter and OnExit event code (not referring to the ActiveX Form in)
snjzyj
2001-08-03 10:49:42
Click in the type library Right, you can add a method. You can also add property! Note: Once sure to refresh! After adding back the file will be automatically added in XXmpl.cpp a code framework!
anqierxt
2001-08-03 11:08:29
to ch_builder (Chunhui) () Reputation: 103
this would lose a lot of vcl component's properties, events.
gapsss
2001-08-03 11:26:03
to songhtao (three years alone) () Reputation: 115

You're right, I tried, VCL properties event all gone, components written in no way brought ACTIVEX in
tengyan111111
2001-08-03 11:41:22
to the landlord, sorry I'm late.
this is, indeed, a lot of events will be lost, but you can get it back to the lost.
I have done no problem.
such tedit inheritance finished only four events, you can inherit function as usual, as modeled on that left four events onenter you want to get it back.
this process step is the most important Fire_OnEnter.
This is the inheritance of the mean.
Alas, I specifically say how to do it.
imp documents in other events modeled declare your function prototype.
below InitializeControl () event to connect with the parent function.
in the corresponding cpp file to define your code to be executed, but keep in mind should first fire. The final step in the class library
these two events added to it, you will see their id will be automatically connected.
ok
generally so, and dinner. Oh.
xuzishanlovehuai
2001-08-03 11:50:58
TO genliter (Xu Han)
according to what you said, for the realization of TEdit's OnEnter, I added the following code ActiveX:

# include " MyEditXControl1_TLB.h "
# include" MyEdit.h "

class ATL_NO_VTABLE TMyEditXImpl:
VCLCONTROL_IMPL (TMyEditXImpl, MyEditX, MyEdit , IMyEditX, DIID_IMyEditXEvents)
{
void __ fastcall ChangeEvent (TObject * Sender);
void __ fastcall ClickEvent (TObject * Sender);
void __ fastcall DblClickEvent (TObject * Sender);
void __ fastcall KeyPressEvent (TObject * Sender, char & Key );

void __ fastcall EnterEvent (TObject * Sender);
public:

void InitializeControl ()
{
m_VclCtl-> OnChange = ChangeEvent;
m_VclCtl-> OnClick = ClickEvent;
m_VclCtl-> OnDblClick = DblClickEvent;
m_VclCtl-> OnKeyPress = KeyPressEvent;
m_VclCtl-> OnEnter = EnterEvent;

}
hbxfxuweihao
2001-08-03 12:02:51
In Impl.cpp file added:
void __ fastcall TMyEditXImpl :: EnterEvent (TObject * Sender)
{
Color = 0x00FF8888;
Font-> Color = clYellow;
Fire_OnEnter ();
}

then this Fire_OnEnter () function should be how to write, if it is modeled Fire_OnClick () function, then, in Fire_OnClick () function inside another one: m_EventIntfObj.OnClick (); But in m_EventIntfObj not OnEnter Well
t1904
2001-08-03 12:14:14
TO genliter (Xu Han)
If convenient, please send the source code to the ActiveX to my mailbox [email protected], be grateful!