473,789 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Public Structure OCIDIIRRegistry Return
Public OCIDIIRimplicit error As String
Public OCIDIIRexplicit error As String
Public OCIDIIRvalueReq uested
End Structure
the DLL has a Function

Public Function SetRegistry_Str ing(ByVal Registryname As String, ByVal
registryvalue As String) As OCIDIIRRegistry Return
OCIDIIRimplicit error = OCIDIIRErrors.B eginErrorNOTOK
OCIDIIRexplicit error = "Error in SetRegistry_Str ing: " + Registryname +
" [" + OCIDIIRexplicit error + "]"
End Function

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

In VB.NEt, I want to get the values OCIDIIRimplicit error and
OCIDIIRexplicit error from SetRegistry_Str ing

I tried in the VB.NET app:
Public Structure MyOCIDIIRRegist ryReturn
Public MyOCIDIIRimplic iterror As String
Public MyOCIDIIRexplic iterror As String
Public MyOCIDIIRvalueR equested
End Structure
Dim MyRegistrySetti ng As New OCIDIIRRegistry .GAINSCOM.OCIDI IRRegistry ' name
of the DLL
Dim MyRegistryStruc ture As MyOCIDIIRRegist ryReturn
MyRegistryStruc ture = MyRegistrySetti ng.GetRegistry_ String("server" , "SQL")
' as an attempt to pass the structure but I get an squigly error :

Value of type 'OCIDIIRRegistr y.GAINSCOM.OCID IIRRegistry.OCI RegistryReturn'
cannot be converted to 'DIIRMAIN.frmMA IN.MyOCIDIIRReg istryReturn'

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

Thanks

TErry


Nov 20 '05 #1
1 1626
THANK YOU! after 6 hours of work on this + your two minutes, I can go home!
Take Care

"David Williams" <Da***********@ discussions.mic rosoft.com> wrote in message
news:1A******** *************** ***********@mic rosoft.com...
Drop the structure MyOCIDIIRRegist ryReturn. Just use the OCIDIIRRegistry Return 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 OCIDIIRRegistry Return
Public OCIDIIRimplicit error As String
Public OCIDIIRexplicit error As String
Public OCIDIIRvalueReq uested
End Structure
the DLL has a Function

Public Function SetRegistry_Str ing(ByVal Registryname As String, ByVal
registryvalue As String) As OCIDIIRRegistry Return
OCIDIIRimplicit error = OCIDIIRErrors.B eginErrorNOTOK
OCIDIIRexplicit error = "Error in SetRegistry_Str ing: " + Registryname + " [" + OCIDIIRexplicit error + "]"
End Function

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

In VB.NEt, I want to get the values OCIDIIRimplicit error and
OCIDIIRexplicit error from SetRegistry_Str ing

I tried in the VB.NET app:
Public Structure MyOCIDIIRRegist ryReturn
Public MyOCIDIIRimplic iterror As String
Public MyOCIDIIRexplic iterror As String
Public MyOCIDIIRvalueR equested
End Structure
Dim MyRegistrySetti ng As New OCIDIIRRegistry .GAINSCOM.OCIDI IRRegistry ' name of the DLL
Dim MyRegistryStruc ture As MyOCIDIIRRegist ryReturn
MyRegistryStruc ture = MyRegistrySetti ng.GetRegistry_ String("server" , "SQL")

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

Value of type 'OCIDIIRRegistr y.GAINSCOM.OCID IIRRegistry.OCI RegistryReturn' cannot be converted to 'DIIRMAIN.frmMA IN.MyOCIDIIRReg istryReturn'

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

Thanks

TErry



Nov 20 '05 #2

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

Similar topics

9
5354
by: Martin Drautzburg | last post by:
My wxPython program starts execution in mainFrame.py like this class MainApp(wxApp): def OnInit(self): self.mainFrame = MainFrame(None) self.mainFrame.Show() self.SetTopWindow(self.mainFrame) return True
3
3647
by: Panda2 | last post by:
Say I have a structure such as: struct Barn{ char type; int number; }animal so for example we might have data like animal.type cow animal.number 10
8
1575
by: Blue Ocean | last post by:
I know this is somewhat dependent on the circumstances, but let me ask anyway. Suppose I have a 100 byte struct or array or something like that. Which would be more efficient? void function(struct something foo) { foo.this + foo.that; foo.somethingoranother++; printf(foo.foostring); //other operations on the array
6
5559
by: yezi | last post by:
Hi: How to code for operation between 2 structures? The structure's defination is : struct sockaddr_in my_addr; I need call a subfunction and pass the value in my_addr to the subfuncition , which same structure but different name?
7
1979
by: Yoramo | last post by:
hello I'm calling Win32 API methods like "SendMessage" in this method there are the lParam & wParam parameters, sometimes I need to pass a structure address in the lParam or wParam. the only way I found that workes is to define SendMessage like that:
8
6579
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable, and then I had other usercontrols simply read this by traversing the class structure: siteClass.userControlClass.specficVariable. That worked fine. The new site I'm working on is a bit different, as I'm using multiple
6
5353
by: juky | last post by:
Hi all, I have 2 applications one in VB.net and the other in VC6. I need to pass data between them. How can I do it? what's the best way to implement such communication ? Any comment will be appreciate. Thank you. Juky
2
5255
by: prakashgkhaire | last post by:
i have two structure where first structure consists val and structure pointer(linklist), 2nd structure consists, val, a varialbe of first structure, pointer of structure. Now i found to pass the variable of 2nd structure to function as variable of 1st structure struct first { int val; struct first *next;
3
6154
by: michelqa | last post by:
Hi, I already post a similar question last week without success. Ok I want to get the current text selection in a RICHEDIT control.. This can be easily done in C++ with EM_EXGETSEL message. I really need to do the same thing in C#. How can I put the structure in memory to be able to call SendMessage and get the expected results in the structure.
0
9665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6768
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.