AnsweredAssumed Answered

vrf char type within struct//linking dll

Question asked by VRFuser on Sep 5, 2007
Thanks Shaun,
 
This gives me a good start toward what I have to learn.
 
Steve
 
----- Original Message -----

From: HYPERLINK "mailto:shaun.harwood@siemens.com"Harwood, Shaun
To: HYPERLINK "mailto:vrf@agilent.com"VRF
Sent: Wednesday, September 05, 2007 1:02 PM
Subject: RE: [vrf] char type within struct//linking dll

Hello Steve
 
As I understand it - and I hope someone will correct me if I'm wrong - VEE will only accept char*, short, long, float and double.
 
char*   -   text
short   -   Int16 
long    -   Int32
float    -   Real32
double -   Real64
 
I'm assuming you would have some kind of documentation with the .dll - this would normally provide function listings and prototype - and the prototypes are the key.  By examining the variables being passed to the function you can figure out the 'vee specific' prototype you need to define in your .h file.  I don't think you need to know much about vb - but you never know.
 
As an example - if the function was to add two numbers - a and b.  The dll might have a prototype like
 
'int add_two_numbers(int a, int b)'.
 
vee would need
 
short add_two_numbers(short a, short b);
 
You can also pass variables by reference - 
 
short some_function(long* variable); 
 
Your userobject 'some_function' in vee will have an input called 'variable', into which you can plug an empty int32 constant -  the function will fill the variable and spit it out the other side - this works well for returning more than one value from a function.  VEE imports a .dll with the Device->import library menu command.  you set the option to compiled function - point to the .dll and your nice new .h file and away you go.
 
Theres some great info in the Advanced VEE Pro book - theres also I believe an example 'manual49.dll' and 'manual49.h' - to which the book refers in the ~installdirexamplesManual  directory.  If you get stuck or have any further questions - and this is by no means straight forward if you've not done it before - give me a should - I'd be happy to help if i can.
 
all the best
 
Shaun H




 




---
You are currently subscribed to vrf as: ming_meng@agilent.com
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".  

Outcomes