Link to home
Start Free TrialLog in
Avatar of Praveen Kumar
Praveen KumarFlag for India

asked on

VB6 App Strange Behavior

hi,
It is a small MDI application, with 10 forms. Its uses one third party COM component. Entirely Developed in VB6 SP6.
Development System o/s is Windows 2000 server, Deployed to Win XP Home Sp2.

In the application i want to prevent multiple instance. so i used below code.

in the Form_Load

  If App.PrevInstance = True Then
     MsgBox("Application running already")
     End  'Tried Unload Me also
  End If

Now, when i tested in my Deleloment system, first instance everything is OK, but for second instance i am getting the message box saying that "Application running already", but still application is opened. And the second application is not producing any menu events.

When i tested in Win XP system, Application is not visible for first instance. In the task manager it is showing that application is running. If i try to open second instance, the message box "Application running already" came, but still second application is opened. As usual no events are firing in this application.
One more strange is that, first instance is taking 98% CPU resources in Win XP system (where it was 1 or 2 in Developed system)

Where is the problem? Application is running smoothly from Visual Studio 6 (SP6)

 

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

If App.PrevInstance = True Then
     MsgBox("Application running already")
     unload me
     exit
  End If
Avatar of Praveen Kumar

ASKER

angel,
i assume that,it is End instead of exit.
But the problem is same.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
angel,
It is now working Sub Main. May be problem with my component, where i instanciating that object in MDI load.
thank you very much.

But did u have any answer for my other problems, which i described in main post?
what is the third-party component? has it to do with the menues?

you might try to locate the issue in your project, by either removing parts until the application works as requested (on a copy of the project, of course), or by creating a new project from scratch, adding things until the problem occurs.
That component is for implementing SMPP (www.easycomponents.com), i dont have any complaints on the component since it is working properly from past 3 years.
Every thing is fine when i debug from IDE, problem coming on deployed system(Win XP)