ref struct in mc++ to c#

D

dave

Hi,
I wrote a classlibrary in vs 2005 mc++ and declered inside it a struct like
this:
public ref struct FGBITParam

{

public:

FGBITParam()

{

sAuxName ="";

hWnd=IntPtr::Zero ;

}

String^ sAuxName;

IntPtr hWnd;

};



Then i wrote a secound mc++ classlibrary that have a referance to the first
class library and implement a function as a member of ref class the get the
struct from the first classlibrary as a parameter.



I then wrote a c# application that use referance to the two classlibrary
above and try to call to the function of the class in the secound
classlibrary and pass it a prametr of type FGBITParam and i get this error:

error CS1501: No overload for method get one arg...

Why????

Thanks
 
W

Willy Denoyette [MVP]

dave said:
Hi,
I wrote a classlibrary in vs 2005 mc++ and declered inside it a struct like this:
public ref struct FGBITParam

{

public:

FGBITParam()

{

sAuxName ="";

hWnd=IntPtr::Zero ;

}

String^ sAuxName;

IntPtr hWnd;

};



Then i wrote a secound mc++ classlibrary that have a referance to the first class library
and implement a function as a member of ref class the get the struct from the first
classlibrary as a parameter.



I then wrote a c# application that use referance to the two classlibrary above and try to
call to the function of the class in the secound classlibrary and pass it a prametr of
type FGBITParam and i get this error:

error CS1501: No overload for method get one arg...

Why????

Thanks


First, it's Impossible to answer such question when you only post the least relevant part of
the code. Second, you better post this to the C++ NG at
microsoft.public.dotnet.languages.vc, this issue is not C# related.

Willy.
 
D

Dustin Campbell

I wrote a classlibrary in vs 2005 mc++ and declered inside it a struct
like
this:

Then i wrote a secound mc++ classlibrary that have a referance to the
first class library and implement a function as a member of ref class
the get the struct from the first classlibrary as a parameter.

I then wrote a c# application that use referance to the two
classlibrary above and try to call to the function of the class in the
secound classlibrary and pass it a prametr of type FGBITParam and i
get this error:

error CS1501: No overload for method get one arg...

Why????

Unfortunately, you didn't post the relevant portion of the code that caused
the error. The struct isn't the cause of the error. Likely, the problem is
between the method declaration in the second mc++ class library and the calling
site of the C# application.

Best Regards,
Dustin Campbell
Developer Express Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top