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'.
--------------


Can I safely ignore this?
Is there a primary interop assembly for COMSVCS.DLL?

--
Thanks in advance,

Juan Dent, M.Sc.

RE: Warning messages in Tlbimp by v-phuang

v-phuang
Fri Jul 22 23:33:57 CDT 2005

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.


RE: Warning messages in Tlbimp by Juan_Dent

Juan_Dent
Sat Jul 23 18:08:01 CDT 2005

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?

--
Thanks in advance,

Juan Dent, M.Sc.


""Peter Huang" [MSFT]" wrote:

> 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.
>
>

RE: Warning messages in Tlbimp by Juan_Dent

Juan_Dent
Sat Jul 23 19:37:02 CDT 2005

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?


--
Thanks in advance,

Juan Dent, M.Sc.


""Peter Huang" [MSFT]" wrote:

> 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.
>
>

RE: Warning messages in Tlbimp by v-phuang

v-phuang
Tue Jul 26 01:34:21 CDT 2005

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.


RE: Warning messages in Tlbimp by Juan_Dent

Juan_Dent
Tue Jul 26 11:40:04 CDT 2005

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?


--
Thanks in advance,

Juan Dent, M.Sc.


""Peter Huang" [MSFT]" wrote:

> 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.
>
>

RE: Warning messages in Tlbimp by v-phuang

v-phuang
Wed Jul 27 02:28:00 CDT 2005

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.