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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Reference to Obj Library

Status
Not open for further replies.

siebel2002

Programmer
Oct 8, 2001
102
US
Hi :

I am trying to add a reference to the file psapi.dll to visual basic. Apparently this cant be done!
I get the following explanation when I hit F1:

"You tried to use the Add References dialog box to add a reference to a type library or object library that can't be used by Visual Basic.
Check the documentation for the object represented by the library to see if it's available in some other form that Visual Basic can use."

I would appreciate any help in resolving this problem.

Thanks

Ven


 
At a guess this is probably a C/C++ Dll which can't be used by VB because it doesn't contain a type library that VB recognizes.

Codefish

 
Thx for ur feedback. Is there a workaround that u know of?
 
I've worked with C/C++ DLL's before where you couldn't reference them, but you could call their functions using the Declare Statement in VB (see MSDN for documentation):-

[Public | Private] Declare Function name Lib "libname" [Alias "aliasname"] [([arglist])] [As type]

and/
I have also worked with 3rd party dll's which we couldn't reference but they had a *.tlb file instead which was able to be referenced instead by VB and provided the functionality that the dll had.

Codefish
 
Hi:
Thanks for ur prompt response.

I had already done what you suggested, but i got the error message

File Not Found: psapi.dll

The plot thickens!

Regards.

Ven
 
Hi Neil:

I suppose psapi.dll is registered. It shows up in C:\System\windows when I click the browse button while in Available References box.

Any ideas?

Thx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top