|
Does anybody know how to fill the fields of IE's web page
from within VB or C++ ? What if the page is secure? Of
course, there is no problem to fill all the fields by
hand. The question is how to do it automatically, by
running .exe or .dll.
|
|
|
|
|
|
Hello,
I am confused about the Marshalling. When is it needed actulaly ??.....(when we want to run an out of procees server)... thats what i know. But cant we like run an Exe server without the marshalling support. I think i have seen some source code which makes an exe server (nothing else i mean no proxy/stub implementation is there ... no DLL). And you can invoke it from the client. This suggests that u can make an Exe server without Marhalling support is that true ? kindly clear me about this ...
Thank you
|
|
|
|
|
Marshalling is always required when calling between different execution contexts. This can include calling between components in a single-threaded apartment and a multi-threaded apartment (e.g. if the calling thread in the executable called CoInitialize , OleInitialize or CoInitializeEx with the COINIT_APARTMENTTHREADED flag, and the component in the DLL is registered with ThreadingModel = Free). Marshalling is always required on a cross-process or cross-machine call.
Marshalling is the process of converting the call parameters into a suitable in-memory or network representation in order for the RPC library to transfer the call across the execution boundary. When received on the other side, unmarshalling is the process of converting back from the in-memory or network representation into a procedure call. The return value and any output parameters are then marshalled back to the caller.
COM looks in the registry on a per-IID basis to locate proxy/stub implementations. You can find them under HKEY_CLASSES_ROOT\Interface\{IID}\ProxyStubClsid32.
There are two cases in which you don't need to supply a proxy/stub implementation. The first is where you're only using standard interfaces, or interfaces defined by a third party. These should already be registered. If you only use IDispatch (Object in VB 6), you don't need a marshaller.
The second is where you're using only Automation-compatible types. For these, you can use the Automation marshaller, which uses the type library to marshal parameters. You must register the type library for this to work, by calling RegisterTypeLib .
The Automation marshaller goes by the name of PSOAInterface, and has a CLSID of {00020424-0000-0000-C000-000000000046}.
|
|
|
|
|
Hmmm Great Reply,
No wonder i was getting interface not supported when i tried to RUN my Exe Server, while the exapmle code that i saw worked(as it supported the standard interfaces ..and therfore had no proxy/stub implementation) ..... Thanks that was a great reply...it helped me a lot. Code Project is great ... i have learnt a lot from these forms specially.
One thing more. To my knowledge using midl tool u can do marshalling easily for custom interfaces ....... i have made the interface in MIDL and compiled it, it gives me a lot of files .... I guess u have to get a dll out of it somehow ........ which u have to register under the proxy/stub in registery...plz correct me if i am wrong
Thank you
|
|
|
|
|
Usually (depend on midl options) you'll need xx_p.c file (proxy stup), xx_i.c (interface defs), dlldata.c
If you use atl/com wizard it generates makefile for proxy stub: dllxxx.mk
Edward
|
|
|
|
|
hi there people..
i lost my cd which came along Inside Ole (MS press) by Kraig BrockSchmidt...any body with a copy...
or any link?
many thanks
|
|
|
|
|
Hi, I am new to using COM, this is the first time I have tried, I have an MFC application that creates merge data for Word and I was wanting to create a Word document within the application add relevant merge fields and automatically attach the created data then save the document away, can anyone point me in the direction of some good tutorials, or useful information for the aspects of the Word COM I am looking for, thanks.
Ben.
|
|
|
|
|
|
Thanks for that, I have actually seen the first one of those before and have tried to take it apart and get what I need, as I said this is the first time I have tried using any sort of Component Object Model so I have found it hard trying to identify useless and useful code, the comments help a little but I was hoping for something that actually explained the different parts of the code rather than just saying what the parts do.
Thanks again,
Ben.
|
|
|
|
|
I have written an object supporting IPersistStreamInit.
Now I want to save/load it in/from ordinary (not structured file).
How to get IStream on ordinary file ? Or I must add an IPersistFile to my object ?
Thanks in advance,
Valery
|
|
|
|
|
You'll have to implement it yourself. Not very hard as IStream methods map pretty much 1:1 to the Win32 API.
--
I am perpetual, I keep the country clean.
|
|
|
|
|
Thank you for the reply, I'd rather implement IPersistFile on my object
|
|
|
|
|
Of course you should, but still - you need that IStream, and if you don't want to use structured storage, you'd have to implement your own class CFileStream : public IStream .
--
I am perpetual, I keep the country clean.
|
|
|
|
|
It seems Microsoft intentionally don't provide IStream on ordinary files, but I don't know why.
|
|
|
|
|
I can not appreciate the need for a ClassFactory. Why we dont create the object directly when we have its CLSID, instead of first creating ClassFactory which inturn creates the Object ? Why can anyone explain please...
|
|
|
|
|
So far the biggest reason I've seen is that you can implement nifty things such as component licensing. I don't know how common that is, but I know it's possible (using IClassFactory2).
IClassFactory gives you the option to do "cool stuff" without having to making the wanted COM objects dependent on it. Cool stuff might be downloading something from the net, or checking its own integrity before handing out object, or - whatever you want it to do.
--
I am perpetual, I keep the country clean.
|
|
|
|
|
The class factory controls how the COM server (the dll or exe) dishes out the inplementation objects. It can be programmed to hand out a new COM object for each call to CoCreateInstance, or it can continually hand back the same instance to all requesters. Other things are possible too...
Read "Inside COM" by Dale Rogerson for an excellent and thorough explanation of the use of class factories.
~Steve
|
|
|
|
|
You could still do that even if you only had DLLCoCreateInstance()...
I suppose the killer app for class factories is that you can use a class factory on another machine. That's hard to accomplish with a HMODULE and GetProcAddr() if the DLL you seek is on another machine..
--
Seraphim Shock. Gold for your ears.
|
|
|
|
|
I have constructed a COM object in VB6 that exposes various methods to handle custom files. This object works very well when I use it from a normal VB6 project, but when I use it through COM Interop in a C# application a strange error appear:
Inside one of the functions in the COM dll I use the FileExists method on a FileSystemObject. When this method is called from the C# code FileExists returns false, even though the file exists. When the same method is called with the same filename as parameter in VB everything works.
Anyone who have any idea of what I am doing wrong?
Rickard
|
|
|
|
|
Hello,
I am trying to learn to learn about the COM/OLE architecture and make COM/OLE components. I have been using OLE inside (2nd Edition) but it is outdated. The samples are old .. . And besides i dont think the book is that good. Can anyone suggest a better book to learn about COM/OLE WITHOUT ATL AND MFC..
Thank YOu
|
|
|
|
|
Inside COM (Dale Rogerson if my memory serves me)
Essential COM (Don Box)
And if the paths that I have followed/have tread against the flow/there is no need for sorrow
I am coming home
Return, Crüxshadows
|
|
|
|
|
Stefan is right, "Inside COM" is superb...
~Steve
|
|
|
|
|
Check out Developer's Workshop to COM and ATL 3.0 by Andrew Troelsen.
Kuphryn
|
|
|
|
|
Don Box's book is very good but in my opinion bad for starting out - it is too complicated, and at least in my case it overwhelmed me.
Troelsen's book is readily available and seemed good, I have only skimmed through it.
In my case me and my colleague learn with a lesser know book, 'The COM and COM+ Programming Primer' by Alan Gordon, Prentice Hall. Very clear style, good examples, easy to read and follow. Very recommended, I was given a few monthes ago a huuuuuge COM+ project to mantain and had no COM+ experience. This book I am reading it now for the second time and it is so good. Box's book I have but have not taken the time since it goes too deep, Gordon's is very practical. Troelsen I almost bought and will probably in the future.
Best luck,
Juan
|
|
|
|