473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

refresh com control

cj2
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\system32 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?
Sep 4 '08 #1
2 1311
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:
http://support.microsoft.com/kb/161137

<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.
http://www.microsoft.com/technet/sys...sexplorer.html
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 (ji****@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:
ms****@microsoft.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.

Sep 5 '08 #2
cj2
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:
http://support.microsoft.com/kb/161137

<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.
http://www.microsoft.com/technet/sys...sexplorer.html
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 (ji****@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:
ms****@microsoft.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.
Sep 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Arnold | last post by:
Hey there, I've browsed for some fixes to this but only found a couple of similar posts, which didn't solve my problem. I'm wondering how to refresh an image control in a form after a user...
4
by: Yogi_Bear_79 | last post by:
Self Taught here so please bear with me. I have the labelRestrictSites as private on the MainForm.cs. I then access the labelRestrictSites.Text thru the public string LabelRestrictSites from...
2
by: Peter Oliphant | last post by:
I now have graphics being drawn in the Paint event of my form (yeah, and it's very cool). Problem was that it only updated any changes to these graphics when Paint was called. So, I then made it...
1
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
0
by: Allan Bredahl | last post by:
Hi all Im currently constructing a Windows control that inherits from RichTextBox, but I'm having a bit of trouble with updating the control at design time. The senario is SIMPLIFIED as...
1
by: KatMagic | last post by:
Is there a way to automatically refresh a user control? I have a page where I automatically refresh the page with <meta http-equiv="refresh" content="600"> The page loads a user control based on...
0
by: cweeks | last post by:
>From the MSDN documentation for WebBroswer.Refresh(): "The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration...
3
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a property based on CollectionBase class. like the following one : //------- XGrid.cs file --------------// public ColumnsCollection Columns {
4
by: Simon | last post by:
Dear reader, If I change the content of a field in an event procedure and in the same procedure I do a refresh, the refresh has no effect. The code in the event is as follows:
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.