|
hi...
For the remote access of a DCOM server we need marshal/unmarshal code on both server mechine and client machine. Second concern is the access right prblms. Make sure u headed both.
Regarding Marshaling-Unmarshaling:
If all the data types in ur server is automation compatiable, then u can use type library marshaling , so no need to do anything on the server mechine, but just register the type ibrary on the cleint mechine. To register a type library u can use regtlib.exe , which is available for download at topdownlods.com
If ur server uses automation incompatiable data types u have to go 4 MIDL marshaling . For this u have to create a proxy-stub dll and register it on the server and client mechine. To generate a proxy stub dll: Goto server project folder, There will be a projectnamePS.mk file. goto commandline and run the nmake utility by typing nmake projectnamePS.mk to generate projectnamePS.dll . U have to register this projectnamePS.dll on both server mechine and client mechine. u can use regsrvr32.exe to register this proxy-stub dll.
Regarding COM Server Launch rights and COM Server access rights: This section i had xplained in a previous post. jus go thru this[^]) link, before u start ur fixs.
luks forward ur response, if any more concerns...
rgds..mil10.
|
|
|
|
|
Hi.
Thanks for your response. Regarding DCOMCNFG.EXE: I believe you are not describing the one from the Win XP , since it doesn't fit the description . Anyways, by meantime I figured out that the problem was that I didn't define the permissions as "Interactive user" (since my client application uses MFC). I'm sure I'll use your hint for the data transfer between client/server.
Thanks again for your help.
|
|
|
|
|
hi ...
Oh is it so? DCOMCONFIG is diffrent in xp? i never tried it in xp. Anyway only thing is that u have to set those accesrights, launch rights and the identity as u set alredy.. that much only..
have nice time... rgds...mil10.
|
|
|
|
|
How can I get a class name (such as "Word.Application") from an interface to an object? (c++) thanks!!
|
|
|
|
|
I assume you want the CLSID..?
Then there's a function for you right here[^]
If you want the C++ class which implements Word.Application, I think you'll have to ask someone in the Office division at Microsoft. And you will also have to be version specific as Word.Application is a version independent progid.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
Thanks for the quick reply, I appreciate it. However, I don't really have the skill to translate a CLSID into an actual name, unless I look it up in the registry. Also, how do you get the ProgID? All I have is an IDispatch interface...
|
|
|
|
|
<br />
WINOLEAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR* lplpszProgID);<br />
|
|
|
|
|
If you just have the IDispatch interface you may be out of luck. It all depends on what else the object exposes. It may expose a DISPID which will tell you something about the CLSID/ProgID (doubtful), or it may implement an interface such as IPersist (which has a nice function called GetCLSID), from which you can acquire the CLSID.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
It would be really appreciated if anyone could explain me how to connect number of client application to the same instance of an out-of-process COM server. The client applications must be able to share the data via the COM server, as well as call the COM server methods.
|
|
|
|
|
|
Another way of connection to an out-of-process COM server is to use the ROT (Running Object Table). You'll find more info about the ROT in the MSDN docs.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
With all due respect, was anyone ever able to find "more information" in MSDN docs?!
|
|
|
|
|
See GetActiveObject() & co
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
hi..
To make an out of process com compenent single instance, it needs just one line. Include DECLARE_CLASSFACTORY_SINGLETON(CUrClass) macro into the header file of ur coclass defenition header file, just below that DECLARE_REGISTRY_RESOURSEID...... macro..
Then the first CoCreateInstance call will create that object. All succeeding call to CoCreateInstance will return the same instance only... hope this is what u r looking for...
rgds...mil10
|
|
|
|
|
hi gurus,
I would like to know the difference between COM and COM+. I would appreciate if could get a detail description of each one of these. And I want to know whether all the features of COM are there in COM+.
Thanx in Advance,
Ravi.
|
|
|
|
|
hi ravi..
actually com+ is a framework which enhances the usage and scope of com components. Its not a binary standard like COM or a next version of COM. Its just the next vrsion of MTS.
In com, a dll is an inproc server. but by adding that inproc dll to the com+ framework we can make it out of process for scalability, almost similar to surrogates in com
Hope u r more familiar with Vb than vc, So consider the case of vb com method UpdateSales, in which u uses the ado connection object for transaction handling. here suppose u call some other two, three methods within UpdateCustomer and these internal fns: also uses transaction. Her the internal functions commited the transactions inside.
Then in the outer fn: suppose u want to roll back the transactions, tehn u can roll back only those transactions in the outr fn:, u can't roll back the transactions in the inner fns: that alredy got committed.
But COM+ is smart enough to handle this situation. Just group all these COM methods into a single transaction in COM+. Suppose the outer method need a rollback , then COM+ will roll back the transactions alredy committed in the previous COM methods also.
Not only thsi transaction handling.. Message queing, queud components, event subsscribing and lot more..... As a bottom line COM+ is for distributed, scalable thin client app development, the NextGen of Client-Server development paradigm..
rgds... mil0.
|
|
|
|
|
Microsoft came out with COM, which was nothing but a specification. Components built in any language according to this specification can be used with a client in any other language. So the programmer does not have worry about creating a single executable, since the component is identified by means of GUID (Global Unique Identifier), a 128-bit number that is stored in the system registry, along with other relevant information, to uniquely identify the component
COM+
In order for an enterprise application to be able to use COM, it has to have certain capabilities like:
Authentication
Object pooling
Transaction management
Support distributed architecture
Microsoft came out with DCOM (Distributed COM) and MTS (Microsoft Transaction Server) so that the developers don't have to add these capabilities to their components. Using the above two technologies, they can concentrate on writing the business logic instead of the background plumbing for their components
DCOM is an RPC (Remote Procedure Call) protocol used for communication between distributed components. Here the client makes requests to a proxy class on the local machine, which then delegates the call invisibly to a remote stub class installed on a remote machine
MTS is integrated with Microsoft's Windows 2000 OS under the new name COM+. But COM+ isn't just MTS; it also includes a host of other services. MSMQ (Microsoft Message Queue Server), which was released around the same time as MTS, is also integrated with Windows 2000 under COM+. MSMQ allows for asynchronous communication between clients and servers, which absorbs the impact of server inaccessibility. Event Service was added so that server classes can asynchronously communicate event occurences to multiple clients. The Load Balancing Service automatically instantiates requested objects on the machine that has the most available resources in the server farm.
i think you get bored of this but the theoritical facts are these.
All the Best!
|
|
|
|
|
Microsoft came out with COM, which was nothing but a specification. Components built in any language according to this specification can be used with a client in any other language. So the programmer does not have worry about creating a single executable, since the component is identified by means of GUID (Global Unique Identifier), a 128-bit number that is stored in the system registry, along with other relevant information, to uniquely identify the component
COM+
In order for an enterprise application to be able to use COM, it has to have certain capabilities like:
Authentication
Object pooling
Transaction management
Support distributed architecture
Microsoft came out with DCOM (Distributed COM) and MTS (Microsoft Transaction Server) so that the developers don't have to add these capabilities to their components. Using the above two technologies, they can concentrate on writing the business logic instead of the background plumbing for their components
DCOM is an RPC (Remote Procedure Call) protocol used for communication between distributed components. Here the client makes requests to a proxy class on the local machine, which then delegates the call invisibly to a remote stub class installed on a remote machine
MTS is integrated with Microsoft's Windows 2000 OS under the new name COM+. But COM+ isn't just MTS; it also includes a host of other services. MSMQ (Microsoft Message Queue Server), which was released around the same time as MTS, is also integrated with Windows 2000 under COM+. MSMQ allows for asynchronous communication between clients and servers, which absorbs the impact of server inaccessibility. Event Service was added so that server classes can asynchronously communicate event occurences to multiple clients. The Load Balancing Service automatically instantiates requested objects on the machine that has the most available resources in the server farm.
i think you get bored of this but the theoritical facts are these.
All the Best!
|
|
|
|
|
Hello,
I'm wondering if anyone could have a hint that could put up the light on me.
I've created a COM Service (COM Server & Service) and all works superbly. I access the objects on the COM service using IIS. I used to be able to debug my process as a Local Server instead of a Service by using the "-debug" command line option and that allowed me to see my coding mistakes. But i've come to a point where it works only as a Service and not as a Server.
If i use VBA from MS-Excel, i can access my object but not from IIS JScript where i used to be able to before.
Hmmmmm .. maybe if i completely unregister my proxy/stub DLL .. guess i'll try that tonite
|
|
|
|
|
I access the objects on the COM service using IIS
hope u fixd it already.. i dont understand anything, what u mean by accessing it from IIS-JSscript..
rgds..mil10.
|
|
|
|
|
What i mean is that in IIS, if i have a server side script from which i try to instantiate my base object like:
var obj = Server.CreateObject("my.progid");
this will fail if i start my object as a server but works if it is a service. Very weird actually. Haven't had a chance to work on it yet, but i'll keep you posted.
|
|
|
|
|
Ok..ok DB, let me know how u come over that... Actually i havnt tried NT services using com exe.
But a reasonable doubt is, if the com server is running as an nt service under local system account, how can u create objects of classes in that server. because our client programs are under the users account right?, and the Nt Service is under Local system account.
rgds..mil10
|
|
|
|
|
Heheh .. the answer is simple
<br />
::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE,<br />
RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);<br />
This is in my Service_Main code just after CoInitialize(NULL)
Havent been successfull at making it work as a Local Server even after doing a full rebuild of:
1) COM Server (which is also my COM Service)
2) COM Stub/Proxy
3) IIS Filter
It used to work fine and suddenly stopped working. But its probably a little something i bugged when i toyed my registering procedure to register my LocalService key under AppID.
My COM Service is in pretty good shape now. I've learnt a great deal about COM and how to handle it. Eventually i might need to bring it forward as a DCOM application but its not a requirement yet
I appreciate all the help i've been getting from you and any others that did help me find answers, even if it wasnt done directly, like when i browsed the great articles of CodeProject. I try to repay by helping others when i can.
|
|
|
|
|
Hi db ... Congrats... keep it up and learn more...
I can understand ur raising confidence in COM programming day bi day.. keep it up... best wishes ... mil10.
|
|
|
|
|
Morning all!
I'm having a bit of a problem with the IDL file generated by VS. I'm using VS7.1 to create a COM object, but I need to edit into the IDL a importlib("") statement. This is needed as I am using another interface from another COM library.
My problem is that everytime I edit the IDL file, then build the project, the IDL file gets recreated, erasing any changes I've made!
I know I'm missing something obvious here. Any help?
I Dream of Absolute Zero
|
|
|
|