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

Recommended Answers

All 3 Replies

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

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.

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()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.