MTS and debugging

I have problems with trying to debug an ActiveX DLL, which is supposed to run under MTS.
Function ObjectControl_Activate() is never called, so my object can't obtain ObjectContext, and later I can't create ather object using oContext.CreateInstance()...
Is it possible obtain ObjectContext in debugging mode and how?
Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
In your component, you have log your activity to either the NT Log, or an Flat file (which is fastest) or eventually to a Database (which can be queried later). What exactly to log depends on what you are trying to debug: usually, i have one component that indicates what is being debugged, and there all the components query this information. If debugging mode is activated for a module/component/function, then the component will write the logging information, otherwise not. This is the general auditing method, but it will cost time to activate this functionality.
To log in NT Log, you normally have the App.Log method (use StartLog and EndLog to enable the logging)
The file logging can easily be done in a small sub which writes a string to a file (i usually name the file using the date of the day, to avoid getting huge files and being able to manage these files better)
The database Log has the unconvenient, that you need a database connection (and thus the connect information) plus it makes much more overhead, but it presents the great advantage to be queryable afterwards.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Try to code simply CreateInstance instead if oContext.CreateInstance, this should work during debugging (CreateInstance is replaced by CreateObject) and during runtime inside of MTS the adequate Context object is used
ekcAuthor Commented:
I know that, but would like to know if it is possible to debug in MTS enviroment, with ObjectContext and all...
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

can u try to add this key in u'r registry --
in MyComputer\LocalMachine\Software\Microsoft\TransactionServer\

So u'r registry will look like


hope this solves u'r problem!!!!!!!!!

Guy Hengel [angelIII / a3]Billing EngineerCommented:
It is not possible to debug in MTS environment + VB, if you want to debug, the only thing u can do is:
Write to a Log (NT/FILE/DB). This is annoying, but the onyl way I know.
ekcAuthor Commented:
Unfortunately, I've tried that registry update some time ago, but it didn't help.
ekcAuthor Commented:
could you explain me your solution, a little bit more detailed.
Thank you...
ekcAuthor Commented:
Comment accepted as answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.