We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,313 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Access Name Space in Primary project

I have a VB.net application that has three project in it. Two of the project are DLL with references in the primary project. I have a public Model "RegSaveGet" in the primary project listed below. When I look for the namespace for the module from one of the DLL projects I can not see it. I want to use this module from the two DLL projects. I can only see it from the primary project.

Any help would be appreciated.

Public Module RegSaveGet

    'Save Form Position
    Public Sub SaveForm(ByVal MyForm As Form, ByVal MyAppName As String)
        If MyForm.WindowState = FormWindowState.Normal Then
            On Error Resume Next
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Top", MyForm.Top)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Left", MyForm.Left)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Height", MyForm.Height)
            My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Width", MyForm.Width)
        End If
    End Sub

    'Get Form Position
    Public Sub GetForm(ByVal MyForm As Form, ByVal MyAppName As String)
        On Error Resume Next
        Dim readValue As Object
        readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Top", 1)
        If CStr(readValue) <> "" Then
            MyForm.Top = CInt(readValue)
        End If
        readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Left", 0)
        If CStr(readValue) <> "" Then
            MyForm.Left = CInt(readValue)
        End If
        readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Height", "")
        If CStr(readValue) <> "" Then
            MyForm.Height = CInt(readValue)
        End If
        readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\abc\AutoSaveForm\" & MyAppName & "\" & MyForm.Name, "Width", "")
        If CStr(readValue) <> "" Then
            MyForm.Width = CInt(readValue)
        End If
    End Sub
End Module
3
Contributors
3
Replies
8 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
vmk
Newbie Poster
2 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Did you double-click on the DLL entry in references and look at the contents in the object browser?

thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

I think I may need to create a project that contains my common code and then add the new project as a reference to each of the DLL project that use it. Then with the DLL projects rolled up into one bigger project I should be able to access the public classes and functions in the reference of the referenced DLLs.

vmk
Newbie Poster
2 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

If registry keys are not an absolute must, you can use the application settings to save all of the information.


Example:

'Where savedwidth has been added as a int in the application settings.
Me.Width = My.Settings.SavedWidth

'Then for saving you can...
My.Settings.SavedWidth = Me.Width
My.Settings.Save()
Begginnerdev
Practically a Posting Shark
864 posts since Apr 2010
Reputation Points: 184
Solved Threads: 142
Skill Endorsements: 8

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.1261 seconds using 2.72MB