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
  • 0 Votes
    3 Posts
    3 Views
    J
    Hi Hush, You may be registering the exe on your machine rather than the remote machine. You need to run "dcom.exe /regserver" from the client and FROM the server. This can not be done remotely (as far as I know?). I have come across this problem often enough to include the following code in the remote classes to tell me where it is running. // *************************************************************************** //DESCRIPTION: // Return the machine name of the machine running this code. //PARAMS: // *pbsrtMachine Name returned here //RETURN: // Standard HRESULT //CREATED: // 1-2-2001, 16:51:31 by john@mctainsh.com // *************************************************************************** STDMETHODIMP CWhereAmI::GetMachine(BSTR *pbstrMachine) { ATLTRACE( _T("CWhereAmI::GetMachine(%p)\n"), pbstrMachine ); ATLASSERT( pbstrMachine ); USES_CONVERSION; //Get my name DWORD dwComputerNameLength = MAX_COMPUTERNAME_LENGTH + 1; TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 2]; if( GetComputerName( szComputerName, &dwComputerNameLength ) ) szComputerName[dwComputerNameLength] = NULL; else _tcscpy( szComputerName, _T("Unknown") ); *pbstrMachine = SysAllocString( T2W( szComputerName ) ); return S_OK; } --------------------------------------------------- I have a note on DCOM remoting at http://www.mctainsh.com/COM/SmartPtr3.aspx The hardest thing I find is getting security correct. Let me know how you get on... Have a great day! http://www.mctainsh.com
  • COM+ Component Services problem

    com help
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Catostrophic putref :(

    c++ com testing beta-testing help
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • DCOM server

    c++ com sysadmin help tutorial
    2
    0 Votes
    2 Posts
    3 Views
    L
    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 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); };
  • Windows Media SDK and MFC

    help question c++
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Class not registered

    c++ help sysadmin windows-admin announcement
    4
    0 Votes
    4 Posts
    5 Views
    J
    I have seen a similar problem before. In our case what had happened was that the .rgs file in the project was incorrect! That is it had different ID's to the actual interface! So when we registered it the registry entries were wrong. So, I suggest you check that the .rgs iids all match what the client is actually requesting. If there is not a match then I suggest you create a NEW project an add all your code to it, then re-compile the client(s). If this is not an option then you need to manually make sure that your server code has the iids that the client is asking for. (Find in files *.* all matchs for the previous iids, just to make sure). BTW: Really really make sure that the registry is clean, this is very important. So you should : Make sure that it is not running (or for DLL's not loaded). Deregister it. Then search the registry for old stuff (CLSID and Appid) Let us know how you go.
  • Can anyone find the symbols of OLE32.dll

    help question
    3
    0 Votes
    3 Posts
    2 Views
    L
    Eric, Check out: http://codeproject.com/dll/libdump.asp GEorge
  • ATL globals

    c++ question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • MMC programming ?

    question
    2
    0 Votes
    2 Posts
    4 Views
    L
    1. In MSDN, the latest version possible. 2. In msdn, try to search "ATL AND MMC" - you will find something like "writing an mmc snap in using atl 3.0" - a very good text 3. In internet, a very very very limited amount of info, may be 2 pages ps: I was writing a snap in durin 4 monthes and i did it, i did it,... cool. feel free to contact me by email reznitskiy@softlab.ru:-O
  • Exit from MMC

    question c++
    3
    0 Votes
    3 Posts
    3 Views
    L
    You cannot prevent _any_ user to exit from mmc. The only way to try something - is to make a "User mode, limit access".
  • Q: how to expose an interface using ATL?

    c++ help question com tutorial
    2
    0 Votes
    2 Posts
    4 Views
    M
    In ATL, your CA class is an abstract base class - it doesn't have implementations of the IUnknown methods, as you've found out from the compiler errors. See KB article Q181265 for the steps you take to make a new object. Basically, you instantiate a CComObject<CA> instead - CComObject provides the IUnknown implementation. --Mike-- http://home.inreach.com/mdunn/ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   --Buffy
  • Asp and thumbnail

    help question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • CORBA.. (I know it's a COM forum)

    com performance question discussion
    3
    0 Votes
    3 Posts
    2 Views
    C
    I would recommend OmniORB (www.omni.org) It is free. But as another replied you will never achieve the same performance as you can with raw TCP/IP. That said, we are running 5000 requests a second on a PIII/500 using omniORB. Christian Skovdal Andersen
  • Mixed COM Apartment models

    help com announcement
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • ClistCtrl and Callback Items in WTL

    c++ help question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    3 Posts
    4 Views
    L
    Thank you, Thank you Thank you. I've got it working at last. One of the problems I had with the error message was because I needed to include the atlbase.h header as well. Chreers
  • Window DLL to detect wm_message of an active window

    help tutorial question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • COM can be used instead of Dlls ?

    com question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Registering COM Object (NT Service) on Remote mahine?

    question com json help
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • My ActiveX in Excel's "Insert object" dialog?

    com question
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied