Results 1 to 6 of 6

Thread: CreateInstance/New

  1. #1
    Simon Pallister Guest

    Default CreateInstance/New

    I have read/heard conflicting information as to whether to use the New keyword or CreateInstance to create COM+ components. Having come from a COM/MTS background, the latter seems more likely but can anyone clear this up?

  2. #2
    Christiaan Guest

    Default RE: CreateInstance/New

    When using COM+, always use CreateInstance to create MTS-objects and CreateObject (without server.) to create a non MTS-object.<BR><BR>Although NEW is faster than CreateObject in Win98/NT4, it is slower in Win2K (and COM+).<BR><BR>If you use NEW, the MTS will not set up the context correctly and create a new context instead. This&#039ll give lots of problems if you&#039re using transactions.<BR><BR>In short:<BR>CreateInstance to create MTS-objects<BR>NEW to create Non MTS-objects in Win98/WinNT<BR>CreateObject to create Non MTS-objects in Win2K

  3. #3
    Simon Pallister Guest

    Default RE: CreateInstance/New

    I think you may have that the wrong way round....use NEW ( or CreateObject) under Win2k and CreateInstance under (NT/Win9x). ie, the difference between COM/MTS and COM+, hence the original question.<BR><BR>I recently found this:<BR><BR><BR>(under "Create Your Objects with the Correct Operator")<BR><BR>

  4. #4
    Christiaan Guest

    Default RE: CreateInstance/New

    Strange....because i have this MIND-article (also by MS) that says it exactly the other way around again :)<BR><BR>I don&#039t have the link, but the article is available in their archives. Seems that MS doesn&#039t understand its own methods.

  5. #5
    Join Date
    Dec 1969

    Default RE: CreateInstance/New

    in Professional ASP 3.0 it says that since COM+ has integrated the MTS and COM programming models, the CreateInstance method is no longer required and subobjects can be created with the CreateObject function in VB. I&#039ve tried it that way and it seems to work fine, and I understand the confusion. :)

  6. #6
    Rafeeq Guest

    Default RE: CreateInstance/New

    Well, this is the most trickiest issue for any Com/MTS developer! Well, from my experience I gather that the best way to go about is to use CreateInsatance for MTS object and using NEW keyword for Non MTS objects. U can use CreateObject too but if Performance is the issue u are concerned with, I would Vouch that NEW is faster.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts