|
Hi there,
I don't know what hWnd are you passing as a parameter to the AtlAxCreateControl function, you should ask that window to return you the control. But I think is easier if you use AtlAxCreateControlEx, it will return a IUnkown to the control, or you can host the control in a CAxWindow, in that case you do CAxWindow::CreateControl and then CAxWindow::QueryControl or again just in one step, CAxWindow::CreateControlEx
Regards,
Fabian
|
|
|
|
|
Hello Group.
I want to try to make this kind of program
Have 1 Database with the filds like the example
Name - Jose
Mail - jose@test.com
Name - Mary
Mail - mary@test.com
I want a kind of smtp filter, when the user send a mail from outlook by exemple do name Mary, the winsock send a mail to the database specified mail.
This is possible ??
Someone can help or post some exemple to something like this smtp filter ?
Best Regards
|
|
|
|
|
Hello !
1. Sorry for my English
2. Bloody beginner
3. I have a ATL Full Control, invisible at runtime.
It is placed in a HTML Page with the <OBJECT> Tag.
There is a custom Message:
-----------------------------------------------------
#define MY_TEST (WM_APP + 1)
....
LRESULT OnTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
....
BEGIN_MSG_MAP(CmyClass14)
CHAIN_MSG_MAP(CComControl<CmyClass14> )
DEFAULT_REFLECTION_HANDLER()
MESSAGE_HANDLER(MY_TEST, OnTest)
END_MSG_MAP()
-----------------------------------------------------
OK. Compiles fine.
But how do I Post my Message?
Here is what I tried:
PostMessage(MY_TEST) or
::PostMessage(this->m_hWnd, MY_TEST, 0, 0)
gives me an Assertion failure at runtime with "::IsWindow(hWnd)"
That tells me PostMessage needs a Window. (?)
PostThreadMessage(GetCurrentThreadID(), MY_TEST, 0, 0) or
::PostThreadMessage(GetCurrentThreadID(), MY_TEST, 0, 0)
works, but the message handler OnTest is never called.
What can I do ???
MfG
Sebastian
|
|
|
|
|
Hi there,
Sorry I don't have an answer for you, mainly because I don't know/understand what are you trying to do, but, I have a couple of comments for you.
First never do something like this to obtain a message id
#define MY_TEST (WM_APP + 1)
somebody else can be using the same id for a different message, always use
UINT RegisterWindowMessage( LPCTSTR lpString /* message string */ );
for your messages, this API guarantee the returning id is unique.
Second, why do you use a Control that is invisible at RunTime?, if your object has no visible interface, it may be better to use a Single object or even an ATL Class.
Post a brief description of what are you trying to achieve, I may be able to help you.
Regards,
Fabian
|
|
|
|
|
I will try to explain the idea:
The article "Firing Events among ActiveX Controls on the IE Browser" by Yasuhiko Yoshimura
( http://www.codeproject.com/com/firingeventsamongactivex.asp )
showed me a way to link up multiple client-controls to a server-control.
The client-controls in my scenario are visualisations of data fired from the server-control.
The server-control is a "interface" with no UI which:
1. Links up to a 3rd-Party-Queueing-System...
2. ... processes the incoming data...
3. ... and fires events to the client-controls for visualisation.
And so the server-control shall be invisible.
HTML-Page:
<OBJECT ID="SERVER" CLSID...>
<OBJECT ID="Client1" CLSID...>
<OBJECT ID="Client1" CLSID...>
....
But all this lays in far future.
My Problem: The invisible server-control has to catch custom messages (defined by the 3rdPartyAPI).
To simplify things and for testing I try to catch my own WM_APP+1 message.
And in the way I'm trying to post/map my message it doesn't work.
Was my explaining OK?
Any idea will help me a lot.
MfG
Sebastian
|
|
|
|
|
Hi
I think I'm starting to understand what you are trying to do.
The fact of having several objects hosted on IE is irrelevant to your
problem, isn't it?
The real issue here is how to capture messages from a 3rd party package, am
I right?
So, let me ask you, is this 3rd party queueing system a COM based server or
not?, if it is so, it should communicate using event and not messages.
The article that you mentioned, "Firing Events among ActiveX Controls on the IE Browser", clearly talks about events and not messages.
If it is not a COM server, can you show me a piece of documentation how
it is suppose to communicate back to your code? I'm saying this because is
very unusual for a library to send messages to a client, usually this is
done through call back functions, so what you are saying sounds a litle odd.
Anyways, comments aside, here is how you can do the test you mentioned before.
First, declare the id of the message you will use.
Add this line to the stdafx.h file so it will be available to the whole project
extern UINT UM_MYTESTMESSAGE;
now define its value.
Add this into your cpp file.
UINT UM_MYTESTMESSAGE = ::RegisterWindowMessage(_T("MyAppNameMyMessageName"));
Now how to capture the message, if your class derives directly or indirectly from a CWindowImpl it has a BEGIN_MSG_MAP macro, so add this line
BEGIN_MSG_MAP(CMyTest)<br />
MESSAGE_HANDLER(UM_MYTESTMESSAGE, OnMyMessageTest)
... it may be something else here<br />
END_MSG_MAP()
Then you have to provide the OnMyMessageTest implementation, so add this
<br />
LRESULT OnMyMessageTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
MessageBox(_T("I got the message "));<br />
return 0;<br />
};<br />
And last, somebody has to send the message to this window, and I think here is where you have the problem, answering your question, yes, messages can only be send to a valid window, if you got an assertion here
ATLASSERT(::IsWindow(m_hWnd));
is because you sent the message when the window was not yet created, so, choose a place where the window you are send the message to, has already been created, then add this line
::SendMessage(hWnd, UM_MYTESTMESSAGE, 0, 0);
hWnd is a valid handler to the window where the message will be processed.
I hope this helps you, if you need an example project, let me know and I'll email one to you.
Regards,
Fabian
|
|
|
|
|
First of all thanks a lot for your effort to help me.
- The queueing system is a non-COM service. It uses messages to signal the queue-clients for incoming data.
- My invisible control is such a queue-client.
- My invisible control uses events to distribute the data-values to the other controls which visualize them.
It would be no problem if my invisible control wouldn't be invisible. It seems to me that there is no window created if a control is marked "invisible" (which was a little mislead to me). I tried to create a window inside my control, but this fails, too...
So I surrender and use the other possibility. My windowless control creates a thread which captures the queue-messages and fires the events....
...but multithreaded event-firing makes me shiver.
MfG,
Sebastian
|
|
|
|
|
I have C++ program which reads a binary file and creates an ascii result file. Ihave used the win32 dynamic dll project and exported my function like below.
__declspec(dllexport) __stdcall calculate(LPSTR sFileName)
it reads a huge file of around 206 MB and generates a ascii file of 300KB. I have used a FILE* object and fread and fprintf to do all the read writes.
when I run the prog for first time( after restarting) it takes a huge 48 secs with 216 MB free memory. on the second run with similar memory it takes only 20 secs. with the third run it even more reduces to 15 secs.
i am unable to understand why this might be happening. any light on this will be a great help.
if you need any more info please do write to me.
|
|
|
|
|
Maybe because the file was loaded to the cache at the first execution.
|
|
|
|
|
I found a nightmare when I develop a ActiveX control with vc.net 2003 ATL. The derived class dosen't response to many standard messages, such as WM_KEYDOWN WM_KEYUP WM_CHAR , and it dosen't Send WM_H(V)SCROLL with wParam as SB_THUMBTRACK.
Without those, I can't finish the ActiveX control at all. Could anyone be so nice to help me?
|
|
|
|
|
|
I am creating an activex treeview control (ATL, VC++ 6, Win2000) to use it from an MSAccess form.
I bind the control value to a field (RegionID, integer) in the form, and also bind a combo box in the same field. When I click some node on my activex control I fire an xxx_Updated event, and expect to see the combo box value change, but nothing happens, until my activex control loses the focus.
Is this the normal behaviour or am I doing something wrong, because I was expecting the other controls on the form that are bound on the same field like my activex control to be updated immediately when I fire the _Updated event, and not wait until my control loses the focus.
Thanks in advance for any help.
The code I use to fire the event is shown below.
<br />
LRESULT CTreeView::onclick(UINT uMsg, WPARAM wParam, LPARAM lParam, <br />
BOOL& bHandled)<br />
{<br />
if (FireOnRequestEdit(DISPID_VALUE) == S_FALSE)<br />
{<br />
bHandled = FALSE;<br />
return 0;<br />
}<br />
<br />
UNUSED_ALWAYS(wParam);<br />
UNUSED_ALWAYS(uMsg);<br />
<br />
POINT pt;<br />
TVHITTESTINFO hti;<br />
<br />
POINTSTOPOINT(pt, lParam);<br />
hti.pt = pt;<br />
HTREEITEM hItem = TreeView_HitTest(m_ctlSysCtrl.m_hWnd, <br />
&hti);<br />
<br />
if (hti.flags & (TVHT_ONITEMICON | TVHT_ONITEMLABEL))<br />
{<br />
TV_ITEM tvi = {0};<br />
tvi.hItem = hItem;<br />
tvi.mask |= TVIF_PARAM;<br />
TreeView_GetItem(m_ctlSysCtrl.m_hWnd, <br />
&tvi);<br />
put_Value(tvi.lParam);<br />
FireOnChanged(DISPID_VALUE);<br />
FireViewChange();<br />
SendOnDataChange(NULL);<br />
bHandled = TRUE;<br />
}<br />
else<br />
bHandled = FALSE;<br />
<br />
return 0;<br />
}<br />
...Plug & Pray...
|
|
|
|
|
Hi all
I had an control and i want to implement Width and Height properties of one.How i can do this witn ATL in VC7.0 so what i can change size of control not only design time by mouse ,but and by change a value in properties window of respective properties.
THANKS.
|
|
|
|
|
I suppose you want to change the size of AX control, when you resize the container, is it, then you must be knowing that Active(AX) control ZOOMs itself into the window, where you have placed...for example,
m_hWnd // is your parent window...ok
HWND myWND = CreateWindow(....//Rest of your paramater goes here
...
RECT....
m_hWnd); //or the Container Window
As you rezise you parent or container...your AX will auto adjust
regards
Balkrishna Talele
|
|
|
|
|
When I use CoGetObject for accomplishing my task...it shows me the dialog with following contents
"Installling Com Componenets" I dont want user to see this Dialog...and I alos know why does this dialog come..bcoz I unregistered my Service...How can I do that....how can i by pass this dialog
regards
Balkrishna Talele
|
|
|
|
|
Hi all,
1. I have three activeX aTL control,
a.ParentFullcontrol (Full control),
b ChildCompControl(composite control)
c.ChildFullControl( Full control).
Now I want ChildCompControl and ChildFullControl as a child of ParentFullcontrol.But i don't know how and where to create these control?
and which APIs to use.
Can anyone help me out.
Thanks in advance
Abhishake
|
|
|
|
|
According to what I understood you question..the answer si as follows.
If you want to place you child ActiveX coiontrols on the parent controls....u need to use AtlAxCreateControlEx(....)...but remember the HWND of parent and child to put them on proper window...if this is not what you want , please do elobrate your question...I shall be gald to anwer the same
regards
Balkrishna Talele
|
|
|
|
|
Thanks Balkrishna,
One more question in relation to this,
Can you please tell me where i should create two child control, for time being i am creating it in OnDraw() of parent something like this
// hwndParent is the handle to Internet Explorer_Serversever Object
HRESULT OnDraw(ATL_DRAWINFO& di)
{
// other stuff
CAxWindow MyWindow(hwndParent);
hr = MyWindow.CreateControl('CLSID of 1st control',NULL,NULL);
hr = MyWindow.CreateControl('CLSID of 2nd control',NULL,NULL);
return S_OK
}
My 1st Control is a Composite control.
And 2nd control is again Full Control.
MyWindow.CreateControl for 2nd control returns me S_OK.
But now i cannot see the other Full control. Can you explain me why?
Again Thanks in Advance,
Abhishake
|
|
|
|
|
According to the scenario What I feel is, you shouldnt create the control in OnDraw, you must do that all these stuff in OnCreate...,in OnDraw you control will get create again n again. and secondly Composite controls are use to hold the other controls (like full control or simple object)
What I did for such scenario is/was
I createed window in OnCreate..and remembered the handle to that window, this window was created on Internet explorer toolbar. Then I placed my composite control....Where in I created second window inside Composite control...as i explained before ..Composite control acts as container and holds other onjects. and placed Full control inside the composite control..or inserted inside composite control..and they ran smoothely...
if this dosent solve your problem. Just do let me know.
regards
Balkrishna Talele
|
|
|
|
|
Hi everybody,
Does anybody know, how I can use a WTL splitter window instead of a CSplitterWnd in an MFC 6.0 project? I want to have a more flexible splitter window in my application. please explain it in detail because I don't know much about WTL.
thanks in advance,
Roozbeh.
|
|
|
|
|
|
Ive just finished coding a graphics active X control and I wanted do drop it straight into a visual basic application iam working on, but for some reason all of the properties that ive added to me control (such as position angle etc) dont appear in the properties editor in VB. Do I need to create a property page or do something in order for this to happen. As I can happily change my control properties in a VBsciptlet in a HTML page so why not VB???
[] /\ () X
|
|
|
|
|
If they're marked correctly in the IDL file (the Get method is marked propget , the Set method propput or propputref and both have the same dispid) and the interface is marked default , they should have appeared in VB's Properties page.
If you want to do extended property handling, such as categorisation, see the following MSJ article: http://www.microsoft.com/msj/0399/atl3activex2/atl3activex2.aspx[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I have the properties marked correctly such as:
[propget, id(1), helpstring("property angleX")] HRESULT angleX([out, retval] double *pVal);
[propput, id(1), helpstring("property angleX")] HRESULT angleX([in] double newVal);
Where is the interface supposed to marked as default? And how is this done in code?
Is it something like this?
[default] interface Iviewer;
Also in visual basic ive noticed that when I goto add my control to the tool bar i have the options of either adding my control as a "Control" or a "insertable object". When I add it as a control it crashes upon use? Whichs should be using because it appears one is defintaley differant to the other?
[] /\ () X
|
|
|
|
|
You mark the default interface in the coclass statement in the IDL file, using the [default] attribute. Visual Basic can use non-default interfaces (unlike scripting clients) but will only show the properties on the default interface.
You should be adding your control as a control. "Insertable object" is for Active Documents, such as inserting a Word document into your project. You can debug the interaction with Visual Basic by setting VB6.EXE as the executable to debug in Project Settings.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|