Click here to Skip to main content
15,887,485 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDisable/Hide menu items based on user's right? Pin
savedlema9-Jun-14 3:35
savedlema9-Jun-14 3:35 
AnswerRe: Disable/Hide menu items based on user's right? Pin
Eddy Vluggen9-Jun-14 4:24
professionalEddy Vluggen9-Jun-14 4:24 
GeneralRe: Disable/Hide menu items based on user's right? Pin
savedlema9-Jun-14 9:12
savedlema9-Jun-14 9:12 
GeneralRe: Disable/Hide menu items based on user's right? Pin
Eddy Vluggen10-Jun-14 5:26
professionalEddy Vluggen10-Jun-14 5:26 
QuestionProblems running the application on another computer Pin
dilkonika8-Jun-14 5:52
dilkonika8-Jun-14 5:52 
AnswerRe: Problems running the application on another computer Pin
Richard MacCutchan8-Jun-14 6:38
mveRichard MacCutchan8-Jun-14 6:38 
GeneralRe: Problems running the application on another computer Pin
dilkonika8-Jun-14 8:52
dilkonika8-Jun-14 8:52 
GeneralRe: Problems running the application on another computer Pin
dilkonika8-Jun-14 10:47
dilkonika8-Jun-14 10:47 
Hello !
I found that the problem is the following Sub that is run when the main form is loaded :
VB
Public Sub DoPrecompile()
     For Each an As System.Reflection.AssemblyName In System.Reflection.Assembly.GetEntryAssembly().GetReferencedAssemblies()
         Dim asmb As System.Reflection.Assembly = System.Reflection.Assembly.Load(an)
         If Not asmb.GlobalAssemblyCache Then
             For Each type As Type In asmb.GetTypes()
                 If Not type.IsInterface AndAlso Not type.IsGenericTypeDefinition Then
                     Dim ci As System.Reflection.ConstructorInfo = type.GetConstructor(System.Reflection.BindingFlags.[Static] Or System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.NonPublic, Nothing, type.EmptyTypes, Nothing)
                     If ci = Nothing Then
                         For Each method As System.Reflection.MethodInfo In type.GetMethods(System.Reflection.BindingFlags.DeclaredOnly Or System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.[Public] Or System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.[Static])
                             If Not method.IsAbstract AndAlso Not method.IsGenericMethodDefinition AndAlso Not method.ContainsGenericParameters Then
                                 System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(method.MethodHandle)
                             End If
                         Next

                         For Each prop As PropertyInfo In type.GetProperties(BindingFlags.DeclaredOnly Or BindingFlags.NonPublic Or BindingFlags.[Public] Or BindingFlags.Instance Or BindingFlags.[Static])
                             For Each accessor As MethodInfo In prop.GetAccessors(True)
                                 If Not accessor.IsAbstract AndAlso Not accessor.IsGenericMethodDefinition AndAlso Not accessor.ContainsGenericParameters Then
                                     System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(accessor.MethodHandle)
                                 End If
                             Next
                         Next
                     End If
                 End If
             Next
         End If
     Next

 End Sub


If I remove this Sub everything is ok.
But on the computer where I have created the application everything works ok even with this Sub.
On another computer I have this error message.
GeneralRe: Problems running the application on another computer Pin
Richard MacCutchan8-Jun-14 21:49
mveRichard MacCutchan8-Jun-14 21:49 
QuestionCopy Table from Word then Paste to Excel VB.net Pin
_XeLo_5-Jun-14 23:29
_XeLo_5-Jun-14 23:29 
AnswerRe: Copy Table from Word then Paste to Excel VB.net Pin
Chris Quinn6-Jun-14 0:22
Chris Quinn6-Jun-14 0:22 
GeneralRe: Copy Table from Word then Paste to Excel VB.net Pin
_XeLo_6-Jun-14 14:40
_XeLo_6-Jun-14 14:40 
Questioncopy to next available row Pin
David Rubin4-Jun-14 5:10
David Rubin4-Jun-14 5:10 
QuestionNeed Help to connect to MQ 7.0 using user id getting 2035 error. Pin
Member 102184182-Jun-14 21:03
Member 102184182-Jun-14 21:03 
QuestionUsing Functions across forms Pin
gwittlock1-Jun-14 16:34
gwittlock1-Jun-14 16:34 
AnswerRe: Using Functions across forms Pin
Peter Leow1-Jun-14 17:12
professionalPeter Leow1-Jun-14 17:12 
GeneralRe: Using Functions across forms Pin
gwittlock1-Jun-14 18:14
gwittlock1-Jun-14 18:14 
AnswerRe: Using Functions across forms Pin
Bernhard Hiller2-Jun-14 0:23
Bernhard Hiller2-Jun-14 0:23 
GeneralRe: Using Functions across forms Pin
gwittlock2-Jun-14 1:14
gwittlock2-Jun-14 1:14 
Questionlistview won't display data populated in vb6 Pin
Dave-1016953130-May-14 6:37
professionalDave-1016953130-May-14 6:37 
AnswerRe: listview won't display data populated in vb6 Pin
Tim Carmichael30-May-14 9:02
Tim Carmichael30-May-14 9:02 
GeneralRe: listview won't display data populated in vb6 Pin
Dave-1016953130-May-14 9:32
professionalDave-1016953130-May-14 9:32 
QuestionImport from SQL table by column Pin
Member 1066669830-May-14 4:38
Member 1066669830-May-14 4:38 
AnswerRe: Import from SQL table by column Pin
Eddy Vluggen30-May-14 10:43
professionalEddy Vluggen30-May-14 10:43 
AnswerRe: Import from SQL table by column Pin
Mycroft Holmes30-May-14 13:01
professionalMycroft Holmes30-May-14 13:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.