Warning messages in Tlbimp

G

Guest

Hi,

The COM+ Services type library (comsvcs.dll) strangely enough does not come
with a primary interop. I need to use it in an assembly of mine that is
signed, and it would not let me add it as a reference because the interop
file that VS.NET 2003 produces is not strong named.

Therefore, I am forced to create the signed interop assembly myself.

I am using Tlbimp as follows:
tlbimp c:\windows\system32\comsvcs.dll /out:Interop.Comsvcs.dll /namespace:C
OMSVCSLib /keyfile:"C:\Program Files\Exactus\llave.snk"

This (and other simpler command lines) gives me a lot of warnings of the type:

-------------
TlbImp warning: At least one of the arguments for
'ISecurityProperty.ReleaseSID'
can not be marshaled by the runtime marshaler. Such arguments will
therefore b
e passed as a pointer and may require unsafe code to manipulate.
TlbImp warning: The type library importer could not convert the signature
for th
e member 'tagBLOB.pBlobData'.
 
P

Peter Huang [MSFT]

Hi

Microsoft does not ship a PIA for ComSvcs.DLL as the ComSvcs TypeLib has
been superseded by the System.EnterpriseServices namespace for managed code.

I think it's just warning you that the Interop marshaller doesn't know what
your are passing in the ptr. It could be a ptr to an array, a ptr to a
byte, or a ptr to anything else, so you get no compile-time type safety.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Okay. However, COMSVCS.dll had an object TransactionContextEx that is useful
for creating a generic object thay begins a transaction, allowing, I quote
MSDN:

"A non-transactional client uses this class to begin a transaction. Using
the methods of this class, the client can call additional COM objects that,
if configured to participate in a transaction, run within the transaction
boundary of the transaction context object. Based on its business logic, the
client can explicitly commit or abort the transaction."


I have three two questions about this:
1) in System.EnterpriseServices, how can we accomplish the same without the
unmanaged comsvcs.dll? Perhaps with System.EnterpriseServices.Activity?

2) What does the following remark in MSDN help for TransactionContextEx
imply? That it is better to use serviced components?

"Note The TransactionContextEx class limits reuse of the business logic
driving the transaction. For this reason, it is recommended that objects
instantiated from the TransactionContextEx class be used sparingly"

3) Which book do you recommend as the most up to date and comprehensive one
on the topic of EnterpriseServices?
 
G

Guest

Actually, I have been experimenting around. I can narrow my question to the
following:

In an article in MSDN Magazine (
<http://msdn.microsoft.com/msdnmag/issues/02/04/COMXP/default.aspx>) they
mention the Activity as a context that can survive many calls. This could
perhaps replace the TransactionContextEx object in supplying a unique context
in which to perform all database operations. Nevertheless how can I get a
transaction from an activity, so that I can later call commit or abort?
 
P

Peter Huang [MSFT]

Hi

I think in .NET we use the attribute to enable Transaction.
TransactionAttribute Members
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystementerpriseservicestransactionattributememberstopic.asp

We use the TransactionOption as below to control whether the component will
be in a transaction.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystementerpriseservicestransactionoptionclasstopic.asp

Disabled Ignores any transaction in the current context.
NotSupported Creates the component in a context with no governing
transaction.
Required Shares a transaction, if one exists, and creates a new
transaction, if necessary.
RequiresNew Creates the component with a new transaction, regardless of the
state of the current context.
Supported Shares a transaction, if one exists.

If you do want to manually control the transantion, you may try to take a
look at the ContextUtil Class which has the SetAbort and SetComplete
method and Transaction property.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystementerpriseservicescontextutilmemberstopic.asp

So far for book about .NET COM+, but you may try to take a look at the
books below.
Transactional COM+: Building Scalable Applications
by Tim Ewald
COM and .NET Component Services (O'Reilly Windows) by Juval L?wy

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thank you for your help Peter. Actually you have been helping me a lot in the
last weeks around COM+ issues. I appreciate this effort!

Seems my questions have now changed in nature (from the original "Warning
messages in Tlbimp" to the current "Using COM+ through EnterpriseServices",
why don't we open another "thread" with that topic and conclude this own
which has been well answered by you?
 
P

Peter Huang [MSFT]

Hi Juan,

Thanks for your quickly reply!
I have seen your new post and follow up there.
If you still have any concern, we can discuss in that thread.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top