Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / April 2006

Tip: Looking for answers? Try searching our database.

Interop, Property Let vs. Set....    Default .NET .tlb build behavior

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VB6 To .NET - 29 Mar 2006 16:20 GMT
******************************************************************************************************
Problem:  The problem we are having is in VB6 we defined many properties of
type Variant for the sole purpose of being able to store Null.  These
properties are typically used to store database fields.  So they will either
store say a number or null, or a string or null, or a decimal or null, etc.
Hence, the properties were setup as Lets, not Sets, in VB6.  When these
properties are upgraded to .NET they become Objects.  When .NET compiles
this project for COM interop and creates the TLB these properties become
Sets (PropPutRef in the IDL) because their datatype is Object.  We have not
found a way to tell .NET to make this a LET (PropPut) when building the TLB.

Because .NET makes these properties Sets our existing VB6 code breaks
because it doesn't have  Set <some property> = Whatever.  They simply say
<some property> = Whatever.  If we were to go through all our VB6 code and
put Sets on them it still breaks because we are not puting objects into
these properties, we put things like strings and integers in.  Sets don't
work with these types.

Our Solution:  The only work around to this perplexing issue is to manually
fix the IDL and build our the TLB ourselves.  We get the IDL, change the
PropPutRef to PropPut, fix all the other IDL syntax errors created by
OleView.exe and use MIDL.exe to build the TLB based on our new IDL file.  We
have some classes with 50 or more variant properties defined as Lets.  This
is going to be a very cumbersome task.
One final thing.  We are manually building our interfaces in .NET for all of
our classes we expose through COM.  A fix that involves a manual interface
would be of no concern.  Really, any fix would be better then what we're
currently doing.
******************************************************************************************************

Here is a link to the documentation defining this behavior.  How do I
override it!!!!   Manually building the .TLB seems ridiculous.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
coninteroperatingwithunmanagedcode.asp


Thanks...
VB6 To .NET - 29 Mar 2006 16:30 GMT
Actually, this is the link, scroll down to the Properties section...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
contlbexpmemberconversion.asp

"Peter Huang" [MSFT] - 30 Mar 2006 09:39 GMT
Hi,

Currently I am researching the issue and we will reply here with more
information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 03 Apr 2006 07:04 GMT
Hi,

Currently I am still troubleshooting the issue, I will update you ASAP.

Thanks for your understanding!

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 05 Apr 2006 07:59 GMT
Dear Customer,

For this issue I have consulting our product team.
This is by design as the documentation states.  For any reference type  
(interface or class such as Object) we will expose this as [propputref].  
So far the fact is you can't expose properties for reference types as
[propput].  If you do need to fix the issue my suggestion is for you to
contact MSPSS to ask for hotfix for this issue.

http://support.microsoft.com

Thanks for your understanding!

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
VB6 To .NET - 11 Apr 2006 14:10 GMT
I am posting this in case someone else needs a solution...

I was given a very good work around for this on a Microsoft VB forum.  Here
is the link:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=320908&SiteID=1
Essentially what we are doing is building our interfaces in VB6 and
implementing them in .NET.  Everything works great.  There are a few small
nuances, but for all intents and purposes it works wonderfully.

Thanks.
"Peter Huang" [MSFT] - 12 Apr 2006 04:01 GMT
Hi,

Thanks for your knowledge sharing.
I think that will benefit the whole community.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.