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

CCW and method parameters being classes?????

Hello,

I'm having a problem with CCW and method parameters. Some of the parameters
are classes.
It seems that these classes (or at least the properties inside the class)
are not seen from my VB client
Do I have to declare an interface for these classes (eg. TransModes)? If
yes, does anyone know the syntax?
Thanks a lot,
José
Code snippet:
=========

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
[Guid("1930F351-E6B3-4706-8784-562F7B541340")]
public interface _UFSStatusAccess
{
TerminationCode Init (int nTestLevel, out string strErrDescr);

TerminationCode Terminate (out string strErrDescr);

TerminationCode GetTransmissionMode (bool UseCaching, out TransModes
UFSMode, out string strErrDescr);
}
[Serializable]
public enum TerminationCode:int
{
eOK = 0,
eErrXXX = 1,
eErrNoConfirmation = 8901,
eErrInitNotSuccessfull = 8902,
eWngXXX = 189000,
eWngNoCommunication = 189001,
eInfXXX = 28900,
eDBGXXX = 38900
}

[Serializable]
public class TransModes
{
public bool m_Online;
public bool m_MemoryMode;
}
Nov 15 '05 #1
1 1246
I went a bit further. In fact, I think the parameters which as classes
should be interfaces as well. So I get my hand durty and did it...
However, the VB code does not get the object as prepared in managed coded.

Any idea?


Code snippet:
=========

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
[Guid("1930F351-E6B3-4706-8784-562F7B541340")]
public interface _UFSStatusAccess
{

TerminationCode GetTransmissionMode (bool UseCaching, out TransModes
UFSMode, out string strErrDescr);
}
[Serializable]
public enum TerminationCode:int
{
eOK = 0,
eErrXXX = 1,
eErrNoConfirmation = 8901,
eErrInitNotSuccessfull = 8902,
eWngXXX = 189000,
eWngNoCommunication = 189001,
eInfXXX = 28900,
eDBGXXX = 38900
}

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
[Guid("B758299E-A024-40b3-9740-A35CA7A9D378")]
public interface ITransModes
{
/// <summary>Is UFS currently online?</summary>
bool Online {get; set;}
/// <summary>Is UFS currently in memory mode?</summary>
bool MemoryMode {get; set;}
}
Then I have classes that implements the IF:

[Serializable]
public class TransModes : ITransModes
{
public TransModes() {}

public bool Online {get{return m_Online;} set{m_Online = value;}}
public bool MemoryMode {get{return m_MemoryMode;} set{m_MemoryMode =
value;}}

// Class members that will hold the states
public bool m_Online;
public bool m_MemoryMode;
}
public TerminationCode GetTransmissionMode (bool UseCaching, out
ITransModes UFSTransMode, out string strErrDescr)
{
try
{
UFSTransMode = new TransModes();
TransModes UFSTransModeEx = (TransModes)UFSTransMode;

return m_UFS.GetTransmissionMode(UseCaching, out
UFSTransModeEx, out strErrDescr);
--> at this point the UFSTransModeEx has valid values.....

}
catch (Exception ex)
{
UFSTransMode = new TransModes();
strErrDescr = "Error occured while trying to get UFS
transmission modes. Err: " + ex.Message;
return TerminationCode.eErrXXX;
}
}

VB PART:
========

Private UFSStatus As New UFSStatusProvider.UFSStatusAccess

Private Sub Test_Click()

Dim errMsg As String
Dim stat As UFSStatusProvider.TerminationCode
Dim Mode As UFSStatusProvider.ITransModes
Set Mode = CreateObject("UFSStatusProvider.TransModes")
stat = TerminationCode_eErrXXX
Mode.MemoryMode = True
Mode.Online = False
stat = TerminationCode_eErrXXX
stat = UFSStatus.GetTransmissionMode(True, Mode, errMsg)

'---------------> stat and errMsg are returned ok... Mode not :-((
End Sub


================================================== ==========================
=======
"José Joye" <jo*******@KILLTHESPAMSbluewin.ch> wrote in message
news:OQ*************@TK2MSFTNGP12.phx.gbl...
Hello,

I'm having a problem with CCW and method parameters. Some of the parameters are classes.
It seems that these classes (or at least the properties inside the class)
are not seen from my VB client
Do I have to declare an interface for these classes (eg. TransModes)? If
yes, does anyone know the syntax?
Thanks a lot,
José
Code snippet:
=========

[InterfaceType(ComInterfaceType.InterfaceIsIDispatc h)]
[Guid("1930F351-E6B3-4706-8784-562F7B541340")]
public interface _UFSStatusAccess
{
TerminationCode Init (int nTestLevel, out string strErrDescr);

TerminationCode Terminate (out string strErrDescr);

TerminationCode GetTransmissionMode (bool UseCaching, out TransModes UFSMode, out string strErrDescr);
}
[Serializable]
public enum TerminationCode:int
{
eOK = 0,
eErrXXX = 1,
eErrNoConfirmation = 8901,
eErrInitNotSuccessfull = 8902,
eWngXXX = 189000,
eWngNoCommunication = 189001,
eInfXXX = 28900,
eDBGXXX = 38900
}

[Serializable]
public class TransModes
{
public bool m_Online;
public bool m_MemoryMode;
}

Nov 15 '05 #2

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

Similar topics

9
by: Lenard Lindstrom | last post by:
I was wondering if anyone has suggested having Python determine a method's kind from its first parameter. 'self' is a de facto reserved word; 'cls' is a good indicator of a class method ( __new__...
5
by: Harald Massa | last post by:
Hello! I am using a library (= code of so else) within Python. Somewhere in this library there is: class foo: def baa(self, parameters): print "something" self.baazanan(some other...
2
by: juchytil | last post by:
Here is a method that calls a static GetInfo() method on the MyObject class. public void MethodName(string param1, int param2) { MyObject.GetInfo(); } Is there any way for the GetInfo()...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
8
by: David Veeneman | last post by:
Should a member variable be passed to a private method in the same class as a method argument, or should the method simply call the member variable? For years, I have passed member variables to...
2
by: waylonflinn | last post by:
I'm looking for a way to invoke methods with an arbitrary number of parameters of arbitrary type from within a single method, when those parameters are known at the time of invocation of the...
2
by: ME | last post by:
How would one obtain the parameter VALUES of a method that has already run? I can find the method using the StackTrace and StackFrame classes but once I find the method I would like to obtain the...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
7
by: Chris | last post by:
Hi All, This is a weird one but I am hoping someone can help or has some pointers, a recipe how to do the following: I have to move some code from c++ to objective-c and to do this I must...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.