Skip to content

COM

COM discussions

This category can be followed from the open social web via the handle com-ba4ced8e@forum.codeproject.com

4.8k Topics 11.7k Posts
  • polymorphism

    oop question
    3
    0 Votes
    3 Posts
    7 Views
    B
    What you're talking about is called "overloading functions." Polymorphism is a different thing entirely! Plus, you *can* have such methods if they are in an IUnknown-based (custom) interface, but you have to promise never to use it with VB... :) Brian Hart
  • AfxConnectionAdvise

    c++ sysadmin help question
    5
    0 Votes
    5 Posts
    16 Views
    B
    "If the server is launched remotely by the client, I cannot establish the connection between them." Jose, Look soon for a tutorial I wrote, implementing a DCOM server and client with the full support for everything, including making the server a Service, which in your case would solve your problems. However, you don't have a service, you have an EXE. Here's what to do: 1. Click the Start button, and then click Run. 2. Type 'dcomcnfg' in the box. 3. Search in the list for the name you gave your server project (say 'EventSvr'). Double-click it. 4. Go to Identity. Click 'This user,' and type in the Administrator username and the Administrator password, if you know it. If you don't then ask your sysadmin. Voila! Hope it works :) Cheers, Brian
  • MTS and COM !

    database help c++ sql-server com
    2
    0 Votes
    2 Posts
    8 Views
    L
    Hi Your problem is quite a common one in MTS. the problem may be because you are using a transactional component and the recordset is getting closed before you can access it. You must remember that MTS normally deactivates a component after every method call(thus the expression stateless objects)in which you Complete a transaction. What you must do is to ensure that your state is maintained for as long as you want. Thus the best way would be to use the DisableCommit of the IObjectContext interface at an appropriate place like for example in your IObjectControl::Activate method. This ensures that no transactions are completed until you specify a SetComplete on your IObjectContext method. I would advise making a method which does this SetComplete. Putting cleanup code in FinalRelease of your component is tricky because you cannot know how many times MTS will activate and deactivate your object. rather it is better to either make a cleanup function of your own or use the Deactivate method of IObjectControl. I hope this helps to solve your problem. If not then email me and I can give you some sample code. I am even mailing you a copy of this suggestion.
  • How to implement interfaces in separate classes (ATL)

    c++ com tutorial
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • COM and ISAPI

    delphi com question
    2
    0 Votes
    2 Posts
    8 Views
    E
    Hi, It's important to Initialize COM library for each ISAPI thread. You should initialize COM libray in GetExtensionVersion entry-function and uninitialize it in TerminateExtension enty-function. Erik
  • 0 Votes
    3 Posts
    10 Views
    L
    Thanks for your reply. I have solved the problem ... and in the near future, I will post a short description of how I did it. -Keith
  • cannot receiving events

    c++ com
    2
    0 Votes
    2 Posts
    7 Views
    A
    Hi, You have to implement the sink in the client to be able to advise for the events. Check the arctile from MSDN ID:Q181277 "SAMPLE: AtlSink Uses ATL to Create a Dispinterface Sink" for more details... Regards, Alex Gorev, Dundas Software.
  • IE Context menu on ActiveX control..?

    question com
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • problem with GetObject

    help sysadmin
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Spell Checking

    question
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Spell Checking

    question
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Edit Control in Internet Explorer Band Objects

    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • CDialog in ATL COM DLL Server

    c++ com sysadmin question learning
    2
    0 Votes
    2 Posts
    8 Views
    C
    Well if you are going to use CDialog... you need MFC support... as CDialog is part of MFC. If you don't want to include MFC then use an ATL dialog.
  • 0 Votes
    3 Posts
    9 Views
    N
    Thank you. We are a Dundas customer BTW. NotJeff
  • Register a DLL server

    c++ com sysadmin help question
    3
    0 Votes
    3 Posts
    5 Views
    T
    Thanks! I'm just curious how you find the root of the problem. Tony
  • IE 5.5: QueryInterface(IPersistStreamInit) fails on frames?!?

    html question
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Fireing events from a Thread...

    com tutorial question
    2
    0 Votes
    2 Posts
    6 Views
    A
    Hi, Events are signaled by calling the Invoke method of an IDispatch interface supplied by container. The interface lives in the apartment of its own thread, which is also the one containing the control itself. To comply with the STA model, we can only safely call this interface's methods from the thread in which it was created. If the control wants to signal an event from a different thread it must Marshal the IDispatch interface into the IStream first and then UnMarshal it. And of course it must call CoInitialize() too. To Marshal/UnMarshal interface pointers you can use my favorite functions: CoMarshalInterThreadInterfaceInStream(...) and CoGetInterfaceAndReleaseStream(...). Regards, Alex Gorev, Dundas Software.
  • Handle of edit box in IE COM

    question com
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • function to view error.log file

    help question
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • 0 Votes
    4 Posts
    14 Views
    L
    Hi, Those examples do not relate to my question, for each example creates its own instance of excel, which it then uses. I want to attach to an existing instance, and using AttachDispatch with Excel.Application, is no solution as it will only find the first instance of excel. As I mentioned in my prior message, it is easy from a xla, but I would still be curious how to find the correct IDistatch from an xll (or any c++ written application). For your information, a much better method than proposed in Q192348 is Q186427. The closest MSDN example to my problem is found in Q190985, but there, Excel is running as a container. Regards Leo