LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mcscm.dll + Lib

Solved!
Go to solution

Am using mcscm.dll. It has 22 functions. The functions are defined in one library file named mcscm.lib. I just called mcscm.dll using Call Library Node to call one particular function. But what the thing is since all the functions of that dll are defined in mcscm.lib file, i can't able to get the exact output.

 

My question is how to access the .lib functions in LabVIEW. I searched the forum, but all the way it was the conclusion that we have to use LabWindows. Any alternatives to use in LabVIEW?

 

Thanks,

Mathan

0 Kudos
Message 1 of 8
(4,083 Views)

Hi, mathan,

 

You don't need to access functions in lib. Call DLL dirtectly, then you can choose desired function from the list:

 

 

Of course, you should set parameters and calling convention properly.

Andrey.

Message Edited by Andrey Dmitriev on 11-24-2008 01:10 PM
Message 2 of 8
(4,077 Views)

Hai Andrey,

 

Thanks. But am sorry, I think i was not clear in my last post. Actually i did what you said. But the thing is the CLN throws some invalid parameter error. Actually i checked all the parameters, it was correct only. Then i asked some VC++ developers regarding this error. They told in VC++ development environment, during compilation, they will include mcscm.lib so that all the functions will be called appropriately.

 

That's where my problem resides.

 

 Mathan

0 Kudos
Message 3 of 8
(4,073 Views)

Check parameters again. Also check calling convention - C or WinAPI.

If you still can't pass parameters properly, then ask C developer for development wrapper DLL for you (then lib file will be necessary for him, but not for you). With wrapper DLL  you will be sure that parameters correct (at least this can be easily checked on the wrapper side).

 

Andrey.

Message 4 of 8
(4,071 Views)

Wrapper dll? - Ok, Thanks i will ask them and i will update you tomorrow. Thanks.

 

Mathan

0 Kudos
Message 5 of 8
(4,070 Views)

Dear Andrey,

 

I asked the developers and they told there is no need for a wrapper dll and the MCSCM.dll itself will work.

 

Today morning i tried again and actually i have wrongly declared the dllversion parameter as value instead of pointer to value. Changing that gave exact output of what i want.

 

But as a next step of calling next function that is cardconnect, the most unwanted Smiley Surprised error 1097 is coming.

 

got stuck up.

0 Kudos
Message 6 of 8
(4,036 Views)
Solution
Accepted by Mathan

Dear all,

 

Its mainly due to the wrong memory referencing, this error 1097 appears in CLN. I looked at lot of threads in this forum, and many are replied by smercurio about how to eliminate this error by properly initializing the parameters and correct memory handling.

 

Thanks,

Mathan

0 Kudos
Message 7 of 8
(4,014 Views)
Hello everybody,

This is the first time that I am trying to integrate a DLL file in Labview.
Now I have a problem with the parameters of the MCardInitialize function of the DLL file: MCSCM.dll.
I dont know which kind of Datatype i should declare in the parameterlist in the "Call Library Function" for the Parameters ScardContext and szReader.

Sample Code for the Function call in C:
/ * ScardContext is the context obtained SCardEstablishContext * /
MCARDCONTEXT hMCardContext;
DWORD dwDLLVersion;
char szReader [] = "CCID SCM Microsystems Reader";
LONG lReturn;
lReturn = MCardInitialize (
ScardContext,
szReader,
& HMCardContext,
& dwDLLVersion
 
Thanks,
Manuel
0 Kudos
Message 8 of 8
(2,681 Views)