|
Thanks, I think I've found a problem. It's quite tricky if you don't know indeed.
The standard Windows NT configuration doesn't include an Atl.dll in system32 dir. Neither you can see it in "Dependency walker" when checking your COM deps., so to enable registration of ATL COM on the fresh installed NT, you must copy that dll and register it as well as it needs to have an Ole32aut.dll but proper version (NT, or 95). Unfortunately this small tip is not noticed anywhere you can see straight away and for new COM developers can be a time consuming.
Thanks again,
Dimitri.
|
|
|
|
|
|
If you build your project with /D "_ATL_STATIC_REGISTRY" compiler option you do not need atl.dll to register/unregister you component.
|
|
|
|
|
Hi.
I've made an ActiveX exe in VC++. How do I put it in a web page?
(I'm new at ActiveX EXE's. So maybe i'm going at this the wrong way.)
Thanks
Chris
|
|
|
|
|
Hi Chris,
There is a very nive article in MSDN called "Internet First Steps: Upgrading an Existing ActiveX Control". I think it exactly what you are looking for...
Regards,
Alex Gorev,
Dundas Software
|
|
|
|
|
Hi!
I have developed a simple COM object using ATL 3.0. I intend to use this object in a web page. Everything works nice except for the event firing. These events are being fired from a second thread via a PostMessage mechanism, so that no apartment issues arise. The strange thing is that my ProxyGenerator wizard generated code has the connections variable (int nConnections = m_vec.GetSize();) set to zero (watched this behaviour while debugging) so that the firing doesn't take place.
The same thing happens if i package my component has a Lite control. But it all works perfectly fine with a Full control. The problem is that i don't need a UI, consequently, i don't need a Full control's overhead. Is it possible for a simple Com object to Fire Events to the IE? How?
Please help me!
Thanks in advance.
Luís Teixeira
|
|
|
|
|
How can a COM server detect his clients ?
Best regards
|
|
|
|
|
Hi.
I'm Soohyun Bae.
Now I'd like to hook some messages invoked by IE document, for example, mousemove, mouse click, key down...
Now, I could receive these messages by connecting my class derived from IDispatch to IE document.
CImpDispatch* m_pEvents;
m_pEvents = new CImpDispatch((IOleInPlaceFrame *)this);
hr = pCPC->FindConnectionPoint( DIID_HTMLDocumentEvents, &m_pConnectionPoint );
hr = m_pConnectionPoint->Advise(m_pEvents, m_dwConnectCookie );
...
and CImpDispatch...
STDMETHODIMP CImpIDispatch::Invoke(
DISPID dispIdMember, REFIID riid,
LCID lcid, WORD wFlags,
DISPPARAMS* pDispParams, VARIANT* pVarResult,
EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
IHTMLEventObj *pEvtObj = NULL;
long x;
HRESULT hr;
if (dispIdMember == DISPID_HTMLDOCUMENTEVENTS_ONKEYDOWN )
{
hr = m_pWindow->get_event(&pEvtObj);
if (hr == S_OK)
{
pEvtObj->get_keyCode(&x);
// A key hook
if (x==65)
{
Trace("_HOOK: A key pressed");
x=0; // Point 1
hr = pEvtObj->put_keyCode(x); // Point 2
if (hr==S_OK)
{
pEvtObj->get_keyCode(&x);
}
}
}
}
return S_OK;
}
I could take reference code in www.microsoft.com/Mind/1297/hookIE.htm (really good...)
-----------------------------------------------------------
My Point is :
I hope to prevent resending specified message to IE.
I have thought that two points 1 and 2 could make so. But, ... couldn't...
How can I prevent resending ?
|
|
|
|
|
A server knows the client is present or not by using reference counting. But how knows the server when a client crashes. In that case the client is not able to call Release.
|
|
|
|
|
Does anyone how to import "tlbinf32.dll" ? When i tried like following:
#import "tlbinf32.dll" no_namespace named_guids
I got a bunch of compiler error.
Andy
|
|
|
|
|
import "tlbinf32.dll" exclude("ParamFlags", "IDLFlags", "ImplTypeFlags","_DirectCalls")
|
|
|
|
|
I am trying to write a DCOM server application. Some of the interface functions have paramaters that are user defined data types (structs). I have the header files where these type definitions are included in the server .h file included in the .h file of the server .cpp file. When I try to build, I receive the following error that points back to the .idl file:
"Expecting type specification near "data_type".
Any advice on how to remedy this. I am fairly new to DCOM/COM programming.
|
|
|
|
|
Hi,
(1) Your interfaces which uses structs or other defined types must me custom defined.
(2) The only place where you must define your structs is the .idl file (see below).
(3) Don't forget to compile your <yourserver>PS.mk (Visual Studio generatied make file)
(4) Use CoTaskMemAlloc() and CoTaskMemFree() to transfer the struct data (example shows an array of structs)
Success Aat
EXAMPLE
// YourServer.idl : IDL source for YourServer.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (YourServer.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
typedef struct
{
int iType;
int iValue;
// E.t.c.
} YOURSTRUCT;
// ....
[
object,
uuid(BECF60B9-2741-11D4-A05E-00B0D0201DD6),
helpstring("IYourObject Interface"),
pointer_default(unique)
]
interface IYourObject : IUnknown
{
[helpstring("method Read")] HRESULT Read([out,size_is(,*plNumStructs)] YOURSTRUCT** ppYourStructs, [in, out] long* plNumStructs);
[helpstring("method Write")] HRESULT Write([in,size_is(lNumStructs)] YOURSTRUCT* pYourStructs, [in] long lNumStructs);
};
|
|
|
|
|
Hi,
what is UI element in controlpanel / display properties.
there four tabs back ground, screen saver etc. what is that
UI element?
Thanks,
Koteswara
|
|
|
|
|
HELP !
I am VERY new to COM (3 days experience) and I want to do something which may sound a bit odd.
I wish to take a pointer to a C++ object from one application and pass it via COM to another C++ application.
The only stuff I have found on doing this involves serializing the objet to a CMemFile and passing it as a string.
The Object I wish to pass is a container and I do not wish to make everything it holds serializable, problem.
If anybody can help me it would be nice.
Thanks
|
|
|
|
|
You can try to get pointer to your object and then pass it to your COM object as LONG. That way your COM object will know the memory location of the object you are passing.
Peter
|
|
|
|
|
I have tried passing the pointer to the object as long.
When I do this it does not appear (when debugging the COM)to have the same value it had in the app which created it.
Also I could not get the long value back into the second app, it had a different value.
Puzzled !
|
|
|
|
|
If your com is an exe the passing a pointer as long will not work since the com is in a diferent process and therefore the address in the long is not valid. Passing pointers as long will work only if your COM is a dll.
(Don't forget to cast the pointer in both sides back to the structure it points to, before using it).
|
|
|
|
|
On the other hand it would be better to create a COM wraper for the object that you are passing. And than just pass the interface pointer.
|
|
|
|
|
How do I create a COM wrapper ?
Remember I am very new to COM.
|
|
|
|
|
>I wish to take a pointer to a C++ object from one application and pass it via COM to another C++ application.
You cannot do this, COM or no COM. Each Win32 app has its own isolated memory space. A pointer in app A has no meaning if you pass it to app B.
You'll need to use IPC (inter-process communication) techniques to pass data between apps. There are articles here at CP on doing this - give them a read. (You are sort-of on the right track with CMemFile, but CMemFile is not a memory-mapped file, which is the IPC mechanism you're thinking of.)
|
|
|
|
|
What exactly are you trying to do? What does this C++ do that separate applications need access to it? You might want to put the C++ object in a separate COM object and have it shared between processes.
|
|
|
|
|
I am using one app to do an external equipment search (this takes a while) and store the objects it created (one per equipment present) in a COM server. I want many other applications on the same machine to be able to query the COM server to get pointers to the objects.
So
Equipment search app -> COM server
COM Server -> Testing App 1
COM Server -> Testing App 2
etc
I do not want to have to go through all my equipment classes and make them serializable.
Thanks
|
|
|
|
|
Then I would wrap your C++ class in a COM object. You can pass an interface pointer from your server to the clients so they may access the C++/COM object.
|
|
|
|
|
Then I would wrap your C++ class in a COM object. You can pass an interface pointer from your server to the clients so they may access the C++/COM object.
|
|
|
|