Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. CoCreateInstance

CoCreateInstance

Scheduled Pinned Locked Moved COM
performancehelpcomquestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chirag_Saglani
    wrote on last edited by
    #1

    I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani

    J V 2 Replies Last reply
    0
    • C Chirag_Saglani

      I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems. --

      C 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems. --

        C Offline
        C Offline
        Chirag_Saglani
        wrote on last edited by
        #3

        Thank you for the reply. I am using Windows XP ans still facing this problem. Can u also please tell me what exactly happens during CoCreateInstance (which DLL is loaded etc)that is taking more time in the first execution? Thanx

        1 Reply Last reply
        0
        • C Chirag_Saglani

          I am executing the following code in VC. ----------- HRESULT hr = CoInitialize( NULL ); hr = CoCreateInstance( CLSID_RegExp, NULL, CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp); CoUninitialize(); --------------- I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions. The main time taken in case of 1st run is by CoCreateInstance I am measuring the time taken using IBM's Rational(so I can trust their output). Can u help me figure out the problem? Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM? Please help. P.S. Performance improvement is my main focus Chirag Saglani

          V Offline
          V Offline
          vishalmore
          wrote on last edited by
          #4

          Hi Chirag, Check if the regular expression libraries are installed properly. There might be some collision between your "RegExp" library CLSID's... I am just guessing, you can have a look... OR Try to design some simple application in VB using "Regular Expression" library. This might tell you where exactly the problem is... I cant see other things that should take time... all the best ! Cheers, Vishal -- modified at 8:09 Tuesday 11th October, 2005

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups