Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a DLL

Status
Not open for further replies.

psandekian

Programmer
Oct 12, 2000
48
US
Hi. I've got a project that I have referencing a file called "nsm.dll". My problem is that I've had to make changes to this file so I renamed it to something else for a backup. Now my VB project references this renamed file. I cannot get it back to the original name or to reference the new "nsm.dll". Can anyone help?

Thanks.
Patty
 
I think all you have to do is go to the directory where your renamed file is and from dos prompt type

regsvr32 -u newname.dll
then rename it back to nsm.dll or whatever....

then type

regsvr32 nsm.dll

this will deregister the first dll, when deregistered it will not follow the rename. Once all is right and yor reregister it should work.
 
I ran regsvr32 -u nsm.dll.pjs and I got:

nsm.dll.pjs was loaded, but the DllUnregisterServer entry point was not found. nsm.dll.pjs does not appear to be a .DLL or .OCX file.

I ran regsvr32 nsm.dll and I got:

nsm.dll was loaded, but the DllRegisterServer entry point was not found. DllRegisterServer may not be exported, or a corrupt version of nsm.dll may be in memory. Consider using PView to detect and remove it.

What I did to get to this point was just add my initials to the file name in Explorer. Is there something else I should have done? My VB project still has the wrong file referenced.

Thanks.
Patty
 

If all else fails, open the VB project file in Notepad and remove the reference line. Once you get the name straightened out in the file system and in the registry, you can re-add it.

Chip H.
 
help, I use VB program to print my report in win2000 system but it too slow compare with win98 system.
 
you probably cant unregister the dll as the regsvr32 file isn't recognising the .pjs extension?

also, if you can remove the remove the reference in the vb project within the IDE rather than directly (dangerously) amending the project files directly:
select Project> References and remove the reference to the OLD dll.
select Browse and browse to the new reference, selecting it.
what you may notice is that the list of references contains a reference (with the same description) to both programs - simply ensure you check the path property to ensure you are referencing the correct one.

hope this helps a little.
m
Mark Saunders
:)
 
Mark,

I have removed the reference and then browsed to select the other one. It doesn't accept it. When I click on it, it goes back to the other window but doesn't have it selected. I've also tried removing the reference, saving and closing the project, renaming the dll file back to it's original name, opening the project. When I open the referencing dialog it shows the old filename and it's missing. When I browse and select the nsm.dll, it just goes back to the other window with nothing new selected.

Maybe I'm going the wrong way with this. In VB, when you first set a reference, it "sets" this file to the reference "title". Is there a way to remove one from the list? Or is this set in NT's registry?

Thanks.
Patty
 
wow!

the only workaround i think i would do is:

recomple the DLL with a new name,
save the (component) project,
select Project> Properties> Component [tab] and choose the Binary Compatibility then Browse to the newly created component.
Recompile. Save.

load the project that wishes to reference the component. Remove reference to old DLL.
Browse to new DLL (should actually be in list under the new description) and hey ditto.

This work around worked for me (albeit for a slightly different problem) because the IDE sees the component as a new one and nothing to do with the old (unreferenced) dll.
cheers
m
Mark Saunders
:)
 
I wish I could but we have at least 20 other projects using the same dll and I don't want to have a couple different versions floating around and I don't want to change all of the projects. I'll keep playing with it and if I find something, I'll post it.

Thanks.
Patty
 
I finally got it fixed. I went into Notepad and saw the reference had a specific registry key. I then went into the registry and did a search for that key. I saw that the directory and file were wrong. It had: C:\DAQ_DI~\Library\NSMD~.PJS. I first backed it up just in case then I changed it to the correct directory and filename. This worked. My VB project know sees the right file.

Thanks for all of the suggestions!
Patty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top