473,387 Members | 1,892 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.

Import C DLL functions into VB

Hello

I have a question and hope you might help me, I am writing a DLL for software package and I was also exporting the dll' function to a Visual Basic Application, my question is: in VB when you are import the DLL functions there is a way of doing it which is :

Code:

Private Declare Function Calculate Lib "C:\Project.dll" (ByVal c As Double, ByVal d As Long) As Double

And if you have a second function to import you have to do the same, but what about if you have like 50 functions to export, do you still write 50 lines and each time specifying the DLL path? Or there is another way where you just define the path only once,

Thanks in advance for any help
Feb 21 '08 #1
2 1362
debasisdas
8,127 Expert 4TB
1.Compile the dll
2.Copy the DLL to system32 folder.
3.Regeister with windows using REGSVR32 key.
4.Access the DLL from Vb from Project-------> References
5.Use that in VB.
Feb 22 '08 #2
Thanks Debasisdas

i did copy the dll in the System32 folder and when i want to register with REGSVR32 key

eg: c:\>regsvr32 myProject.dll

this error msg occurs

" The module ""myProject.dll"" was loaded but the entry-point DllUnregisterServer was not found.
Make sure that ""myProject.dll"" is a valid DLL or OCX file and then try again

Thanks for you help
Feb 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Matthew Wilson | last post by:
Hi- I'm writing a bunch of classes, several of which need functions and variables defined in the math module. In some instances, I'm going to import my module like this: import myshapes ...
2
by: Aahz | last post by:
There were some posts recently discussing whether it's poor style to put import statements inside functions. I recently got reminded that there's one very good reason to avoid it: Python has an...
1
by: Andrew James | last post by:
All, I'm having some trouble with understanding python's importing behaviour in my application. I'm using psyco to optimise part of my code, but I'm not sure whether it inherits throughout the...
4
by: MackS | last post by:
Hi I'm new to Python, I've read the FAQ but still can't get the following simple example working: # file main_mod.py: global_string = 'abc' def main():
2
by: Tian | last post by:
I am writing a python program which needs to support some plug-ins. I have an XML file storing some dynamic structures. XML file records some class names whose instance needs to be created in the...
3
by: Mudcat | last post by:
I have a directory structure that contains different modules that run depending on what the user selects. They are identical in name and structure, but what varies is the content of the functions....
3
by: yinglcs | last post by:
Hi, i have 2 python files in *different directory* , how can I import python functions from 1 python file to another? i get this error: import task ImportError: No module named task/ Thank...
4
by: Brian Blais | last post by:
Hello, I am trying to organize some of my code, and am having a little trouble with the import logic. I find I often have something like: MyPackage/ Part1/ # wants to use functions in...
4
by: ahagley | last post by:
The problem: 1) I'm not a programmer, most of the time I'm a physicist, but I do numerical simulation. 2) I have a DLL that I want to use functions from. I have the .h file associated with the...
4
by: bvdp | last post by:
Terry Reedy wrote: <snip> <snip> <snip>
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.