Click here to Skip to main content
15,921,452 members
Home / Discussions / COM
   

COM

 
GeneralCOM Addins (A request for guidence and ideas) Pin
Michael P Butler18-Sep-01 23:34
Michael P Butler18-Sep-01 23:34 
GeneralRe: COM Addins (A request for guidence and ideas) Pin
Michael P Butler19-Sep-01 0:51
Michael P Butler19-Sep-01 0:51 
GeneralRe: COM Addins (A request for guidence and ideas) Pin
Anonymous27-Aug-02 9:06
Anonymous27-Aug-02 9:06 
QuestionProblem: VC client and COM+ Server Component, but VB client works just fine. Why? Pin
17-Sep-01 9:05
suss17-Sep-01 9:05 
AnswerRe: Problem: VC client and COM+ Server Component, but VB client works just fine. Why? Pin
Carlos Antollini17-Sep-01 9:25
Carlos Antollini17-Sep-01 9:25 
GeneralRe: Problem: VC client and COM+ Server Component, but VB client works just fine. Why? Pin
17-Sep-01 9:39
suss17-Sep-01 9:39 
GeneralRPC Server Unavailable (Repost) Please help! Pin
Bill Wilson17-Sep-01 7:23
Bill Wilson17-Sep-01 7:23 
GeneralRPC Server Unavailable (Repost) Please help! Pin
Bill Wilson17-Sep-01 7:21
Bill Wilson17-Sep-01 7:21 
The code below, takes a parameterized object name, looks for a specific interface and trys to call its methods.

It finds the interface with no difficulty but gets the error 0x8007806ba
(The RPC server is unavailable. ).

The same calls work from a VB test script. I'm running this on a Windows 2k server with SP 2. I've checked all the security parameters (DCOMCNFG) all are set to default, the same as for the other objects that work fine...

This code used to work, I've modified the object, transfered it to a new program and now it fails. I did change the name of the interface (I seperated the methods out from another interface). So I tried the old object, everything works fine. (difference shown as commente line (//OLD.)

It would appear there is something wrong with my new object. I would think the problem must be in the new object, except that I wrote a VB test app, and it works fine. This makes me think the problem is NOT in the object.

Please Help!!

I'd include the code for the object, but its large, and I'm not sure which parts would be useful...

Thanks, Bill

*******************************************************************************************
This VB code works fine

Dim apminfo As New APMOBJECTLib.MessageInfo

Private Sub Command1_Click()

Dim t As String
t = apminfo.GetFunction("sfddsfsdlfksdflk")

End Sub


*****************************************************************************************

This code locates and connects to the interface (MessageInfo). Every thing here succeeds...

CErrorInfo CServiceMessage::UnpackMessage(VARIANT vBody)

{
CErrorInfo err;
CoInitialize(NULL);
VARIANT vResult;
_bstr_t bstrValue;


m_strBody = GetMessageAsString(vBody);
try
{

// Get Function handler object


CLSID ID;
m_pBroker=NULL;
//OLD CString strObjName = "APMObj.CFunction"; // This works fine when activated
CString strObjName = "APMObject.MessageInfo"; // New object.

// The following line of code succeeds
HRESULT hr = CLSIDFromProgID( strObjName.AllocSysString(), &ID);
if (hr != S_OK)
{
LPTSTR lpMsgBuf;
CString strError;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, hr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL ) == 0 ) // Couldn't find error code
{
lpMsgBuf = "Unknown Error";
}

strError.Format("%s: %s %s Error %d: %s.","CConfigServices::Load()",
"Attempting to find object ", m_pParent->m_strObjectName,
hr, lpMsgBuf);
err.SetError(ERR_SEVERITY_MAJOR, CONFIGERROR + CString(strError));
LocalFree(lpMsgBuf);
return err;

}

hr = CoCreateInstance(ID, NULL, CLSCTX_LOCAL_SERVER,
IID_IDispatch, (void **)&(m_pBroker));

if (hr != S_OK)
{
// error handling
}

vResult = GetValue(vBody,CString("GetPriority"),VT_I4);


*******************************************************************************

This code fails

VARIANT CServiceMessage::GetValue(VARIANT vBody, CString strField, int iType)
{

DISPID dispID;
HRESULT hr;
CErrorInfo err;
LPOLESTR olestr;
VARIANT vResult;

try
{
// Unpack function name
olestr = strField.AllocSysString();
TRACEX("Get ID of " + strField);
// the following line of code fails if the new object and interface is used. It works if
// the old object name and interface is used.

hr = m_pBroker->GetIDsOfNames(IID_NULL, &olestr, 1, LOCALE_USER_DEFAULT,
&dispID);
if (hr != S_OK)


// hr is = 0x800706ba (RPC Server Not Found)Rose | [Rose] Rose | [Rose]

Thanks for the help,
Bill
GeneralRe: RPC Server Unavailable (Repost) Please help! Pin
Bill Wilson17-Sep-01 7:25
Bill Wilson17-Sep-01 7:25 
GeneralRPC Server Unavailable from C++ client Pin
Bill Wilson14-Sep-01 14:11
Bill Wilson14-Sep-01 14:11 
GeneralRe: RPC Server Unavailable from C++ client Pin
Bill Wilson17-Sep-01 7:16
Bill Wilson17-Sep-01 7:16 
GeneralCOM SPY TOOL Pin
13-Sep-01 5:08
suss13-Sep-01 5:08 
GeneralAccelerators in WTL dialog Pin
Remon Spekreijse13-Sep-01 0:10
Remon Spekreijse13-Sep-01 0:10 
GeneralRe: Accelerators in WTL dialog Pin
Not Active17-Sep-01 7:48
mentorNot Active17-Sep-01 7:48 
GeneralRe: Accelerators in WTL dialog Pin
Remon Spekreijse17-Sep-01 21:13
Remon Spekreijse17-Sep-01 21:13 
GeneralCOM out of process server Pin
12-Sep-01 11:54
suss12-Sep-01 11:54 
GeneralRe: COM out of process server Pin
Ganesh Ramaswamy12-Sep-01 13:16
Ganesh Ramaswamy12-Sep-01 13:16 
GeneralRe: COM out of process server Pin
12-Sep-01 16:24
suss12-Sep-01 16:24 
GeneralIShellLink Pin
mrlister11-Sep-01 6:28
mrlister11-Sep-01 6:28 
Generalop= and copy ctor with COM pointers Pin
10-Sep-01 12:45
suss10-Sep-01 12:45 
GeneralRe: op= and copy ctor with COM pointers Pin
Michael Dunn10-Sep-01 15:22
sitebuilderMichael Dunn10-Sep-01 15:22 
GeneralRe: op= and copy ctor with COM pointers Pin
11-Sep-01 3:23
suss11-Sep-01 3:23 
Generalaccessing DLLs through a single client Pin
parag10-Sep-01 1:27
parag10-Sep-01 1:27 
GeneralRe: accessing DLLs through a single client Pin
Jafer Ali10-Sep-01 18:46
Jafer Ali10-Sep-01 18:46 
QuestionPassing Structures to Active X DLL? Pin
9-Sep-01 19:23
suss9-Sep-01 19:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.