Click here to Skip to main content
15,899,825 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Runtime error '91' Pin
Dave Kreskowiak24-Sep-08 9:12
mveDave Kreskowiak24-Sep-08 9:12 
GeneralRe: Runtime error '91' Pin
nlarson1124-Sep-08 10:03
nlarson1124-Sep-08 10:03 
GeneralRe: Runtime error '91' Pin
ChandraRam25-Sep-08 1:06
ChandraRam25-Sep-08 1:06 
AnswerRe: Runtime error '91' (Done!) Pin
Pedram Behroozi25-Sep-08 3:50
Pedram Behroozi25-Sep-08 3:50 
QuestionProblem With Saving Image in Binary format Pin
Saba0223-Sep-08 16:35
Saba0223-Sep-08 16:35 
AnswerRe: Problem With Saving Image in Binary format Pin
N a v a n e e t h23-Sep-08 17:48
N a v a n e e t h23-Sep-08 17:48 
QuestionAccess combobox binding and relationships Pin
Member 435504923-Sep-08 11:48
Member 435504923-Sep-08 11:48 
QuestionHow to GetMethod that use Dynamic Parameter (TypeParam)? Pin
f3rland23-Sep-08 11:01
f3rland23-Sep-08 11:01 
Begin PART 1 :

I have a sub
Private Sub PrintProperties(Of T)(ByVal pItem As T)
   [...]
End Sub
that I need to access it through MethodInfo :
Private Sub PrintPropertiesMaster(Of T)()
   [...]
   Dim method As MethodInfo = GetType(Form1).GetMethod("PrintProperties", _
      (System.Reflection.BindingFlags.Instance _
       Or (System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.NonPublic)), _
       Nothing, New Type() {GetType(T)}, Nothing)
   [...]
End Sub
but method is set to nothing after the previous line.
Confused | :confused:
I'm sure I miss something in the Type.GetMethod parameters. Any idea?

End PART 1




Begin PART 2 :

Another way to achieve my goal could be to know how to specify a TypeParam dynamically.
Let me explain this with sample :

This is my not conforming code:
For Each oEnt As Entity In DefaultManager.GetEntities(Of SomeNameSpace.ObjOne)()
   PrintProperties(Of SomeNameSpace.ObjOneDataRow)(CType(oEnt, SomeNameSpace.ObjOneDataRow))
Next
For Each oEnt As Entity In DefaultManager.GetEntities(Of SomeNameSpace.ObjTwo)()
   PrintProperties(Of SomeNameSpace.ObjTwoDataRow)(CType(oEnt, SomeNameSpace.ObjTwoDataRow))
Next
'And so on
[...]
I need to access it using a System.Type instead of TypeParam (Of Something)
(Consider that ObjOne Inherits from ObjOneDataRow and ObjTwo Inherits from ObjTwoDataRow.
In other words, ObjOneDataRow is the base class of ObjOne)

So one parameter should be enough to know all the needed System.Type to finish with something like this :
Private Sub PrintValues(Of T)()
   For Each oEnt As Entity In DefaultManager.GetEntities(Of T)()
      PrintProperties(Of GetType(T).BaseType)(CType(oEnt, GetType(T).BaseType))
   Next
End Sub
but this does not compile Frown | :(


End PART 2


Thanks for any help!!!
QuestionError: "Invalid Parameter Used" when i try to display an image [modified] Pin
Member 367504723-Sep-08 3:37
Member 367504723-Sep-08 3:37 
QuestionPLEASE HELP ME Pin
sidwithu23-Sep-08 3:31
sidwithu23-Sep-08 3:31 
AnswerRe: PLEASE HELP ME Pin
Dave Kreskowiak23-Sep-08 7:02
mveDave Kreskowiak23-Sep-08 7:02 
QuestionReport Printining Pin
Gagan.2023-Sep-08 1:13
Gagan.2023-Sep-08 1:13 
QuestionConvert Topographic Map/ Contour Map Pin
Tan Yih Sheng22-Sep-08 23:45
Tan Yih Sheng22-Sep-08 23:45 
Questioncreating ascii file in mc1000 Pin
jayv0122-Sep-08 22:28
jayv0122-Sep-08 22:28 
AnswerRe: creating ascii file in mc1000 Pin
ChandraRam23-Sep-08 0:54
ChandraRam23-Sep-08 0:54 
GeneralRe: creating ascii file in mc1000 Pin
jayv0123-Sep-08 11:25
jayv0123-Sep-08 11:25 
QuestionWebBrowser Drag/Drop Support? Pin
Saul Johnson22-Sep-08 21:12
Saul Johnson22-Sep-08 21:12 
AnswerRe: WebBrowser Drag/Drop Support? Pin
jzonthemtn23-Sep-08 0:26
jzonthemtn23-Sep-08 0:26 
GeneralRe: WebBrowser Drag/Drop Support? Pin
Saul Johnson24-Sep-08 20:47
Saul Johnson24-Sep-08 20:47 
GeneralRe: WebBrowser Drag/Drop Support? Pin
albertjian18-Mar-10 22:32
albertjian18-Mar-10 22:32 
Questionhow to list the datas in combobox or listbox? Pin
dileep.arangod22-Sep-08 20:54
dileep.arangod22-Sep-08 20:54 
AnswerRe: how to list the datas in combobox or listbox? Pin
Ashfield22-Sep-08 21:11
Ashfield22-Sep-08 21:11 
GeneralRe: how to list the datas in combobox or listbox? Pin
dileep.arangod23-Sep-08 1:18
dileep.arangod23-Sep-08 1:18 
GeneralRe: how to list the datas in combobox or listbox? Pin
Ashfield23-Sep-08 1:37
Ashfield23-Sep-08 1:37 
GeneralRe: how to list the datas in combobox or listbox? Pin
dileep.arangod23-Sep-08 2:04
dileep.arangod23-Sep-08 2:04 

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.