By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,479 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,479 IT Pros & Developers. It's quick & easy.

how to pass a structure from a DLL to vb.net application

P: n/a
Hello:
I have a VB.NET DLL with a public structure:
Public Class OCIDIIRRegistry

Public Structure OCIDIIRRegistryReturn
Public OCIDIIRimpliciterror As String
Public OCIDIIRexpliciterror As String
Public OCIDIIRvalueRequested
End Structure
the DLL has a Function

Public Function SetRegistry_String(ByVal Registryname As String, ByVal
registryvalue As String) As OCIDIIRRegistryReturn
OCIDIIRimpliciterror = OCIDIIRErrors.BeginErrorNOTOK
OCIDIIRexpliciterror = "Error in SetRegistry_String: " + Registryname +
" [" + OCIDIIRexpliciterror + "]"
End Function

'================================================= ==========================
=============

In VB.NEt, I want to get the values OCIDIIRimpliciterror and
OCIDIIRexpliciterror from SetRegistry_String

I tried in the VB.NET app:
Public Structure MyOCIDIIRRegistryReturn
Public MyOCIDIIRimpliciterror As String
Public MyOCIDIIRexpliciterror As String
Public MyOCIDIIRvalueRequested
End Structure
Dim MyRegistrySetting As New OCIDIIRRegistry.GAINSCOM.OCIDIIRRegistry ' name
of the DLL
Dim MyRegistryStructure As MyOCIDIIRRegistryReturn
MyRegistryStructure = MyRegistrySetting.GetRegistry_String("server", "SQL")
' as an attempt to pass the structure but I get an squigly error :

Value of type 'OCIDIIRRegistry.GAINSCOM.OCIDIIRRegistry.OCIRegis tryReturn'
cannot be converted to 'DIIRMAIN.frmMAIN.MyOCIDIIRRegistryReturn'

What does that mean ? and should I do about it ?

Thanks

TErry


Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
THANK YOU! after 6 hours of work on this + your two minutes, I can go home!
Take Care

"David Williams" <Da***********@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
Drop the structure MyOCIDIIRRegistryReturn. Just use the OCIDIIRRegistryReturn structure. The probelm is that they are different
structures so the two are not the same.
HTH
--
David Williams, VB.NET MVP
"Support" wrote:
Hello:
I have a VB.NET DLL with a public structure:
Public Class OCIDIIRRegistry

Public Structure OCIDIIRRegistryReturn
Public OCIDIIRimpliciterror As String
Public OCIDIIRexpliciterror As String
Public OCIDIIRvalueRequested
End Structure
the DLL has a Function

Public Function SetRegistry_String(ByVal Registryname As String, ByVal
registryvalue As String) As OCIDIIRRegistryReturn
OCIDIIRimpliciterror = OCIDIIRErrors.BeginErrorNOTOK
OCIDIIRexpliciterror = "Error in SetRegistry_String: " + Registryname + " [" + OCIDIIRexpliciterror + "]"
End Function

'================================================= ========================== =============

In VB.NEt, I want to get the values OCIDIIRimpliciterror and
OCIDIIRexpliciterror from SetRegistry_String

I tried in the VB.NET app:
Public Structure MyOCIDIIRRegistryReturn
Public MyOCIDIIRimpliciterror As String
Public MyOCIDIIRexpliciterror As String
Public MyOCIDIIRvalueRequested
End Structure
Dim MyRegistrySetting As New OCIDIIRRegistry.GAINSCOM.OCIDIIRRegistry ' name of the DLL
Dim MyRegistryStructure As MyOCIDIIRRegistryReturn
MyRegistryStructure = MyRegistrySetting.GetRegistry_String("server", "SQL")

' as an attempt to pass the structure but I get an squigly error :

Value of type 'OCIDIIRRegistry.GAINSCOM.OCIDIIRRegistry.OCIRegis tryReturn' cannot be converted to 'DIIRMAIN.frmMAIN.MyOCIDIIRRegistryReturn'

What does that mean ? and should I do about it ?

Thanks

TErry



Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.