I'm getting the following error
On this line of codeObject Reference not set to an instance of an object
I am creating an application that allows the user to load a .dll file via the OpenFileDialog control. Then they click a button to enumerate the Functions in that dll.VB Code:
Private Declare Function ImageDirectoryEntryToData Lib "dbghelp.dll" (ByVal pBase As Long, ByVal bMappedAsImage As Long, ByVal DirectoryEntry As Int32, ByRef Size As Long) As Long Private Structure IMAGE_EXPORT_DIRECTORY Public Characteristics As Long Public TimeDateStamp As Long Public MajorVersion As Int32 Public MinorVersion As Int32 Public lpName As Long Public Base As Long Public NumberOfFunctions As Long Public NumberOfNames As Long Public lpAddressOfFunctions As Long Public lpAddressOfNames As Long Public lpAddressOfNameOrdinals As Long End Structure Const IMAGE_DIRECTORY_ENTRY_EXPORT = 0 Private lngBaseAddress As Long Dim pExportDirectory As Long Dim lngSize As Long pExportDirectory = ImageDirectoryEntryToData(lngBaseAddress, 1, IMAGE_DIRECTORY_ENTRY_EXPORT, lngSize)[color=red]<----- This line[/color]
Any ideas why I would be getting this error??? I created this application just fine in VB6 and have made all the necessary modifications to rewrite it in VB.NET, but am getting this error for some reason???




Reply With Quote