Com dll usage problem in C#?

  • Thread starter Thread starter Özden Irmak
  • Start date Start date
Ö

Özden Irmak

Hi,

I've a com dll developed in VB6. I want to use this dll in a C# application.
I set the references to that control and created an instance of the class
set to a variable. But when I call a property in that class I get this error
:

Property, indexer, or event 'SourceDatabaseConnectionString' is not
supported by the language; try directly calling accessor methods
'CompareLibDll.cCompareAccessClass.get_SourceDatabaseConnectionString()' or
'CompareLibDll.cCompareAccessClass.set_SourceDatabaseConnectionString(ref
string)'

There is no "get_SourceDatabaseConnectionString()" method in that class and
this class works perfectly in VB.Net..?

Can somebody help me?

Regards,

Özden Irmak
 
"Özden Irmak" said:
Hi,

I've a com dll developed in VB6. I want to use this dll in a C# application.
I set the references to that control and created an instance of the class
set to a variable. But when I call a property in that class I get this error
:

Property, indexer, or event 'SourceDatabaseConnectionString' is not
supported by the language; try directly calling accessor methods
'CompareLibDll.cCompareAccessClass.get_SourceDatabaseConnectionString()' or
'CompareLibDll.cCompareAccessClass.set_SourceDatabaseConnectionString(ref
string)'

There is no "get_SourceDatabaseConnectionString()" method in that class and
this class works perfectly in VB.Net..?

Can somebody help me?

C# doesn't support parameterized properties but VB.NET does -- that's
why it works in VB.NET.

In C#, you should be able to do exactly what the error says. The
methods won't show up with Intellisense, but if you type them in and
compile the code, it should work since they are real methods that you
should be able to see with ILDASM.
 
Hello Patrick,

I've figured out it was exactly like you said after a few minutes of my
post...

Thanks for the reply anyway...

Regards,

Özden

"Özden Irmak" said:
Hi,

I've a com dll developed in VB6. I want to use this dll in a C#
application.
I set the references to that control and created an instance of the class
set to a variable. But when I call a property in that class I get this
error
:

Property, indexer, or event 'SourceDatabaseConnectionString' is not
supported by the language; try directly calling accessor methods
'CompareLibDll.cCompareAccessClass.get_SourceDatabaseConnectionString()'
or
'CompareLibDll.cCompareAccessClass.set_SourceDatabaseConnectionString(ref
string)'

There is no "get_SourceDatabaseConnectionString()" method in that class
and
this class works perfectly in VB.Net..?

Can somebody help me?

C# doesn't support parameterized properties but VB.NET does -- that's
why it works in VB.NET.

In C#, you should be able to do exactly what the error says. The
methods won't show up with Intellisense, but if you type them in and
compile the code, it should work since they are real methods that you
should be able to see with ILDASM.
 

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

Similar Threads


Back
Top