|
You're looking at using DCOM.
Here's why (I might be partially wrong here):
COM: The start of COM, targets In-Process (DLL) application (Controls, etc).
COM+: Phase 2, targets out of process (Exe, Service, etc), mostly expands on OLE but makes its stronger.
DCOM: Targets remote server processes, which usually are services anyways.
DCOM is trickier to setup since you need to carefully define security and server to server security isnt easy unless you master it.
Note that its possible for a DCOM server to also act as out of process server if the caller is on the same system.
With DCOM, you need to create a COM Server that support remote calls, this add some constraints to you code but is easily controlled from the compilation of the IDL file. Then, you need to create a proxy/stub in process DLL that will run on the client system process. This stub will simply forward calls to the server using some communication protocol that you can define in "Component Services" administration applet, and then will get the replies back. If for some reason, you need callbacks, then the proxy part will catch server's calls to you process and forward them, therefore making it possible to get feedback from the DCOM server. btw, callbacks have a different name which i cant remember .. lol.
I would highly recommend that you start with a COM/COM+ application. Then, once you master the intricate details of COM, especially out of process specifics, you can mature to remote.
You can test COM/COM+ using VBA (Word, Excel, etc) or using IIS with vbscript or jscript. Note that creating an enumerator for jscript is much much more complex than it is for vbscript. I find VBA to be the simplest way to start seeing progress on your work. But IIS is easier to create sample user interface to test stuff, HTML helping here. Althought in your case, you probably just need VBA as the client.
|
|
|
|
|
I'm trying to create a program exposing it's interface to any third party software. No language limitations or assumption on the third party software can be made.The program is supposed to run as a service on a constant basis.
Any suggestions with explanations,(COM?,COM+, DCOM?) will be highly appreciated. .
Hi
COM, COM+ does not serve ur purpose of exposing an interface to a platform independent thirdparty remote client.
DCOM will do (still it is not platform independent), but it is the 20th centuary technology. Personally i won't prefer u 2 go 4 DOCM.
The 21st centuary solution for ur requirment is Webservices - the nextgen of DOCM.
If u r familiar with .NET this is just a one day work to create an XML web service in .NET. Any client app ( Sun OS, Mac OS, Linux or what ever ) can access ur service.
If .NET platform development is a concern, u can go for SOAP Webservices using SOAP toolkit . Then VB6/VC6 is enough, For this:
1) Install Microsoft SOAP Toolkit latest version on the server.
2) Just create a VB/ATL com dll with ur exposed interface, but the output of the method shud be SOAP format compatible XML text.
3) Generate the WSDL from the COM from using SOAP toolkit.
4) Expose the WSDL url as a webservice to the clients.
If u want more advanced, maintainable, scalable, distributed architecture go for SOA , Service Oriented Architecture . this is the most advanced of web services. I just mentioned for ur knowledge, no need to go for this. If u r a fresher to these techs it will take time to study SOA.
Simple Webservice is more than enough.
rgds..mil10
|
|
|
|
|
Is there a way to create a method in COM (developped in Visual C++) so I could use the operator = in VB?
In other words, once I have created my object in C++ I want to be able to write this in VB:
<br />
Dim Object1 As New MyObjectType<br />
Dim Object2 As New MyObjectType<br />
Object2 = Object1<br />
Is this possible?
Thanks in advance
|
|
|
|
|
Need to ask you a question:
Do you want Object2 to be a copy of Object1?
or Do you want Object2 to be the same instance as Object1 ?
Difference between the 2 is that, if you have a copy, you can then set both with different property values. Otherwise, if you change a property on Object1 then Object2 will have its property changed at the same time.
|
|
|
|
|
Hi DB,
I want Object2 to be a copy - an independent copy... I am no VB specialist but I think the way to do your no 2 is:
<br />
Set Object2 = Object1<br />
Thanks,
Jerry
|
|
|
|
|
Humm .. i dont know if this can be done, but while you wait for an answer, i would suggess you create a Method in your COM object that copies the content like:
Object1.CopyTo(Object2)
Seems like the best alternate solution to me
|
|
|
|
|
Yep this is indeed what I have done - a Clone method but I was hoping of something more elegant!
Well that was for some VB users so never mind
|
|
|
|
|
yes jerry, u and darkbyte are on the right track. There is no other way other than creating a method which returns another copy of that object.
One decoration that can be done to ur Clone method is, make it as the default method of the interface. For this goto the IDL defenition and change the DISPID to 0. then the vb cleint can call the clone nethod as:
dim a as new UrObject<br />
dim b as UrObject<br />
a(b)
Here a(b) will call ur default method clone
rgds... mil10
|
|
|
|
|
Exactly what I was looking for! Sir, you are a star!
|
|
|
|
|
Hi All,
How we can test performance of a COM dll? Do we have any tools shipped with Visual Studio? Any free tools on net?
Thanks & Regards
Neo
|
|
|
|
|
I have a project that was originally built in Visual Studio C++ 6.0. I have since upgraded to Visual Studio .NET and am encountering a link problem. The project is a (non-ATL generated)COM server that also employs templates that is built across 2 projects. The base class("PluginServ") implements the DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer. The .def file is in the aggregated class ("DerivedPlugin") project and declares the above exports.
The link error is the following:
------ Build started: Project: DerivedPlugInServ, Configuration: Debug Win32 ------
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllRegisterServer
DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllUnregisterServer
.\Debug/VPF.lib : fatal error LNK1120: 2 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
Build log was saved at "file://c:\projects\src\DerivedPlugInServ\Debug\BuildLog.htm"
DerivedPlugInServ- 4 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped"
Anyone have any ideas as to how I may resolve this link error? I have looked online and have not come across a solution.
Thank you!
|
|
|
|
|
|
Hi! I'm trying to write a program that can grab the text from MS Word. This program will have to be seamless for the client, meaning the client can run a specialized program that creates it's own OLE instance of Word, so the only thing this program will have to go on is MS Word's HWND. According to the MSDN, if I can get the HWND for a class of _WwG, the inner-most window in Microsoft word, I can use AccessibleObjectFromWindow with OBJID_NATIVEOM as my object ID to get an IDispatch pointer to Word's COM model. The only trouble is, I have no idea what kind of object this points to. Is the Word.Application object, or Word.Document? Also, using GetIDsOfNames on this IDispatch interface never works, even for the must-have functions like QueryInterface and AddRef! Maybe someone could help me with this, I would really appreciate it, thanks!
-java
|
|
|
|
|
shameless bump
|
|
|
|
|
shameless bump
|
|
|
|
|
Hmmm .. here's something that might not work but might be worth trying.
Create a simple COM Object that you can use from script which exports a method that will return the pointer you get into a VBScript variant or object.
Dim myCom as new mylib.mycomobject
Dim myObj as Object
Set myObj = myCom.GetWindowObject()
Once coded, step thru code and look at myObj type in watch window or local vars. This might give you a hint althought its not guaranteed it will work.
|
|
|
|
|
I just read an article on programming the IWebBrowser2 using plain C and it raised a burning question for me so I had to double post
Please see the following
http://www.codeproject.com/com/cwebpage.asp?df=100&forumid=13828#xx897965xx[^]
How did the author know what interfaces were required???
It's killing me...i can't find info on this anywhere
I used the Ole Com object viewer tool and it doesn't tell me what i'm looking for...for IWebBrowser2 anyways
TIA
How do I print my voice mail?
|
|
|
|
|
|
GUYS ,
Have you tried using a console (NOT MFC) to access the functions you created in ActiveX(exe)?
Simple problem, make a simple functions in ActiveX (EXE), like adding of two integer and returning the sum of it to the client, save the sum to server variable + the new sum. On the other side, the client can call the ADD function by giving two parameters (A,B) and receive the sum of it, AND can ask for the value of all the sum been store in the Server variable.
grrrrrrr8888888....
|
|
|
|
|
hello,
i am new here on this site and have one quetion and hope to find good helpers here.
I want to fetch the outlook contacts. My problem is the outlook warning dialogbox. the user can give
permission for some minutes.
what i have to do ?? I have to write an Outlook-Addin?
thx a lot
|
|
|
|
|
I'm writing a client for a COM object for a company and come across this line in the disassembled tlb:
void Initialize([in] GetRefTypeInfo failed * pIConfig);
I realize that the reference type is probably defined in a separate tlb - which I don't have. Is there any way to retrieve the pointer type or otherwise work with this without having the type definition or any other documenation on this component.
|
|
|
|
|
I'm confused
When you derive an C++ class from an interface like IWebBrowser2 do you ALWAYS have to supply your own implementation of AddRef() , etc...???
Could you not do something like:
class CMy_IClass : ISomeChild, CDefaultImp
Where CDefaultImp is a generic base class which simply implements your AddRef() etc...?
Isn't AddRef() usually the same boring code anyways???
Thanks
How do I print my voice mail?
|
|
|
|
|
Hello Hockey,
The problem is that ISomeChild, being derived from IUnknown, dictates that your implementation class (e.g. CMy_IClass) implement the 3 basic IUnknown methods (i.e. AddRef(), Release() and QueryInterface()).
The implication is, of course, that you will need to provide the implementations for these methods. However, you can always use your base class's implementation of these methods, e.g. :
ULONG CMy_IClass::AddRef()
{
return CDefaultImp::AddRef();
}
Hope the above helps.
- Bio.
|
|
|
|
|
Hockey wrote:
When you derive an C++ class from an interface like IWebBrowser2 do you ALWAYS have to supply your own implementation of AddRef(), etc...???
Yes. Without AddRef() , Release() and QueryInterface() there would be no COM.
Hockey wrote:
Isn't AddRef() usually the same boring code anyways???
Have you looked at ATL at all? Sounds like you need it. It does all this, and more.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
hi there,
while working on an CFileDialog that automaticly selects all files in the browse-dialog
like this one from here
http://www.codeproject.com/dialog/select_all_button.asp
But I get a zero handler for the IShellBrowser
by calling this line , causing an abort
IShellBrowser* pShBrowser =
(IShellBrowser*)::SendMessage( p->m_hWnd, WM_GETISHELLBROWSER, 0, 0 );
---
the hook is assigned to the dialog that reacts properly. :
static UINT_PTR CALLBACK DialogHook(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if (uMsg==296) // init finish
{
//jumps in here
IShellBrowser* pShBrowser =
(IShellBrowser*)::SendMessage( p->m_hWnd,
WM_GETISHELLBROWSER, 0, 0 );
}
}
btw,hwnd returns the right handler to my CFileDialog
any ideas how to get the IShellBrowser from the CFileDialog ?
thanks in advance,
zerwuff
|
|
|
|
|