1,105,391 Community Members

Access Name Space in Primary project

Member Avatar
vmk
Newbie Poster
2 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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
Member Avatar
thines01
Postaholic
2,420 posts since Oct 2009
Reputation Points: 389 [?]
Q&As Helped to Solve: 413 [?]
Skill Endorsements: 10 [?]
Team Colleague
Featured
 
0
 

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

Member Avatar
vmk
Newbie Poster
2 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
Begginnerdev
Veteran Poster
1,142 posts since Apr 2010
Reputation Points: 251 [?]
Q&As Helped to Solve: 191 [?]
Skill Endorsements: 15 [?]
 
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()
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: