Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help adding .dll file to MS access

Posted on 2011-02-18
11
Medium Priority
?
574 Views
Last Modified: 2012-05-11
Hi,

I was wondering if someone can help.
I have created a custom .dll file for an application using visual studio 2008 and am trying to add this into a Microsoft access project.

The version of access is 2003. I have tried going to the code window clicking on tools-->references and browsing to the .dll file.
I then receive the following message “Can’t add reference to the specified file”  

All of these .dll files add fine to visual studio but I need to be able to use this in a Microsoft access application. Any help would be appreciated.

Regards,

Ross

Screens.docx
0
Comment
Question by:ross13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 58
ID: 34928163
Ross,

  I've never written a .DLL for Access, but I know that some need to be registered with Regsrv32 before they can be used.  Only a native .DLL can be used without registering.

JimD.

0
 
LVL 75
ID: 34928213
"Only a native .DLL can be used without registering."
Not sure what you mean by 'native', but the Lebans Mousewheel Hook DLL for example does not need to be registered, as well as a couple of others.

mx
0
 
LVL 58
ID: 34928264

  It's may understanding that "native" means that its been compiled for use with a specific chip. I've heard other definitions as well, but that seems to be the main one.  Since I've only written one DLL in my life, I don't claim to be an Expert.  All I know is that there is a difference.

  Some need to be registered and some do not.  As you pointed out, Leban's mousehook DLL does not, while vbSendMail.DLL does.

JimD.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 58
ID: 34928306

  Actually, I think in terms of DLL's, it has something to do with the interface that it presents and how that gets exposed to the calling program.

JimD.
0
 
LVL 75
ID: 34928321
" ....and how that gets exposed to the calling program."
Yes ... that sounds more like what the issue might be ...

mx
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 34928731
You need to create type library and add the type library as a reference

Project Properties > Compile Tab > Register for COM interop

OR

Type Library Exporter (Tlbexp.exe)
http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 2000 total points
ID: 34928764
My bad wrong reference should be:

Assembly Registration Tool (Regasm.exe)
http://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.71).aspx
0
 

Author Comment

by:ross13
ID: 34932898
I received the following message after i tried that.

Warning      2      "C:\Documents and Settings\RRobertson\My Documents\Visual Studio 2008\Projects\fsc_runningTotal\fsc_runningTotal\bin\Release\fsc_runningTotal.dll" does not contain any types that can be registered for COM Interop.      fsc_runningTotal
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 2000 total points
ID: 34932939
Did you mark it as COM Visible? Projects properties > Application Tab > Assembly Information button > select "Make assesmbly COM visible"
0
 

Author Comment

by:ross13
ID: 34933408
Yeah.
I tried a build --> rebuild and i get the warning message reported above.
If i just hit build the warning goes away.
I tried going into the access application after doing this in visual studio and browsing and selecting the .dll and i still get the error message “Can’t add reference to the specified file”  
0
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 2000 total points
ID: 34933559
You don't select the DLL you have to add the .TLB file as the reference. The DLL is a NET assembly not a COM object ;)

Look in your Bin folder for the .tlb file
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question