473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to access unmanaged DLL from within ASP.NET (using VB.NET)

(This is a continuation of my post from earlier today.)

I have been semi-successful by using the good old DECLARE FUNCTION like
this:
Declare Function OpenCD Lib "functions.dll" Alias "COpenCD" (ByVal
DiscNumber As Long, ByVal DiscPath As String) As Long

However, when I make the call to the function within the DLL I get:

"Object reference not set to an instance of an object."

Do I somehow have to instantiate the DLL???

====================================

I have also tried to use the DllImport statement like this:

<DllImport("functions.dll", EntryPoint:="OpenCD", SetLastError:=True,
CharSet:=CharSet.Unicode, ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function COpenCD(ByVal DiscNumber As Long, ByVal DiscPath As
String) As Long

' Leave function empty - DLLImport attribute forwards calls to OpenCD to

' OpenCD in functions.dll.

End Function
....but when I use it, I get:

"Unable to find an entry point named OpenCD in DLL functions.dll."

How can I access an unmanaged DLL from within ASP.NET?
Please help!

Thanks,

Sacha
Nov 17 '05 #1
0 2733

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave Griffin | last post by:
This is a followup to my question in doing unmanaged DLLs in .NET. I was able to create the DLL and the application was able to see it. So far so good. Now I need to make that unmanaged DLL read an...
6
by: _BNC | last post by:
Here's the breakdown: I have an old C DLL that I want to access via C#. I'm doing this via an outer DLL that wraps the old C DLL in an unmanaged C++ class, which is in turn wrapped in a...
0
by: Frank Lopez | last post by:
My program structure is: 1. 2. 3. => manually does the crt-init and crt-terminate calls 4. -- this is accessed by the unmanaged C++ classes in (3) using LoadLibrary and FreeLibrary
4
by: repstat | last post by:
Hi I have a project which is going to be doing some string manipulation which needs to be pretty fast. The user interface is going to be written in C#. I am going to write the string handling...
1
by: Sparhawk | last post by:
Hi, my company is going to migrate a large VC++ application to .NET to make use of Windows Forms (the old class library is not updated any more). We are not planning to migrate the rest of the...
6
by: marek | last post by:
Hello All, we are doing a quite a big project that contains at the lowest level an unmenaged c++ classes. Above it there are managed wrappers and at the top there are ASP.NET pages. Can anyone...
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
3
by: Michael | last post by:
Newbie question I am trying to access external code from within VB using DLLimport in the form below where testsub is the procedure name within the DLL <DllImport("MyDll.dll",...
1
by: ropo | last post by:
I am using .NET 2.0 I have a C#.Net App, which uses a .NET Class Library, which accesses a COM object through interop. The C#.Net App also uses a mixed mode C++.Net Class library which uses an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.