Problem with converting code...

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Hi,

I am looking at the project at
http://vbaccelerator.com/home/NET/Code/Libraries/Windows/MDI_Client_Area_Painting/article.asp
and i'm trying to convert it to VB.net

right now im in the file MDIClientWindow.cs and the following but of code
does not work...

#Region "EnumWindows Code"

Private Sub GetWindows(ByVal hWndParent As IntPtr)

Me.UnManagedMethods.EnumChildWindows(hWndParent, New
EnumWindowsProc(AddressOf Me.WindowEnum), 0)

End Sub

Private Function WindowEnum(ByVal hWnd As IntPtr, ByVal lParam As Integer)
As Integer

Return 1



End Function

#End Region



where the new EnumWindowsProc(address of me.WindowEnum) is i keep getting a
signature mismatch error (which there is one) but in C# this does not happen
in their project... the WindowEnum function looks like it needs to return a
integer 1 or 0 but the EnumWindowsProc does not want a value returned....
how would you convert this?! thanks
 
I guess this is my problem now...

in the end of that file there is this function header...

public MDIClientWindow(IMDIClientNotify i, IntPtr handle){...}

but when i do this in VB.NET

public MDIClientWindow(byval as Win32.IMDIClientNotify, byval handle as
IntPtr)



it underlines byval and says "expression expected" why would that be? thanks
 
Brian Henry said:
I guess this is my problem now...

in the end of that file there is this function header...

public MDIClientWindow(IMDIClientNotify i, IntPtr handle){...}

but when i do this in VB.NET

public MDIClientWindow(byval as Win32.IMDIClientNotify, byval handle
as IntPtr)



it underlines byval and says "expression expected" why would that be?
thanks

Insert a variable name.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
public MDIClientWindow(IMDIClientNotify i, IntPtr handle){...}

but when i do this in VB.NET

public MDIClientWindow(byval as Win32.IMDIClientNotify, byval handle as
IntPtr)

Looks like you forgot the 'i' in the function declaraction:

public MDIClientWindow(byval i as Win32.IMDIClientNotify, byval handle as
IntPtr)
 
Back
Top