473,320 Members | 1,977 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,320 software developers and data experts.

Generating implementation declaration - CodeClass.AddImplementedInterface()fails

Hello newsgroup

I want to add an interface declaration to a class using the EnvDTE
objects. Unfortunately, this code fails:

CodeClass cc = ....
cc.AddImplementedInterface("System.IComparable", (long)-1);

This code doesn't work - I'm always getting an exception that says
"Wrong Parameter".

CodeClass.AddBase() works, but the interface name is set immediately
behind the class name, ignoring the position parameter. This screws up
code for classes that inherit from other classes:

class myClass: System.IComparable, BaseClass instead of
class myClass: BaseClass, System.IComparable

Any workaround on this?

Thanks for your advice

Philipp


Nov 15 '05 #1
2 1231
Philipp,
CodeClass cc = ....
cc.AddImplementedInterface("System.IComparable" , (long)-1);


Have you tried it without the cast to long? In other words, keep -1 as
an int.

Mattias

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

That was the first thing I tried - doesn't work either. As the
documentation mentions long values, I tried it with a cast but with the
same result...

Philipp


Mattias Sjögren wrote:
Philipp,

CodeClass cc = ....
cc.AddImplementedInterface("System.IComparable ", (long)-1);

Have you tried it without the cast to long? In other words, keep -1 as
an int.

Mattias


Nov 15 '05 #3

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

Similar topics

0
by: Phil Powell | last post by:
<?php class Grad { var $dbFormExemptionArray = array(); function Grad ($id = '') { ...
6
by: Poul Møller Hansen | last post by:
I have made a stored procedure, containing this part for generating a unique reference number. SET i = 0; REPEAT SET i = i + 1; SELECT RAND() INTO reference FROM SYSIBM.SYSDUMMY1; SET...
25
by: H.A. Sujith | last post by:
If malloc fails what should I do? 1. Exit imediately. 2. Print an error message (or put a log entry) and exit. 3. Print an error message (or put a log entry) and continue execution (after...
28
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
6
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(),...
8
by: yuri | last post by:
Hi all At coding XP Themes i can't get "GetThemeColor" to work. It always fails ("not found" err. code) regardless of which control parts and states entered. Could somebody help me with advice?...
4
by: Dotcom | last post by:
ASP.NET generates markup that fails WC3 validation in a number of situations (below): can anyone suggest a way round these? 1. For Command Buttons, the HTML <INPUT type = Image> element rendered...
1
by: toton | last post by:
Hi, I have two namespace contains class InkFrame and PrefDialog respectively. PrefDialog needs InkFrame to show the dialog over the frame. It also stores a pointer to InkFrame inside it. Now I...
7
by: Dave | last post by:
I've got these declarations: public delegate void FormDisplayResultsDelegate<Type>(Type displayResultsValue); public FormDisplayResultsDelegate<stringdisplayMsgDelegate; instantiation:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.