473,785 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Com Interop generating wrong cases for interfaces

Folks,

We have a C# method which we register as part of a class for COM Interop:

public void send(string contents, string filepath ,string filename)

{

}

The type library produced for the assembly contains the following method
information:

void send(

[in] BSTR contents,

[in] BSTR FilePath,

[in] BSTR FileName);

Notice how the original parameters filename and filepath have been changed
to FileName and FilePath.

This is breaking all of our COM bindings in a significant amount of XLANG
schedules as the parameter messages need re-created. We cannot afford to do
this.

Also notice how the parameter signiature has not been changed.

Builds over 2 weeks have been fine through VS.NET, because older DLLS from
our SourceSafe database actually compile for InterOp correctly using
TBLEXP.exe - i.e. the com interfaces get generated with lowercase letters.

Very confused! Can anyone suggest a solution for this, as we now cannot
deploy new codebases to production.

Thanks in advance,

Conor
Nov 22 '05 #1
7 2054
>Notice how the original parameters filename and filepath have been changed
to FileName and FilePath.


This is most likely due to a "feature" in the oleaut typelib
generation code. See

BUG: MIDL Changes the Case of Identifier in Generated Type Library
http://support.microsoft.com/?kbid=220137

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 22 '05 #2
Hi Conor,

Maybe I have missing something, but based on my test, I can not reproduce
the problem.

I have a class as below.
using System;
using System.Runtime. InteropServices ;
namespace TestCapicalizeP arameter
{
[ClassInterface( ClassInterfaceT ype.AutoDual)]
public class Class1
{
public Class1()
{
}
public void send(string contents, string filepath ,string filename)
{
}
}
}

After I check the Register for COM Interop in the project setting, I will
get the typelib as below.

[id(0x60020004)]
void send(
[in] BSTR contents,
[in] BSTR filepath,
[in] BSTR filename);
NOTE: the filepath and filename are not capitalized.

I tested on VS.NET 2003(.NET framework 1.1).

If I have any misunderstandin g, please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 22 '05 #3
Thanks Mattias,

I'll hunt through the project classes to see where there may be another
signature similiar causing the problem.

regs,
Conor

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:e%******** *******@tk2msft ngp13.phx.gbl.. .
Notice how the original parameters filename and filepath have been
changed
to FileName and FilePath.


This is most likely due to a "feature" in the oleaut typelib
generation code. See

BUG: MIDL Changes the Case of Identifier in Generated Type Library
http://support.microsoft.com/?kbid=220137

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 22 '05 #4
Thanks Peter.

I think, referring to Mattias's email alongside yours, we may have another
signature in there that has for some reason caused the compiler to reach it
first (I think we re-strucutured some classes), even though it will not be
marked as requiring a class interface for COM as it is dotnet only. Then
perhaps it is compiling our method that is marked for COM interface
generation, incorrectly.

If this is the case, interop is a bit of a minefield. Surely if my method
is dotnet only, the compiler should just ignore it completely.

I will report back my findings at some stage today.

Thanks,
Conor

""Peter Huang" [MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:BS******** ******@TK2MSFTN GXA03.phx.gbl.. .
Hi Conor,

Maybe I have missing something, but based on my test, I can not reproduce
the problem.

I have a class as below.
using System;
using System.Runtime. InteropServices ;
namespace TestCapicalizeP arameter
{
[ClassInterface( ClassInterfaceT ype.AutoDual)]
public class Class1
{
public Class1()
{
}
public void send(string contents, string filepath ,string filename)
{
}
}
}

After I check the Register for COM Interop in the project setting, I will
get the typelib as below.

[id(0x60020004)]
void send(
[in] BSTR contents,
[in] BSTR filepath,
[in] BSTR filename);
NOTE: the filepath and filename are not capitalized.

I tested on VS.NET 2003(.NET framework 1.1).

If I have any misunderstandin g, please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 22 '05 #5
Mattias,

That was the problem - thanks a lot - saved us a load of days there.

We had added a new COM method in a class that was higher up alphabetically
in the project. Although this had a different signature, it did have
parameter names that were Pascal cased. This meant that the compiler
changed every other occurrance of these parameter names in each of the other
COM methods.

This breaks the COM bindings in our existing methods calls in the
case-sensitive message naming world of XLANG.

Thanks again for all your help.

regs,
Conor

"Conor Maguire" <Th****@newsgro up.nospam> wrote in message
news:O4******** ******@tk2msftn gp13.phx.gbl...
Thanks Mattias,

I'll hunt through the project classes to see where there may be another
signature similiar causing the problem.

regs,
Conor

"Mattias Sjögren" <ma************ ********@mvps.o rg> wrote in message
news:e%******** *******@tk2msft ngp13.phx.gbl.. .
>Notice how the original parameters filename and filepath have been
>changed
to FileName and FilePath.


This is most likely due to a "feature" in the oleaut typelib
generation code. See

BUG: MIDL Changes the Case of Identifier in Generated Type Library
http://support.microsoft.com/?kbid=220137

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


Nov 22 '05 #6
Peter,

See my response to Mattias.

And thanks for your help and your quick response.

regs,
Conor

"Conor Maguire" <Th****@newsgro up.nospam> wrote in message
news:uc******** *****@TK2MSFTNG P12.phx.gbl...
Thanks Peter.

I think, referring to Mattias's email alongside yours, we may have another
signature in there that has for some reason caused the compiler to reach
it first (I think we re-strucutured some classes), even though it will not
be marked as requiring a class interface for COM as it is dotnet only.
Then perhaps it is compiling our method that is marked for COM interface
generation, incorrectly.

If this is the case, interop is a bit of a minefield. Surely if my method
is dotnet only, the compiler should just ignore it completely.

I will report back my findings at some stage today.

Thanks,
Conor

""Peter Huang" [MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:BS******** ******@TK2MSFTN GXA03.phx.gbl.. .
Hi Conor,

Maybe I have missing something, but based on my test, I can not reproduce
the problem.

I have a class as below.
using System;
using System.Runtime. InteropServices ;
namespace TestCapicalizeP arameter
{
[ClassInterface( ClassInterfaceT ype.AutoDual)]
public class Class1
{
public Class1()
{
}
public void send(string contents, string filepath ,string filename)
{
}
}
}

After I check the Register for COM Interop in the project setting, I will
get the typelib as below.

[id(0x60020004)]
void send(
[in] BSTR contents,
[in] BSTR filepath,
[in] BSTR filename);
NOTE: the filepath and filename are not capitalized.

I tested on VS.NET 2003(.NET framework 1.1).

If I have any misunderstandin g, please feel free to post here.
Best regards,

Peter Huang
Microsoft Online Partner Support

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


Nov 22 '05 #7
Hi Conor,

Thanks for your feedback and thanks for Mattias's knowledge sharing in the
community.

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

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

Nov 22 '05 #8

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

Similar topics

0
2353
by: David Dolheguy | last post by:
I am in desperate need to get help in answering some questions in regards to building a DCOM Server using C#. I need to create a DCOM server using C#.NET, I realise that you first need to create the managed code, attach interfaces and use the CCW command line tool to add a COM wrapper to the assembly. The server will be communicating with a DCOM client which I didn't write, but I have all the documentation on what interfaces and...
7
380
by: Conor Maguire | last post by:
Folks, We have a C# method which we register as part of a class for COM Interop: public void send(string contents, string filepath ,string filename) {
5
5105
by: Eric St-Onge | last post by:
Hi all, I have a C# DLL containing only interfaces that I want to have a TLB (type library) generated for. For that I use the "Register for COM Interop" compiler option but it gives me the error ******************* Building satellite assemblies...
20
3199
by: Razzie | last post by:
Hey all, I'm really going through a small hell right now - I've completely lost it :) I made a project, using two interop libraries from exchange (created them as in this msdn article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp). I set my project properties as 'Register as COM interop' to true, I can install it my project on my developement machine without a flaw. Great.
8
3425
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be added. Converting the type library to a .Net assembly failed. A depended type library 'CDO' could not be converted to a .NET assembly. A dependent type library 'ADODB' could not be converted to a .NET assembly. Item has already been added." ...
2
8207
by: Steve | last post by:
I'm using Visual Studio .NET (not 2003), and am developing a class that works with Word theough the Office PIAs (Interop). I can open word and do things with it programatically, but I can't close it. Specifically, when I try to call the Quit() method on the application object, VB gives me the following error: 'Quit' is ambiguous across the inherited interfaces 'Microsoft.Office.Interop.Word._Application' and...
1
1611
by: tcarvin | last post by:
If you are not in the mood for a rant, then leave now... I figure most VB.NET programmers have a VB6 background, so I hope you all don't mind the semi-VB.NET related Interop posting. Like most of you, we have a large base of VB6 that must be maintained (and even enhanced), while we are trying to do some new development in VB.NET. I recently had to make a .NET library I wrote available to my VB6 application.
1
2524
by: Varun Bansal | last post by:
Hi, I've written a C# dll and I'm trying to return a "List of structures" to my C++ client application. I'm getting this warning while compiling my C# dll. Warning 1 Type library exporter warning processing 'xyz'. Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM. Can someone guide me what needs to be done to resolve it?
1
4560
by: Don.Leri | last post by:
Hi, I have a logger.dll (unmanaged c++ dll compiled in vs2005). I have a C# interop to use that dll in managed code implemented in Interfaces.dll (used by other C# dlls). I also have a number of other C# dlls referencing Interfaces.dll and using logger.dll interop for logging.
1
5228
by: Bhrionn | last post by:
Hello World, I am working on implementing a build for my companies application. The scenario implemeted is producing the error: ‘Class does not support automation or does not support expected interface' when I try to run the RegFree COM interop application from a clients machine. The application works fine for all development machines when run locally or from the network. The application is run from the network so - the component is not...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7506
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.