1

We have an old OCX component written in VB6 that should be running on a Windows 2016 server that is giving some strange behaviors. The component runs on a windows 2008 R2 and and windows 2003 environment.

One of the things we noticed is.

Dim fso As New FileSystemObject

Causes an exception, when we change the code to

 Dim fso As FileSystemObject
 Set fso = New FileSystemObject

the exception is gone.

the form we are starting is started from a user control with the following code

Public Function Initialize(Optional ByVal pstrMapIni As String, Optional ByVal lGuiAllowed As Boolean = True)
  GUIALLOWED = lGuiAllowed
  If right(pstrMapIni, 1) <> "\" Then
    pstrMapIni = pstrMapIni + "\"
  End If
  pstrMapIni = pstrMapIni + "map.ini"
  frmMain.SetMapIni (pstrMapIni)
  Load frmMain
End Function 

the Load frmMain fails with a null ref exception

if someone has any idea of what direction we need to search... we are out of them.

deblocker
  • 7,629
  • 2
  • 24
  • 59
Gelootn
  • 601
  • 6
  • 16
  • 1
    Just guessing, a note aside: won't the function invocation `frmMail.SetMapIni()` already cause the loading of frmMain...? Maybe You can try to revisit these two lines of code to somewhat more clear. – deblocker May 25 '18 at 08:22
  • 2
    Can you be clear on what exactly the errors you're seeing are? "null ref" isn't VB6 terminology. Also, can you explain what [tag:dynamics-nav] has to do with this? –  May 25 '18 at 16:57
  • @PeterCooperJr.: old versions of Dynamics-Nav (former Navision) had implemented a COM interface, maybe this question refers to a VB component for Navision. Anyway, IMHO this question is missing some relevant pieces of code, for example - just guessing for the second time - I can't understand why the GUIAllowed parameter isn't used here, if this component is installed server-side. – deblocker May 26 '18 at 21:25
  • Please add details of the specific error you are receiving. – StayOnTarget May 29 '18 at 11:19
  • Are You aware that `GUIALLOWED` is a read-only property? You can check if this component is running on the Application Server but You can't set this property. – deblocker May 31 '18 at 06:52

0 Answers0