Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Calling functions that are in a class based DLL (MFC extention DLL)"

76 views
Skip to first unread message

satish

unread,
May 7, 2001, 10:24:21 PM5/7/01
to
"Calling functions that are in a class based DLL (MFC extention DLL)"

"Calling functions that are in a class based DLL (MFC extention DLL)

I have a DLL written in VC++ using MFC exteintion DLL.


The functions are used to extract information from a hardware card.


eg.:


class AFX_EXT_CLASS WSDevice : public cAsyncSocket


This is a class in a DLL. There are a number of functions in this DLL
that we need to call from Labview 5.0


How do we call these functions?


Normally (in VC++ /C++) we ceate a instance of this class like
WSDeviceObj and use the function call :


WSDeviceObj.fucntion name


Kindly Help.


Satish Narayana"

ag

unread,
May 7, 2001, 11:24:59 PM5/7/01
to

"satish" <x...@no.email> wrote in message
news:506500000008000000B...@quiq.com...

Use the "call library" vi from the advanced menu. Right click on the vi
and select configure to enter the information about the dll and the function
you want to call.


Henrik Skupin

unread,
May 8, 2001, 5:30:08 AM5/8/01
to
Therefor you have to write a wrapper DLL, cause you are not able to call
the functions of you class without creating any instances.

Inside the Wrapper DLL you load the exported class library and insert an
instance. Then add all needed functions and export them, i.e:

#ifdef __cplusplus
}
#endif

__export void Open( ...);
__export void Close( ...);
__export void Read( ...);
...

#ifdef __cplusplus
}
#endif

Inside this new functions you can use the created instance of your class
with it's member functions.

good luck
Henrik

Joe Guo

unread,
May 8, 2001, 1:30:03 PM5/8/01
to
I don't think LV call library function can be used directly. One way
you can do is using CIN node. Then the question will be: how to call
a C++ class DLL using C? This question can be answered in newsgroups
comp.lang.c or comp.lang.cpp.

Joe

Enrique

unread,
May 9, 2001, 10:28:59 AM5/9/01
to
You can create a wrapper dll from which you can call your dlls
functions.

Guidelines on how to create a dll that can communicate with LabVIEW
are provided in the document "Using External Code in LabVIEW", which
should be included with LabVIEW. You can download the document also
from www.ni.com at:

http://digital.ni.com/manuals.nsf/web_productcurrent/4F1447F7CD83D6D88625690D00637CED?OpenDocument

Regards;
Vargas

0 new messages