|
-
Nov 5th, 2001, 04:11 PM
#1
Thread Starter
Frenzied Member
Sub in DLL question
Am i not allowed to do this in a DLL? (following code is in the Class Module)
Code:
Public Sub BusyProgram(cmdButton As Object, Optional bNotBusy As Boolean)
'.... code here
End Sub
Can a sub have parameters passed in? If i remove them, it works fine. If i make it into a Property Get (aka Function) it works with the parameters.
I just want the DLL to perform a task. I don't need a value passed back.
~Peter

-
Nov 5th, 2001, 04:56 PM
#2
Hmmm thats wierd you should be able to do that just fine.
-
Nov 5th, 2001, 04:59 PM
#3
Thread Starter
Frenzied Member
That's what i thought.
Anyone have a code snipet of something they did? I'll paste in and try it.
~Peter

-
Nov 5th, 2001, 05:09 PM
#4
-
Nov 5th, 2001, 11:44 PM
#5
Thread Starter
Frenzied Member
I will test it and respond tomorrow morning. Thanks!
~Peter

-
Nov 6th, 2001, 11:19 AM
#6
Thread Starter
Frenzied Member
It works now that i call the sub using your method. I'm unsure as to why i need to do it without brackets, but i'm happy it works.
For anyone reading this, you need to call the sub like so: xCC.MySub myVariable, myVariable2
So any ideas on why " Screen.MousePointer = 11 " does not work from inside the DLL ?? Perhaps because it doesn't know which form/program to apply the busy icon to??
~Peter

-
Nov 6th, 2001, 01:01 PM
#7
Hmmm maybe there is some form of problem with your installation of VB or a Serivce Pack issue. I can call Screen.MousePointer from inside the dll.
I changed the sample I used to this:
VB Code:
Public Sub ThisShouldWork(MyObj As Object, Optional MyBol As Boolean)
Screen.MousePointer = vbHourglass
MsgBox MyObj.Caption, , MyBol
Screen.MousePointer = vbDefault
End Sub
And everything worked fine. The only difference is I used the vb const vbHourglass instead of the actually number 11.
Any other DLL oddites you are having?
-
Nov 6th, 2001, 01:03 PM
#8
Also in regard to the bracket issue, since its not returning anything I don't use them or at least not without the accompanying CALL statement.
Here would be the calling statement using brackets:
VB Code:
Private Sub Command1_Click()
Dim Test As New SubTest
Call Test.ThisShouldWork(Command1, False)
End Sub
-
Nov 6th, 2001, 04:04 PM
#9
Thread Starter
Frenzied Member
I altered it to have vbHourglass instead of 11, but it still doesn't work. Very strange. It doesn't make any sense Edneeis.
I'm not having any other DLL related errors. I agree, it should work!
~Peter

-
Nov 6th, 2001, 04:17 PM
#10
To add to the strangeness we are running the same version and service pack of both vb and our os.
-
Nov 6th, 2001, 04:41 PM
#11
MrGTI - I think you just entered dll h e l l. I just visited there a few months ago. I don't recommend it.
Some installers are 'stupid' and overwrite more recent versions of dll's. The files clobbered include what VB uses. Especially if it's a homegrown installer, problems will abound.
Try START >Accessories > System Tools >System Information
Then run Tools > System File Checker - check for file corruption
Next, try Tools > Version Conflict Manager - look for active files that are earlier version numbers than the 'old' file. It's quite common to find 8-10 of these when things aren't quite right
Finally try a VB re-install.
-
Nov 7th, 2001, 12:54 PM
#12
Thread Starter
Frenzied Member
Hmmmm. It appears that i don't have a "System File Checker " under that Tools menu. I'm running Win2K Pro, not Server.
~Peter

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|