Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
QuestionChanging Word save directory in C# Pin
Dave Aitch23-Sep-08 4:30
professionalDave Aitch23-Sep-08 4:30 
AnswerRe: Changing Word save directory in C# Pin
selcuks23-Sep-08 4:34
selcuks23-Sep-08 4:34 
GeneralRe: Changing Word save directory in C# Pin
Dave Aitch23-Sep-08 5:03
professionalDave Aitch23-Sep-08 5:03 
QuestionControls parent is null in call back procedure when control is reloaded Pin
Chazzysb23-Sep-08 4:01
Chazzysb23-Sep-08 4:01 
AnswerRe: Controls parent is null in call back procedure when control is reloaded Pin
Wendelius23-Sep-08 8:44
mentorWendelius23-Sep-08 8:44 
QuestionSorting on Datagridview removes values from Image column en removes row.height [modified] Pin
ddecoy23-Sep-08 3:37
ddecoy23-Sep-08 3:37 
AnswerRe: Sorting on Datagridview removes values from Image column en removes row.height Pin
ddecoy23-Sep-08 5:02
ddecoy23-Sep-08 5:02 
QuestionConverting C++ COM to C# Pin
LeonardLay23-Sep-08 3:32
LeonardLay23-Sep-08 3:32 
Hello,

I am working on using a COM from C++ in new C# code. I have connected and I can get access to the member functions. The problem that I am having is that one of the member functions takes a STRUCT as an input and it outputs an array of STRUCT. And in the STRUCT there are some char arrays. So when I run the C# code I get an error message "Specified array was not of the expected type."

I'll put in a bit of the code that I am converting:

C++
-----------------
interface IHangerAssignment2 : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE Analyze(const HangerIn2& rIn, HangerOut2* pOut, int nOut, int& nResults) = 0;
};

where HangerIn2 and HangerOut2 are structs that inherit from other structs. HangerOut2 inherits from a struct that contains 2 char arrays. HangerOut2 also contains an array or char arrays.

in C#
---------------
I rewrote HangerIn2
public struct HangerIn2
{
public HangerIn hangerIn; //I just added the HangerIn struct as a member
// New USP2 properties
public double kingWidth;
public double kingHeight;
public double []bearingLength;
public bool concealedFlange;
};

I did the same for HangerOut2 which contains several arrays.

The converted code in C#

public interface IHangerAssignment
{
void Analyze(HangerIn2 hgrIn, ref HangerOut2[] hgrOut, int maxOutput, ref int nResults);
}

When this function is called, that is when I get the error "Specified array was not of the expected type."

I did notice that when stepping through the debugger that the members are always listed in alphabetical order.
AnswerRe: Converting C++ COM to C# Pin
cpkilekofp25-Sep-08 3:00
cpkilekofp25-Sep-08 3:00 
Question64 bit WMI Pin
arkiboys23-Sep-08 3:17
arkiboys23-Sep-08 3:17 
JokeRe: 64 bit WMI Pin
Giorgi Dalakishvili23-Sep-08 3:38
mentorGiorgi Dalakishvili23-Sep-08 3:38 
GeneralRe: 64 bit WMI Pin
arkiboys23-Sep-08 4:06
arkiboys23-Sep-08 4:06 
GeneralRe: 64 bit WMI Pin
Giorgi Dalakishvili23-Sep-08 4:10
mentorGiorgi Dalakishvili23-Sep-08 4:10 
GeneralRe: 64 bit WMI Pin
arkiboys23-Sep-08 4:13
arkiboys23-Sep-08 4:13 
GeneralRe: 64 bit WMI Pin
#realJSOP23-Sep-08 23:28
professional#realJSOP23-Sep-08 23:28 
GeneralRe: 64 bit WMI Pin
cpkilekofp24-Sep-08 7:05
cpkilekofp24-Sep-08 7:05 
GeneralRe: 64 bit WMI Pin
arkiboys24-Sep-08 20:53
arkiboys24-Sep-08 20:53 
GeneralRe: 64 bit WMI Pin
cpkilekofp25-Sep-08 2:55
cpkilekofp25-Sep-08 2:55 
GeneralRe: 64 bit WMI Pin
arkiboys25-Sep-08 3:41
arkiboys25-Sep-08 3:41 
GeneralRe: 64 bit WMI Pin
cpkilekofp25-Sep-08 3:55
cpkilekofp25-Sep-08 3:55 
GeneralRe: 64 bit WMI Pin
arkiboys25-Sep-08 4:07
arkiboys25-Sep-08 4:07 
GeneralRe: 64 bit WMI Pin
cpkilekofp25-Sep-08 5:30
cpkilekofp25-Sep-08 5:30 
GeneralRe: 64 bit WMI Pin
arkiboys25-Sep-08 22:10
arkiboys25-Sep-08 22:10 
QuestionProblems Working with Interop.Word [modified] Pin
Julia123-Sep-08 2:16
Julia123-Sep-08 2:16 
AnswerAttempt to bump post. Pin
Pete O'Hanlon23-Sep-08 2:21
mvePete O'Hanlon23-Sep-08 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.