I'm developing MTS-components from visual C++. As long as I'm debugging my
components from a client outside the MTS as normal CLSCTX_INPROC_SERVER
DLL's there's no problem. But when I place the components in the MTS and
wants to debug them from a client, so I can debug the specific MTS
functuality i.e SafeRef(), GetObjectContext etc, I always steps into the
asssambler-code when i steps into the component from the breakpoint in the
client-code. How can I debug SafeRef(), GetObjectContext etc??
Is it possible at all to debug components if they run in the MTS??
Please help me.
Sincerly
Henrik Knutsson
Debugging Visual C++ MTS Components
You can use Visual StudioÔ 97 to debug MTS components written in Visual
C++Ò, including components that call SQL Server functions or stored
procedures. For more information, see Debugging Visual Basic MTS Components.
The following information applies to components that have their activation
property set to In a dedicated server process.
Microsoft Transaction Server supports the COM transparent remote debugging
infrastructure. If transparent remote debugging is enabled, then stepping
into a client process will automatically stop at the actual object's code in
the server process, even if the server is on a different computer on the
network. A debugging session is automatically started on the server process
if necessary. Similarly, single stepping past the return address of code in
a server object will automatically stop just past the corresponding call
site in the client's process.
In Microsoft Visual C++, selecting the OLE RPC debugging check box (on the
Tools menu, select the Options submenu and choose the Debug property sheet)
enables transparent remote debugging. It is not known at this time whether
other debuggers support this infrastructure.
You can also debug your Microsoft Transaction Server component DLL in Visual
C++ by performing the following steps. Each of these steps is made either
inside the MTS Explorer or inside of a Visual C++ session with your MTS DLL
project.
Shutdown server processes using the MTS Explorer. To do this, right-click My
Computer, and select Shutdown Server Process.
In your Visual C++ session, under Project, Settings, Debug, General, set the
program arguments to the following string: "/p: PackageName", for example:
/p: "Sample Bank"
In the same property sheet, set the executable to the full path of the
Mtx.exe process, for example: "c:\MTx\MTx.exe".
Set breakpoints in your component DLL, and you are ready to debug.
Run the server process (in the Build menu, select Start Debug and click Go.)
The following information applies to in-process component DLLs that have
their activation property set to In the creator's process.
You can debug your in-process MTS component DLL in Visual C++ by performing
the following steps. Each of these steps is made inside a Visual C++ session
with your base process project.
Set the component DLL under Build, Settings, Debug, Additional DLLs.
Now you are ready to step into or set breakpoints in your component DLL at
will.
If you are using Visual Studio and Microsoft Foundation Classes (MFC) to
debug, the TRACE macro can facilitate your debugging. The TRACE macro is an
output debug function that traces debugging output to evaluate argument
validity. The TRACE macro expressions specify a variable number of arguments
that are used in exactly the same way that a variable number of arguments
are used in the run-time function printf. The TRACE macro provides similar
functionality to the printf function by sending a formatted string to a dump
device such as a file or debug monitor. Like printf for C programs under
MS-DOS, the TRACE macro is a convenient way to track the value of variables
as your program executes. In the Debug environment, the TRACE macro output
goes to afxDump. In the Release environment, the TRACE macro output does
nothing.
Example:
// example for TRACE
int i = 1;
char sz[] = "one";
TRACE( "Integer = %d, String = %s\n", i, sz );
// Output: 'Integer = 1, String = one'
The TRACE macro is available only in the debug version of MFC, but a similar
function could be written for use without MFC. For more information on using
the TRACE macro, see the "MFC Debugging Support" section in Microsoft Visual
C++ Programmer's Guide.
Note that you should avoid using standard ASSERT code in Visual C++.
Instead, it is recommended that you write assert macros like a MessageBox
using the MB_SERVICE_NOTIFICATION flag, and TRACE macro statements using the
OutputDebugString function call.
----------------------------------------------------------------------------
----
© 1997 Microsoft Corporation. All rights reserved.
Henrik Knutsson wrote in message <6pk663$7...@newstoo.ericsson.se>...
Greetings from Italy
Massimo
> Here is text from the Windows NT 4.0 Option Pack on MTS Debugging
>
..
..
> In your Visual C++ session, under Project, Settings, Debug, General, set
the
> program arguments to the following string: "/p: PackageName", for
example:
> /p: "Sample Bank"
I have found that I have to use "/p:{... insert the CLSID here..}" instead
of the "/p: PackageName". I then set a break point and execute. This seems
to work fine.
Jag
Is it really possible to debug the MTS-specific code i.e SafeRef,
GetObjectContext etc. How do I do that? Everytime I do as in the text from
the Windows NT 4.0 Option Pack on MTS Debugging (the 6-item description) I
always get an error: C:\WINNT\system32\mtx.exe does not contain any debug
information". Which 'server process' is to be run? The client or the mtx.exe
or what? When I debug the client and wants to step into the server code I
always steps into assambler code, whats wrong? Is there any addintional
settings that has to be done? Thankful for all help I can get.
Sincerely
Henrik
Jag wrote in message <01bdbad9$0ff90710$0a0e0196@solvox>...
www.draganst.demon.co.uk/mtsdebug.htm
In article <6pn4ko$6...@newstoo.ericsson.se>,
"Henrik Knutsson" <henrik....@egs.ericsson.se> wrote:
> Hi,
>
> Is it really possible to debug the MTS-specific code i.e SafeRef,
> GetObjectContext etc. How do I do that? Everytime I do as in the text from
> the Windows NT 4.0 Option Pack on MTS Debugging (the 6-item description) I
> always get an error: C:\WINNT\system32\mtx.exe does not contain any debug
> information". Which 'server process' is to be run? The client or the mtx.exe
> or what? When I debug the client and wants to step into the server code I
> always steps into assambler code, whats wrong? Is there any addintional
> settings that has to be done? Thankful for all help I can get.
>
> Sincerely
> Henrik
>
--
----------------------
Simon Tocker
A.G. Solutions
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
I found that when debugging my MTS-components, I have to go to Windows NT
Task Manager and end all (usually one or two) mtx.exe processes that's
currently running.
I think that is what's supposed to be done when in MMC/MTS selecting shut
down server processes.
Another thing that fooled me was that the in VS97 the Program arguments
string in debug/settings, should'nt contain any spaces:
example: /P:MyPackage (Or {GUID})
However, maybe because I'm for the most part is a VB-programmer I have some
difficulties to look at my complex variables debugging in VS97. Variants,
Recordsets and stuff like that. Is there a smart path to go here?
Can't wait to try VB6 out on this!
/C-J
Simon...@draganst.demon.co.uk wrote in message
<6pphiq$d2e$1...@nnrp1.dejanews.com>...
You can download it from:
http://ourworld.compuserve.com/homepages/schenck/DBWinV2.htm
Grant Schenck
Grant Schenck Software
sch...@compuserve.com
http://ourworld.compuserve.com/homepages/schenck
In article <#RPRRYiu...@uppssnewspub05.moswest.msn.net>,
> In your Visual C++ session, under Project, Settings, Debug, General, set the
> program arguments to the following string: "/p: PackageName", for example:
> /p: "Sample Bank"
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
If any of you are interested or have a wish list
please email me and ill give it some more time
before I post it
Eduardo A Jezierski, MCSD
VB6 with NT SP4 will let you use the VB debugger, your component will
execute within MTS while you are in the VB IDE.
Bruce L-C
Eduardo A. Jezierski wrote in message
<#IKPesbw...@uppssnewspub05.moswest.msn.net>...