473,473 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problems using RPC

Hi,

I am running into problems when performing an RPC call on a COM object
via Type.InvokeMember (.Net 2.0 Framework). The exception thrown is
"HRESULT: 0x800706BE", which, after some googling, leads me to this MS
Support Page:
http://support.microsoft.com/?scid=k...29080&x=6&y=12

Problem is, this page refers to WIN XP, whereas both my development and
production machines are W2k3 Servers (SP2, latest patch level). On the
development machine the program works perfectly fine. On the production
machine I get the error above.

My program is a Windows service, which fetches data from a COM
application (here the RPC call fails) and writes it to a SQL database.

Does anyone experienced the same and/or has a good suggestion to solve this?

Thanks,
Tobi
Jan 10 '08 #1
11 2145
Tobias,

How are you getting the Type instance to make the remote call?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Hi,

I am running into problems when performing an RPC call on a COM object via
Type.InvokeMember (.Net 2.0 Framework). The exception thrown is "HRESULT:
0x800706BE", which, after some googling, leads me to this MS Support Page:
http://support.microsoft.com/?scid=k...29080&x=6&y=12

Problem is, this page refers to WIN XP, whereas both my development and
production machines are W2k3 Servers (SP2, latest patch level). On the
development machine the program works perfectly fine. On the production
machine I get the error above.

My program is a Windows service, which fetches data from a COM application
(here the RPC call fails) and writes it to a SQL database.

Does anyone experienced the same and/or has a good suggestion to solve
this?

Thanks,
Tobi

Jan 10 '08 #2
Sorry,

I should have added some code. Here it comes:

<code>

// get application type
Type appType = Type.GetTypeFromProgID("Prog.Id");
// app instance
object app = Activator.CreateInstance(appType);

// app database object
object appDb = amAppType.InvokeMember(
"Database",
BindingFlags.InvokeMethod,
null,
app,
null);

// app databasee type
Type dbType = amDb.GetType();

// set database name
dbType.InvokeMember(
"Name",
BindingFlags.PutDispProperty,
null,
appDb,
new object[] { "DatabaseName" });

// list of found objects
this._objectList = new List<MyObject>();

// constrain search
string whereClause = "myValue 0";

// search first record
int retVal = (Int32)dbType.InvokeMember(
"FindFirst",
BindingFlags.InvokeMethod,
null,
appDb,
new object[] { whereClause });

// loop, while records found
while (retVal == 1) {
// create object
MyObject obj = new MyObject();
// get data
obj.MyProperty = (string)dbType.InvokeMember(
"GetContentsByName",
BindingFlags.InvokeMethod,
null,
amDb,
new object[] { "MyPropertyFieldName" });
// add to list
this._objectList.Add(obj);

// get next
retVal = (Int32)dbType.InvokeMember(
"FindNext",
BindingFlags.InvokeMethod,
null,
appDb,
null);
}

</code>

Nicholas Paldino [.NET/C# MVP] schrieb:
Tobias,

How are you getting the Type instance to make the remote call?

Jan 10 '08 #3
Tobias,

How is this set up to be called on a remote machine? Do you have a
proxy installed on the local machine in COM+ which has a program id of
"Prog.Id"? If not, then you should be calling the overload of
GetTypeFromProgID which takes the name of the machine which you want to make
the remote call to.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Sorry,

I should have added some code. Here it comes:

<code>

// get application type
Type appType = Type.GetTypeFromProgID("Prog.Id");
// app instance
object app = Activator.CreateInstance(appType);

// app database object
object appDb = amAppType.InvokeMember(
"Database",
BindingFlags.InvokeMethod,
null,
app,
null);

// app databasee type
Type dbType = amDb.GetType();

// set database name
dbType.InvokeMember(
"Name",
BindingFlags.PutDispProperty,
null,
appDb,
new object[] { "DatabaseName" });

// list of found objects
this._objectList = new List<MyObject>();

// constrain search
string whereClause = "myValue 0";

// search first record
int retVal = (Int32)dbType.InvokeMember(
"FindFirst",
BindingFlags.InvokeMethod,
null,
appDb,
new object[] { whereClause });

// loop, while records found
while (retVal == 1) {
// create object
MyObject obj = new MyObject();
// get data
obj.MyProperty = (string)dbType.InvokeMember(
"GetContentsByName",
BindingFlags.InvokeMethod,
null,
amDb,
new object[] { "MyPropertyFieldName" });
// add to list
this._objectList.Add(obj);

// get next
retVal = (Int32)dbType.InvokeMember(
"FindNext",
BindingFlags.InvokeMethod,
null,
appDb,
null);
}

</code>

Nicholas Paldino [.NET/C# MVP] schrieb:
>Tobias,

How are you getting the Type instance to make the remote call?
Jan 10 '08 #4
Hi,

I think I mixed up the terms a little. RPC was mentioned in the MS
article I've in in the original post. I was confused about that myself.

The application I want to call via _COM automation_ is installed on the
same server as my service. No remote machines involved.

Tobi

Nicholas Paldino [.NET/C# MVP] schrieb:
Tobias,

How is this set up to be called on a remote machine? Do you have a
proxy installed on the local machine in COM+ which has a program id of
"Prog.Id"? If not, then you should be calling the overload of
GetTypeFromProgID which takes the name of the machine which you want to make
the remote call to.

Jan 10 '08 #5
"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Sorry,

I should have added some code. Here it comes:

<code>

// get application type
Type appType = Type.GetTypeFromProgID("Prog.Id");
// app instance
object app = Activator.CreateInstance(appType);

// app database object
object appDb = amAppType.InvokeMember(
"Database",
BindingFlags.InvokeMethod,
null,
app,
null);

// app databasee type
Type dbType = amDb.GetType();

// set database name
dbType.InvokeMember(
"Name",
BindingFlags.PutDispProperty,
null,
appDb,
new object[] { "DatabaseName" });

// list of found objects
this._objectList = new List<MyObject>();

// constrain search
string whereClause = "myValue 0";

// search first record
int retVal = (Int32)dbType.InvokeMember(
"FindFirst",
BindingFlags.InvokeMethod,
null,
appDb,
new object[] { whereClause });

// loop, while records found
while (retVal == 1) {
// create object
MyObject obj = new MyObject();
// get data
obj.MyProperty = (string)dbType.InvokeMember(
"GetContentsByName",
BindingFlags.InvokeMethod,
null,
amDb,
new object[] { "MyPropertyFieldName" });
// add to list
this._objectList.Add(obj);

// get next
retVal = (Int32)dbType.InvokeMember(
"FindNext",
BindingFlags.InvokeMethod,
null,
appDb,
null);
}

</code>

Nicholas Paldino [.NET/C# MVP] schrieb:
>Tobias,

How are you getting the Type instance to make the remote call?


Where exactly is the exception thrown?

Willy.

Jan 10 '08 #6
Tobias,

Ok, so if it is on the local machine, and you aren't running it out of
process (through COM+), then which call to InvokeMember is giving you the
problem?

Also, is the method only able to be called through a late bound call?
Any way you can get an interface definition in there which is early bound?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Hi,

I think I mixed up the terms a little. RPC was mentioned in the MS article
I've in in the original post. I was confused about that myself.

The application I want to call via _COM automation_ is installed on the
same server as my service. No remote machines involved.

Tobi

Nicholas Paldino [.NET/C# MVP] schrieb:
>Tobias,

How is this set up to be called on a remote machine? Do you have a
proxy installed on the local machine in COM+ which has a program id of
"Prog.Id"? If not, then you should be calling the overload of
GetTypeFromProgID which takes the name of the machine which you want to
make the remote call to.
Jan 10 '08 #7
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...
Tobias,

Ok, so if it is on the local machine, and you aren't running it out of
process (through COM+), then which call to InvokeMember is giving you the
problem?

Also, is the method only able to be called through a late bound call?
Any way you can get an interface definition in there which is early bound?
The OP said the DCOM server was an "automation server", the HRESULT code
indicates he has a security issue.

Willy.

Jan 10 '08 #8
"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Hi,

I think I mixed up the terms a little. RPC was mentioned in the MS article
I've in in the original post. I was confused about that myself.

The application I want to call via _COM automation_ is installed on the
same server as my service. No remote machines involved.

Tobi

What's the account the service is running in, and what kind of "automation
server" is this, a windows (UI) or a non windows application.

Willy.

Jan 10 '08 #9
Hi,

Willy Denoyette [MVP] schrieb:
What's the account the service is running in, and what kind of
"automation server" is this, a windows (UI) or a non windows application.
The account is the local administrator (not good, I know. I change this
as soon as i get the service running). So access rights should not be
the problem here.
The application I call is a WinApp but opens no UI. As said, on my
development machine the service runs. But you gave me a point to think
about. If configured wrong (e.g. the DB name) the applications opens an
error popup, which will not be allowed in a service. I'll have a look at
this, thanks.

Tobi
Jan 11 '08 #10
"Tobias Schröer" <to*******************@gmx.dewrote in message
news:fm**********@news01.versatel.de...
Hi,

Willy Denoyette [MVP] schrieb:
>What's the account the service is running in, and what kind of
"automation server" is this, a windows (UI) or a non windows application.

The account is the local administrator (not good, I know. I change this as
soon as i get the service running). So access rights should not be the
problem here.
The application I call is a WinApp but opens no UI. As said, on my
development machine the service runs. But you gave me a point to think
about. If configured wrong (e.g. the DB name) the applications opens an
error popup, which will not be allowed in a service. I'll have a look at
this, thanks.

Tobi

But this is an out-proc automation server, the error pop-up can only be an
issue after you have connected to the server and called a method, however
you don't get that far yet.
The issue you have, is at the launch or access level, so you should watch
the DCOM security settings on your system, DCOMCNFG is your friend for now,
you should also look at the security log.

Willy.

Jan 11 '08 #11
Hi,

thanks for your help so far. During the weekend I installed a
missing/new (?) .Net Patch (came through Windows update) and: I works.
Don't know why, but it does :)

Thanks anyway,
Tobi
Jan 14 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jerome Lefebvre | last post by:
Hello, Hope this will interest a few. I been working with a friend on the problems given out during the "International Collegiate Programming Contest" (ICPC) http://icpc.baylor.edu/icpc/ ....
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
26
by: jamesbeswick | last post by:
I've been using Access since version 97 and I've migrated to 2003. I've noticed a substantial number of strange ActiveX/OLE and code corruption problems when writing databases. The only solution...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
0
by: Peter R. Vermilye | last post by:
I am involved on a web application that is using a third party set of APIs for remote database access (middleware). I've been brought in because of my background in programming, thus I'm new to...
3
by: Andreas | last post by:
Hi! I'm currently developing a DLL that makes use of C++ and .net (mixed) using Visual Studio 2003. Now, as I wanted to move to the new Visual Studio 2005, I converted this project into the...
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
9
by: =?Utf-8?B?SG93YXJkIFNtaXRo?= | last post by:
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2 installed. I am developing an instrumentation system comprising a set of networked PCs connected using TCP/IP TCP links....
8
by: reema via AccessMonster.com | last post by:
Did any one faces any difficulties ,issuess or problems using Microsoft Access -- Message posted via http://www.accessmonster.com
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.