473,387 Members | 1,365 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,387 software developers and data experts.

Using VB4 APIs in VB.NET ?

Hi,

I have an API (DLL) file that was developed in VB4 or VB5, and I have its
old poor documentation (before the .NET era). I'm unable to import and use
this old DLL file in the VB.NET!

I tried to "Add Reference" in the VS.NET IDE but it said the DLL is not a
valid assembly or COM component.

An example from the document is:
'------------------------------------------------------------
Private Declare Function attach Lib ".\vc_dll.dll" (ByVal gdt_host_id As
Byte, ByVal pwd_string As String) As Long
'------------------------------------------------------------

I tried the following code in VB.NET:
'------------------------------------------------------------
Declare Auto Function attach Lib "C:\vc_dll.dll" (ByVal host_id As Byte,
ByVal pwd_string As String) As Integer

Sub test()
MsgBox(attach(1,0))
End Sub
'------------------------------------------------------------

And I got an error saying: "Unable to find an entry point named attach in
DLL C:\vc_dll.dll"

Can someone tell me how I can use this DLL in my VB.NET program?
Nov 21 '05 #1
1 986
"Amjad" <Am***@discussions.microsoft.com> schrieb:
I have an API (DLL) file that was developed in VB4 or VB5, and I have its
old poor documentation (before the .NET era). I'm unable to import and use
this old DLL file in the VB.NET!


Well, it is important to know if the DLL is a 32-bit DLL or a 16-bit-DLL.
If the DLL was created using VB4-32 or VB5 it should be possible add a
reference to the DLL.

It's very unlikely that 'DllImport' or 'Declare' work because VB DLLs
typically do not export a function-based API.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

8
by: wenmang | last post by:
Hi, We have the 3rd party libraries written in C. And, in every header file from 3rd party, it has the include guarde: #ifdef __cplusplus #define extern "C" { : APIs... : } #endif
4
by: G. Richard Bellamy | last post by:
I'm trying to unset the Encrypted attribute on all the files in a path. The attribute is not getting set. What am I doing wrong? Perhaps there's another newsgroup I can send this to? Here's...
2
by: Tanuki | last post by:
Hi All: I am doing some development in VC++ using some llibraries downloaded from the web. The library comes in 3 files <mylib.dll>, <mylib.lib>, <mylib.exp> and I also have <mylib.h>. As...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
22
by: MLH | last post by:
I have some audio help files that play fine from within Access 97 and Access 2.0. Both are running on a Windows XP box. But I do not know what program plays the files. If I click Start, Run and...
1
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using...
7
by: William Stacey | last post by:
How would you use iphlpapi.lib (from the platform sdk) from a c# app? I can use iphlpapi.dll on w23 and xp, but seem to need this "lib" from w2k. If need to wrap in c++ dll, please poing to...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
9
by: Martin Ortiz | last post by:
I want to use the Win32 API function : SendMessageToDescendants I want to use it in a VB.Net app, but I have a few questions..... 1) Can one use Win32 API functions in VB.Net 2) Is doing so a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.