CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    please help, dll problem

    I modified my dll program to replace the old one. When I run my calling program, the old dll was called. I have replaced the dll in directory system32 and calling program's directory, how can I checked which dll program is called actually or how can I update the dll program?

    How can I debug a dll program in VB?

    Thanks.



  2. #2
    Join Date
    Jan 2000
    Posts
    9

    Re: please help, dll problem

    Just replacing the DLL will not help. You have to unregister the old DLL and re-register the new one. From what you said, it is not clear whether you created the DLL or you are using some system DLL.


  3. #3
    Guest

    Re: please help, dll problem

    Thanks nsundara,

    I'm modifying an existing DLL program. Which registry key store the VB DLL information? Is there any way to debug VB DLL program like VC++?


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: please help, dll problem

    Is the dll written in VB or VC?
    SOme how it gives me the impression that the dll you are refering to is written in VC.
    If it is a VC dll, and the calling program is VB then 1. Make the exe of the vb program.
    and 2. open the dll source in VC and 3. specify the program to use for debug as this VB program. ie press F5 and it will automatically ask you for the program, click browse and select the calling exe.

    If the dll is written in VB, then it is actually an active-x dll. If you know the Class name then to know where it is getting called from - quite a few methods.
    1. Run "Regedit" . Press Cntrl+F (search) and enter the Class name. It should hit the class name in the Hkey_classes_root\CLSID section, look in InprocServer key, which tells you from where the server for this class would run.
    2. OPen VB. goto project - references
    if the class is already registered, then it should be visible in the list of servers available. How ever VB will show a description and not the class name. If you hilite any of them, the path would be shown below.
    3. Other method is to use the OLe-viewer that comes with VC.

    To debug a VB dll, you should run two instances of VB . in one open the dll project and in the other open the client project, and in the client, from "project - refereces" you need to select the .vbp file of the dll etc. At times you may see both the .vbp and the .dll as servers for the same class.
    Better look into MSDN in "Debugging Activex dlls" section, how to do this correctly.

    You can put break points in the dll and all that. it works fine..

    RK

  5. #5
    Join Date
    Feb 2000
    Posts
    137

    Re: please help, dll problem

    Hold it! Before editing your registry - When you recompile an activex dll in vb a new classid and registry entry is created in the registry - all that you need to do is (from your calling program) change the reference to the new dll. Goto the menu item Project/References when the dialog comes up, unselect the old reference (VB sometimes realizes that it is gone and marks it MISSING) go down the list and check the new reference.

    To debug an activex dll in VB - load the dll project into VB and hit <ctrl>F5 - this will start the dll running. Then start a new instance of VB load the calling program. Make sure that your reference is correct (it will need to be updated - see above - if you have recompiled the dll) then enter debug mode from the calling program. When you step to the line in the calling program that calls the dll VB will switch to the dll code listing and allow you to step through it as well.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured