VB Message Boxes only seen through App log, why and how to fix.

By request of a friend, I'm writing a Software Evaluation Demo Protection program in VB6 that I've compiled into a DLL.  Unfortunately, none of the message boxes show up.  Having a total brain-block and instead of pounding my head against the wall trying to figure it out, I thought I'd swallow my pride and ask the experts.

1. Why are the message boxes not showing up?
2. How do I get them to show up?

My test class looks like this

Public Sub RunDemo()
     '    modNoNoticeDemoSecurity.DemoProtection
     MsgBox "Hello World"
End Sub

Hello world shows up only in the app log and not as a message box.

Thanks all in advance
LVL 9
DougApplication Development ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
do you or the application code run the function app.startlogging:
http://www.pbdr.com/vbtips/api/NTEvtLg.htm

this would explain this behaviour, the same as if your code is run as service...
Éric MoreauSenior .Net ConsultantCommented:
Hi skipper68,

There is a property on the DLL project. Under the General tab of the project properties, "Unattended execution" is surely checked. Unselect it.

Cheers!
DougApplication Development ManagerAuthor Commented:
Sorry, it already was unselected.  
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

DougApplication Development ManagerAuthor Commented:
angelIII
It's not running anything like that.  The msgbox "Hello World" only appears in the app log not to the user.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Now, if neither the DLL nor the application (both compiled with the "unattended exection" unchecked), nor the code uses the app.startlogging, i only can imagine the following:

you have somewhere in the project a function that is also called MsgBox, which overrides the vb msgbox...
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you try, if that doesn't solve the problem, to isolate the problem:
restart with an empty project, adding more and more code, to try to find as from when the problem reoccurs.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
or also upload the project files somewhere...
DougApplication Development ManagerAuthor Commented:
I simplified the project down to 6 lines of code and still no luck.

My eval.dll project contains the following code in 1 class
     Option Explicit
     Public Sub RunDemo()
         MsgBox "Hello World"
     End Sub

I compiled the dll and add it into component services

A second project has 1 form that has the following code in it.
     Public Sub Form_Load()
         Set Eval = CreateObject("DemoSecurity.Eval")
         Eval.RunDemo
     End Sub

I run the form and no message box appears.

I'll see if I can zip the 2 projects and upload them somewhere.
Éric MoreauSenior .Net ConsultantCommented:
Instead of using CreateObject, add your DLL in references and use the New operator to create your instance
Guy Hengel [angelIII / a3]Billing EngineerCommented:
ok. I will visit my bed for the next 8 hours, and look at the question tomorrow morning again.
DougApplication Development ManagerAuthor Commented:
Éric MoreauSenior .Net ConsultantCommented:
the code of your class is not in the .zip!
Éric MoreauSenior .Net ConsultantCommented:
it is working on my PC! I see the msgbox before the forms load.
DougApplication Development ManagerAuthor Commented:
Nice.  Now why doesn't it work on my computer.  It's a pc thing?
DougApplication Development ManagerAuthor Commented:
I uploaded a different zip.  the cls file should be there now.
Éric MoreauSenior .Net ConsultantCommented:
is a msgbox into the EXE vb project working ?
DougApplication Development ManagerAuthor Commented:
Yes, I can see the boxes when I run it as an exe proj.
Éric MoreauSenior .Net ConsultantCommented:
I have no idea then. As I told, it is working correctly on my PC.
DougApplication Development ManagerAuthor Commented:
It's also working on my second pc, just not this one.  I gotta find that setting.  Any suggestions on where to move this question to since it is not a VB problem?
Mark_FreeSoftwareCommented:
if you create a new project, and then add a button with this code:

msgbox "Test"


does the messagebox pop up?
Éric MoreauSenior .Net ConsultantCommented:
>>skipper68

Is your test DLL has the same name as the one before that was not working? Try to change the name of your component and the name of your class. You may have some corruption in your registry.

>>Mark_FreeSoftware

This test as already been done with a positive result!


DougApplication Development ManagerAuthor Commented:
Mark_FreeSoftware
Yes.  It works from a regular exe project.  It just doesn't work if I put it in a dll, register the dll and run a project that calls a method in the dll.

-Skip
DougApplication Development ManagerAuthor Commented:
No dice on changing the names.

Here's what I tried.

Changed the Class Name
  Re-created the dll and ran.  No Luck

Changed the Project name
  Re-created the dll and ran.  No Luck

Changed the Method Name
  Re-created the dll and ran.  No Luck

Changed the Object Name
  Re-created the dll and ran.  No Luck


Thanks for the suggestions.
DougApplication Development ManagerAuthor Commented:
Oh, I also changed the name of the dll itself and re-created the dll and ran.  Still no Luck
DougApplication Development ManagerAuthor Commented:
Viola!

I did it using regsvr32 instead of through Component Services and it worked.  Any ideas why?  

Sooooo sorry if I didn't say that before (yes I did, it was buried in my 4:03 post).
DougApplication Development ManagerAuthor Commented:
Anyone know if there is a place that will test these kinds of programs for hack-resistence and or difficulty?   I know there is nothing hack-proof.
Éric MoreauSenior .Net ConsultantCommented:
You are using MTS/COM+ for that?!?!?!

MTS/COM+ runs in its own process and is always unattended (whatever is selected in your compilation). MTS/COM+ normally runs on an application server (and not on a client). That's why you won't see any message box out of it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark_FreeSoftwareCommented:

>>Anyone know if there is a place that will test these kinds of programs for hack-resistence and or difficulty?   I know there is nothing hack-proof.

vb is very easy to crack (hacking is attaching other comps, cracking is breaking security on a program)

smartcheck from numega intercepts all vb call's to msvbm60.dll and shows them in the app included the parameters
so make a very difficult- non lineair scheme

try to use numega smartcheck yourself, or i will do it for you if you want

also make sure you don't do this:

very cunfusing scheme like crypting/decrypting
silly compare method like if x = y then registered else not registered

i saw once a program that had an algoritm of more than 300 instructions, but to pass the check one byte needed to be modified at the comparison
that is absolute not the way to go

i hope this make sense

mark
DougApplication Development ManagerAuthor Commented:
I cannot find SmartCheck anywhere.  Any suggestions?
DougApplication Development ManagerAuthor Commented:
Mark,
P.S.  How can I have you test it?  I'd rather not open up the dll to the public yet seeing as though it hasn't been tested.
Mark_FreeSoftwareCommented:

just upload the compiled dll Somewhere with a description how to use it,
or an entire program protected with it


and since it has nothing to do with this question, i think we can continue this via email
Mark_FreeSoftwareCommented:

or even msn, xfire or somthing like that
DougApplication Development ManagerAuthor Commented:
Cool, thanks.  My email is StraighterSwing@wowway.com  
http://www30.brinkster.com/2various/demosecurity.zip

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.