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

How To Export Functions Present in a ActiveX Dll

How To Export Functions Present in a ActiveX Dll?

So that i can use that vb dlll from any application.........
Nov 14 '07 #1
16 6193
QVeen72
1,445 Expert 1GB
Hi,

You cannot Export Functions, It is embedded/hidden in the DLL.
Add that .dll Reference to your VB Project.
Declare Variables of the .dll objects. and use the Functions..


Regards
Veena
Nov 14 '07 #2
AHMEDYO
112 100+
hi

VC++ only can do that, u can create dll and use it as windows API, in VB6 u just can create COM Classes, but u can create new class and set instancing property to GlobalMultiuse and then add this dll to ur project rerefnce and call function direct as visual basic standard libraries
Nov 15 '07 #3
hi

VC++ only can do that, u can create dll and use it as windows API, in VB6 u just can create COM Classes, but u can create new class and set instancing property to GlobalMultiuse and then add this dll to ur project rerefnce and call function direct as visual basic standard libraries
Hi
I am accepting , but once if i create a dll using vc++6.0 with export options...
Can i use that dll dynamically in vb6.0? If so tell me how it can be done?

waiting for reply...
Nov 15 '07 #4
Hi,

You cannot Export Functions, It is embedded/hidden in the DLL.
Add that .dll Reference to your VB Project.
Declare Variables of the .dll objects. and use the Functions..


Regards
Veena
Hi
I want to use that dll dynamically..
Is there any functions similar to CreateObject(used in creating object for activex dll) . For me the dll is Win32 dll.........
Nov 15 '07 #5
debasisdas
8,127 Expert 4TB
Yes DLL files compiled in most of the languages can be called from any other languages.
Nov 15 '07 #6
AHMEDYO
112 100+
look man u have two types of Dlls, COM and u can use it by CreateObject method and the other type just u can imagine it as External Module have public function as Windows API, this type u cant export from VB6, if u can work with VC++ its simple to do that , by Declare ur functions with __declspec(dllexport) keywords and then declare this function then in ur vb6 project

example VC++ Dll File Name "MyDll.dll"

DWORD __declspec(dllexport) TestFunction(LPSTR Data);

then in VB6

Declare Function TestFunction lib "MyDll.dll" (byval Str as String)as Long

Private sub Form_Load()
Dim x as long
x=TestFunction("Text")
End Sub

and u can use another way and ignore that u declare it as above

u can use dll with ur code by LoadLibrary() & GetProcAddress API Functions but it will let u to work more to call any function and u will care about stack
Nov 15 '07 #7
Declare Function TestFunction lib "MyDll.dll" (byval Str as String)as Long

The method above is static linking , but i need to link dynamically...

It can be done through LoadLibrary and GetProcAddres and some memory related API such as CopyMemory, Heap...

But What i want to know is... Is there any other easy method available in VB6 to do this work?
Nov 16 '07 #8
AHMEDYO
112 100+
Declare Function TestFunction lib "MyDll.dll" (byval Str as String)as Long

The method above is static linking , but i need to link dynamically...

It can be done through LoadLibrary and GetProcAddres and some memory related API such as CopyMemory, Heap...

But What i want to know is... Is there any other easy method available in VB6 to do this work?
Hi..

i think there is no other way from VB to do that , and i think only visual C++ support simple method than visual basic because you can define functions take list of arguments with VC++ with "typedef" keyword & ... 3 dots to define arguments list, you can use API call only as LoadLibrary and GetProcAddress & "CallWindowsproc" from VB to call your dll functions

but visual basic have one thing that you can care about, CallByName Function

Expand|Select|Wrap|Line Numbers
  1. CallByName(Object as Object,Procname as String,Calltype as VbCallType,Args() as Variant)
but you must call function from object variable, you must define your functions within COM Class, thats mean you will static link your Dll or you can use createobject() function to dynamically create your object and dynamically call object functions by CallByName

Good Luck
Nov 16 '07 #9
Hi..

i think there is no other way from VB to do that , and i think only visual C++ support simple method than visual basic because you can define functions take list of arguments with VC++ with "typedef" keyword & ... 3 dots to define arguments list, you can use API call only as LoadLibrary and GetProcAddress & "CallWindowsproc" from VB to call your dll functions

but visual basic have one thing that you can care about, CallByName Function

Expand|Select|Wrap|Line Numbers
  1. CallByName(Object as Object,Procname as String,Calltype as VbCallType,Args() as Variant)
but you must call function from object variable, you must define your functions within COM Class, thats mean you will static link your Dll or you can use createobject() function to dynamically create your object and dynamically call object functions by CallByName

Good Luck
Understand my problem clearly... I am having several application both in vb and vc... and i want to use a single dll which will get shared by all applications both vb and vc........
Nov 16 '07 #10
AHMEDYO
112 100+
Understand my problem clearly... I am having several application both in vb and vc... and i want to use a single dll which will get shared by all applications both vb and vc........
i understand your problem man, if you will create COM class you can call your function dynamically from VB by CallByName and you can call it dynamically too from VC++ by allocation your function address from function address pointers table using COM API functions, but its not just one function call as VB CallByname function

this link will help you with VC++

http://msdn2.microsoft.com/en-us/library/ms680586.aspx
Nov 16 '07 #11
i understand your problem man, if you will create COM class you can call your function dynamically from VB by CallByName and you can call it dynamically too from VC++ by allocation your function address from function address pointers table using COM API functions, but its not just one function call as VB CallByname function

this link will help you with VC++

http://msdn2.microsoft.com/en-us/library/ms680586.aspx

Do you have any samples? If so tell me... Thanks in Advance..
Nov 16 '07 #12
Can we use CoGetClassObject to create the Object for activeX dll.
Nov 22 '07 #13
Hi,

You cannot Export Functions, It is embedded/hidden in the DLL.
Add that .dll Reference to your VB Project.
Declare Variables of the .dll objects. and use the Functions..


Regards
Veena
Can we use CoGetClassObject to get the object of the class?
Nov 22 '07 #14
QVeen72
1,445 Expert 1GB
Hi,

After adding that dll in your new VB Project,
Use "Object Browser" to view all the Properties/Classes /Procedures of that dll..

Regards
Veena
Nov 22 '07 #15
Hi,

After adding that dll in your new VB Project,
Use "Object Browser" to view all the Properties/Classes /Procedures of that dll..

Regards
Veena

Hi
I need to use that dll dynamically...
ie , by using LoadLibrary or by using CoGetClassObject.... Do you know how to use this functions in order to use the functions present in the VB ActiveXDll

Thanks in advance........
Nov 23 '07 #16
QVeen72
1,445 Expert 1GB
Hi,

Include the dll in your project.

To Declare the Class :
Dim TObj As New OldDLLName.ClassName

To Call a Function or Procedure in that dll:
TObj.ProcName

Once you decalre that Class, you will get "IntelliSense" Immediately after typing "TObj."

Regards
Veena
Nov 23 '07 #17

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

Similar topics

1
by: news.videotron.ca | last post by:
Hi, like topic says! I have functions that I want to export from a BSD static c/c++ library (done under Mac OS X) but I don't know what has to be done to export functions. Could someone point me...
3
by: Ricky | last post by:
Hi Can anyone explain what are the relationship between COM , ActiveX, DLL ? I really get confused about the terms... Ricky
4
by: Rohith | last post by:
I need to import dlls that are present in the remote machine. Its a dll written in C that exposes methods. I want to import that dll in my C# application. But that dll is not present in the local...
1
by: foneman | last post by:
I wrote and compiled a dll without error. When running the app that calls my dll, I get "Missing required export functions at <filepath to my dll> The dll was created with Visual C++ .Net...
1
by: Dirk Reske | last post by:
Hello, I try to write a managed c++ dll that exports some functions that should be called by a c++ app. in this functions i will call a function in a c# dll int...
0
by: victorsk | last post by:
Hello, I need to write a DLL app in VB whose functions would be called by another app. VB's DLL's don't support exporting functions. However, I found a site that provides a way to export VB...
2
by: flyingxu | last post by:
Hi, I run into a cstring related link problem in VC7. My solution has 3 projects, one MFC exe, two MFC extersion DLL. the two MFC extersion DLL export functions which use CString as parameters....
2
by: rych | last post by:
I'm on Windows with VS2005 testing ctypes on a very simple dll I create a test.dll project which exports a function fntest(). I don't touch anything in the autogenerated source and build it. I can...
0
by: tzahi | last post by:
hi i have .NET dll file i can load this dll to vs c++ 2008
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.