|
-
Mar 26th, 2003, 03:22 PM
#1
Thread Starter
Lively Member
Debugging DLLs
I'm working on a plugin system, and I'd like to be able to debug my plugin dll's as I work on them. Problem is, to use them they have to be compiled into actvex dlls, which are then referenced and loaded at runtime by the main program.
Is there any way of pausing exection of the program to see what's going on inside the dll?
Thanks,
Az.
-
Mar 26th, 2003, 03:27 PM
#2
Fanatic Member
you can open multiple projects in your vb6 gui inside a 'project group'. open the client exe, then File -> Add Project your dll server. you will have simultaneous debugging capabilities.
there are 2 reasons why i leave my work unfinished:
(1) i'm getting old.
-
Mar 26th, 2003, 03:30 PM
#3
Thread Starter
Lively Member
Yeah I know that, but because it's loading a built dll, which is having it's references added at runtime, it won't jump back into VB to debug it.
-
Mar 26th, 2003, 05:30 PM
#4
Fanatic Member
ammm... nope. there may be no easy way to do the debugging in your case. sorry i took you for a beginner.
there are 2 reasons why i leave my work unfinished:
(1) i'm getting old.
-
Mar 26th, 2003, 06:07 PM
#5
How are you creating an instance of your plugin dll in your client?
If you are using CreateObject then this code
Dim objTemp As Object
Set objTemp = CreateObject("Plugin.Testing")
objTemp.ProcessIt
Set objTemp = Nothing
whether in a compiled app or a second instance of VB - will stop at any breakpoint and allow you to debug the Plugin dll, as long as it also is currently executing in VB. SOP.
-
Mar 27th, 2003, 03:09 AM
#6
Thread Starter
Lively Member
The problem is, the app is loading the dll by finding it on disk, rather than looking in the registry to find it, so the plugin has to be built as the dll for the main app to load it. This means that it can't be running in vb since it must be compiled and on disk.
You may be right radum, there may be no way for me to debug them like this I might have to build an extra function in my main program to load a plugin that's not been built yet (ie still in the vb environment) just to debug them.
-
Mar 27th, 2003, 05:02 AM
#7
The problem is, the app is loading the dll by finding it on disk, rather than looking in the registry to find it, so the plugin has to be built as the dll for the main app to load it. This means that it can't be running in vb since it must be compiled and on disk.
So why don't you add an extra line of code which says "if this program is being run from VB, just load the DLL without searching for it"
eg:
VB Code:
'...
If RunningInVB Then
'use "createobject" to load the DLL
Else
'search for the dll as you do already
End If
'...
Function RunningInVB() As Boolean
'Returns whether we are running in vb(true), or compiled (false)
Static counter As Variant
If IsEmpty(counter) Then
counter = 1
Debug.Assert RunningInVB() Or True
counter = counter - 1
ElseIf counter = 1 Then
counter = 0
End If
RunningInVB = counter
End Function
-
Mar 27th, 2003, 05:06 AM
#8
Thread Starter
Lively Member
That might help us to be able to write and debug our own plugins, since we can run the main app in vb, but for other people who want to write plugins for it, they'll be a bit stuck without our source code
-
Mar 27th, 2003, 05:15 AM
#9
well in that case, you could add a command line parameter for debugging, that specifies the name used for the "createobject" call.
-
Mar 27th, 2003, 05:17 AM
#10
Thread Starter
Lively Member
Originally posted by Azrael-TFX-
You may be right radum, there may be no way for me to debug them like this I might have to build an extra function in my main program to load a plugin that's not been built yet (ie still in the vb environment) just to debug them.
I already said that 
Thanks guys, think I'll try adding another function in the app
-
Mar 28th, 2003, 06:39 AM
#11
Thread Starter
Lively Member
Ok, I've added another function, and the main exe finds and loads the plugin from the vb environment, but my problem now is I'm trying to pass an object into the plugin, and getting this error:
Run-time error '98':
A property or method call cannot include a reference to a private object, either as an argument or as a return value.
What I'm trying to do works fine when I load a plugin from the dll, but it doesn't want to pass the object across from the exe to a plugin that's running in the vb environment. Is there any way to give my plugin access to this object?
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
|