refresh com control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cj2

    refresh com control

    I had to add a reference to a com control / dll into my VB.net 2008
    program. It didn't work as it should and I was given another version of
    the dll to replace it with. The dll had the same name. I copied the new
    dll to c:\windows\syst em32 directory on my XP machine overwriting the
    copy that was there. I then ran REGSVR32 on it and it reported it
    registed it. Problem is it didn't change how it works. I think now
    that VB needs to refresh where I added the reference to it into the
    project. How do I do this?
  • Jialiang Ge [MSFT]

    #2
    RE: refresh com control

    Hello CJ,

    There are several points that you would need to pay special attention to
    when refreshing the com control:

    1. COM component itself.

    You would need to make sure that the new component was compiled with
    "Binary Compatibility". In other words, the class and interface IDs are not
    changed during the upgrade of the component. See:


    <quote>
    Binary Compatibility
    When you compile your project, Visual Basic only creates new Class and
    Interface IDs when necessary. It preserves the class and interface IDs from
    the previous version(s) so that programs compiled using an earlier version
    will continue to work. If you are making a change that will result in an
    incompatible version, Visual Basic will warn you. If you want to maintain
    compatibility with older, released versions of an ActiveX component, this
    is the setting you need to use.
    </quote>

    "Binary Compatibility" is not the default setting in VB6, so please make
    sure it's checked.

    2. .NET client app that consumes the component.

    According to your description "add a reference to the com component", it
    seems that you are using the RCW (Runtime Callable Wrapper) assembly
    generated by VS (early binding). Generally speaking, this would continue
    working after we install the new component as long as the new is binary
    compatible. I suggest your trying these two methods to diagnose this
    problem:

    a. Use process explorer to view the loaded dlls by your client app.

    process explorer displays the dll version in the "Lower Panel View". Check
    whether the dll version matches your new one.

    b. Re-generate the RCW by
    Step1. removing the original reference of the component from your VB.net
    project. (Project -Properties -References -find the interop assembly
    and remove it)
    Step2. Add the reference again (Project -Add Reference -Browse -find
    the new dll and add it)
    Step3. Re-compile the project.

    Regards,
    Jialiang Ge (jialge@online. microsoft.com, remove 'online.')
    Microsoft Online Community Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/en-us/subs...#notifications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://support.microsoft.com/select/...tance&ln=en-us.
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • cj2

      #3
      Re: refresh com control

      I hate to say it but I didn't understand much at all of what you said.

      Anyway, I deleted it and re-added it and it works. I finally found
      where I could do this. I right clicked on the Project in the Solution
      Explorer and clicked properties. On the References tab I clicked the
      dll and then clicked remove. I then clicked add and put it back in. I
      usually add under the class view of the project but I couldn't delete it
      there.

      Why does it say the dll path it's referring to is in the project
      directory? It isn't where I put the dll and registered it. VB appears
      to have made a copy of it in the project directory.


      Jialiang Ge [MSFT] wrote:
      Hello CJ,
      >
      There are several points that you would need to pay special attention to
      when refreshing the com control:
      >
      1. COM component itself.
      >
      You would need to make sure that the new component was compiled with
      "Binary Compatibility". In other words, the class and interface IDs are not
      changed during the upgrade of the component. See:

      >
      <quote>
      Binary Compatibility
      When you compile your project, Visual Basic only creates new Class and
      Interface IDs when necessary. It preserves the class and interface IDs from
      the previous version(s) so that programs compiled using an earlier version
      will continue to work. If you are making a change that will result in an
      incompatible version, Visual Basic will warn you. If you want to maintain
      compatibility with older, released versions of an ActiveX component, this
      is the setting you need to use.
      </quote>
      >
      "Binary Compatibility" is not the default setting in VB6, so please make
      sure it's checked.
      >
      2. .NET client app that consumes the component.
      >
      According to your description "add a reference to the com component", it
      seems that you are using the RCW (Runtime Callable Wrapper) assembly
      generated by VS (early binding). Generally speaking, this would continue
      working after we install the new component as long as the new is binary
      compatible. I suggest your trying these two methods to diagnose this
      problem:
      >
      a. Use process explorer to view the loaded dlls by your client app.

      process explorer displays the dll version in the "Lower Panel View". Check
      whether the dll version matches your new one.
      >
      b. Re-generate the RCW by
      Step1. removing the original reference of the component from your VB.net
      project. (Project -Properties -References -find the interop assembly
      and remove it)
      Step2. Add the reference again (Project -Add Reference -Browse -find
      the new dll and add it)
      Step3. Re-compile the project.
      >
      Regards,
      Jialiang Ge (jialge@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support
      >
      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.
      >
      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      http://msdn.microsoft.com/en-us/subs...#notifications.
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://support.microsoft.com/select/...tance&ln=en-us.
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no rights.
      >

      Comment

      Working...