Hi there ...

Has anyone been able to speak directly to the MSDTC from VB.Net or C# - I
need to do this to try and eliminate using COM+ for components that need
transactionality. There is C++ code that can do it, but am having hassles
trying to convert the following code :

 ITransactionDispenser *pTransactionDispenser;
 ITransaction   *pTransaction;
 HRESULT     hr = S_OK ;
 BOOL     tf = 0 ;
 TCHAR     SqlStatement[STR_LEN*2];


 // Initialize globals & validate command line arguments
 InitGlobals(argc,argv);


 // Obtain the ITransactionDispenser Interface pointer
 // by calling DtcGetTransactionManager()
 hr = DtcGetTransactionManager(
    NULL,
   // LPTSTR  pszHost,
    NULL,
   // LPTSTR  pszTmName,
    IID_ITransactionDispenser,
 // /* in  */ REFIID rid,
    0,
    // /* in  */ DWORD dwReserved1,
    0,
    // /* in  */ WORD wcbReserved2,
    NULL,
   // /* in  */ void FAR * pvReserved2,
    (void **)&pTransactionDispenser
 // /* out */ void** ppvObject
    );

into something callable from .Net

The obvious solution is to use a DllImport to call through to the API, but
I don't know how to declare all the parameters in a way that they can be
used from my code.

If anyone has looked at this some help will be *MUCH* appreciated !  :-)

Thanks

Bryan Symons

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to