EXTPROC DLL function "unsigned long" (DWORD) problem.

Hi all!
I'd like to pass a value to a function inside a DLL. The DLL parameter is a DWORD,
I've specified the LIBRARY parameter as UB4 and the FUNCTION parameter is BINARY_INTEGER.
This works pretty well until the value is larger than 2147483647 . This is (of course) beyond
the limit of BINARY_INTEGER and PLS_INTEGER.
BUT --- ext proc only can be mapped like this
BINARY_INTEGER
BOOLEAN
PLS_INTEGER
------------>
[UNSIGNED] CHAR
[UNSIGNED] SHORT
[UNSIGNED] INT
[UNSIGNED] LONG
SB1, SB2, SB4
UB1, UB2, UB4
SIZE_T
So .. how can I pass a "real" unsinged integer to an external
function, which allows a range up to 2^32-1 == 4294967295 ??
Any hints? Thanks in advance!!
No, I do not want to create a wrapper DLL :-)

Hi!
I am also in need of the solution to this, but could not get it right yet!
Would you perhaps share your current solution (writing the wrapper) with me?....
I will keep you posted if I find a way of using ora_ffi with a C Struct
Bye!

Similar Messages

  • Extproc: DLL function requires struct pointer, howto ?

    Hi there !
    Does anybody know if and how it's possible to pass
    a struct pointer like
    typedef struct _NETRESOURCE {
    DWORD dwScope;
    DWORD dwType;
    DWORD dwDisplayType;
    DWORD dwUsage;
    LPTSTR lpLocalName;
    LPTSTR lpRemoteName;
    LPTSTR lpComment;
    LPTSTR lpProvider;
    } NETRESOURCE;
    to an external DLL function ? Currently i've created
    a wrapper DLL which accepts ordinary datatypes and fills
    the struct properly. But i would like to have a more
    'generic' way to use DLLs.
    Any Ideas ??? Thanks in advance !

    Hi!
    I am also in need of the solution to this, but could not get it right yet!
    Would you perhaps share your current solution (writing the wrapper) with me?....
    I will keep you posted if I find a way of using ora_ffi with a C Struct
    Bye!

  • TS3581 iPhone 4S - The XCarlink iPhone/iPod accessory for Mazda Bose autochangers is functioning differently after iOS 5.1. The Shuffle function no longer works. Has anyone else experienced this problem?

    The XCarlink iPhone/iPod accessory for Mazda Bose autochangers is functioning differently after iOS 5.1. The Shuffle function no longer works and it plays Albums or Genius Playlisys only (not self-made playlists). Has anyone else experienced this problem?
    Previously, the iPod function enabled one to see the track that was playing and control playback (such as repeat or shuffle) via the iPhone screen. Now all I see is an "Accessory Connected" message.

    Somewhere in there, is there a question for us, your fellow users in these user to user support forums?

  • Signature: FSUpdateOperationStatus(void const*, TCountedPtr TCFURLInfo const&, long long, long long, long long, long long, unsigned long). No support Docs on file for this problem. Multiple crashes on opening Firefax. Running OSX 10.6.4.

    Signature:
    FSUpdateOperationStatus(void const*, TCountedPtr<TCFURLInfo> const&, long long, long long, long long, long long, unsigned long)
    No Support Docs on File.
    Firefox crashes every time it is opened.
    UUID 38fc1438-492f-4ce3-91d4-5ef922101027
    Time 2010-10-27 11:19:32.620395
    Uptime 11
    Last Crash 110 seconds before submission
    Install Age 610295 seconds (1.0 weeks) since version was first installed.
    Product Firefox
    Version 3.6.11
    Build ID 20101012104758
    Branch 1.9.2
    OS Mac OS X
    OS Version 10.6.4 10F569
    CPU x86
    CPU Info GenuineIntel family 6 model 15 stepping 11
    Crash Reason EXC_BAD_ACCESS / KERN_PROTECTION_FAILURE
    Crash Address 0x8
    User Comments
    Processor Notes
    EMCheckCompatibility Fal

    Looking at the crash log it looks like AE might be crashing in:
    net.telestream.wmv.export 
    Can you try uinstalling Flip4Mac (or whatever you have installed from http://www.telestream.net/telestream-products/desktop-products.htm)? You may need to manually go deep into /System to remove them.
    --c

  • LabVIEW call Win32 API DLL function from third party

    Hi everyone,
    I'm trying to build a LabVIEW 2010 interface on 32-bit Window XP system to configurate and communicate to an Anglient laser head through its USB expansion box. I contacted the vendor and they shared a win32 API with some dll files. I started with a function called "A55292Find", but the CLF node always pop up error 1097.I checked the MSDN to get the corresponding LabVIEW data type for CLF.
    My question is: Do I need to initialize those arguments? (How can I know the values of them if initialization is needed?)
    Could anyone help me figure out what's the problem?
    Here is what I have from API documents about this function:
    The A55292Find function returns lists of handles and board types for all the 55292 USB
    Expansion Modules connected to the system.
    A55292RC __cdecl A55292Find(
    HANDLE hBoxes[], // List of handles for the boxes found. (as Unsigned 32-bit integer numeric)
    BOARDTYPE PortABrdType[], // List of board types for slot A boards (as Unsigned 16-bit integer numeric)
    BOARDTYPE PortBBrdType[], // List of board types for slot B boards (as Unsigned 16-bit integer numeric)
    WORD *spMaxBoxes); // dimension for all of the passed arrays. (as Unsigned 16-bit integer array data pointer)
    // (function return type as Unsigned 32-bit integer numeric)
    Parameters
    HBoxes[] Array that will receive the list of HANDLES for all the 55292 boxes connected.
    PortABrdType[] An array that will receive Slot ‘A’ board type information for each 55292 box.
    PortBBrdType[] An array that will receive Slot ‘B’ board type information for each 55292 box.
    spMxBoxes Passes the maximum number of values that can be held in hBoxes, PortABrdType, and PortBBoardType arrays to the A55292Find routine and returns the actual number of boxes found
    The return value will be one of the following A55292RC return codes:
    Value Meaning
    A55292_NO_ERROR No error
    A55292_TIMEOUT Timeout accessing a shared memory
    Remarks
    This routine must be called to obtain handles and board type information used in calling all the other routines. If there are significantly more array elements than boxes, the routine will take longer to complete.
    These are the definitions: 
    typedef DWORD A55292RC; enum{A55292_NO_ERROR, A55292_HANDLE_ERROR,...}
    typeder WORD BOARDTYPE; enum{A55292_PCAL_BOARD, A55292_NO_BOARD, ...}
    Thanks a lot,
    Kang
    Solved!
    Go to Solution.
    Attachments:
    call A55292Find.vi ‏10 KB

    nkang11 wrote:
    Hi Mr. Kalbermatter,
    As you told me, I should try to use the defined enumeration words as control and indicator.
    For the previous CLF node, it successfully returned the hardware configuration (I have only connected a board at slot A):
    But I really want to see a string return as "A55292_PCAL_BOARD" which is defined by "typedef WORD BOARDTYPE; enumeration {...}; Does that mean I need to change the data type or do something like "converter"? Or initialize the array first, then convert it to string type?
    Right now, I'm trying to open the laser card by using "A55292PcalOpen(HANDLE hDev, SLOTSELECT SlotSelector);" function which requires to use the enumeration constants from " typedef WORD SLOTSELECT; enum {A55292_PORT_A, A55292_PORT_B};" but I'm confused to shot an constant control to a new CLF node.
    Since almost all of the arguments in dll function are typedefined as WORD, short and struct et al, I hope you could give me some hints on it.
    Thank you very much sincerely!
    Kang
    Depending on the actual C implementation you can simply create a LabVIEW enum with the according item names or use a ring control instead. Teh enum requires the numeric values of the items to be in consecutive order without any gaps in between. This is a given if the C definition never assigns a specific number to the item. If the C enum is not consecutive you need to go with a ring control instead.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling a dll function that as a structure

    I'm trying to call the following function with the Call library function node:
    XLstatus xlLinSetChannelParams (
    XLportHandle portHandle,
    XLaccess accessMask,
    XLlinStatPar statPar)
    The statPar parameter is a stucture which is define as follow
    typedef struct {
    unsigned int LINMode
    int baud rate;
    unsigned int LINVersion;
    unsigned int reserved;
    } XLlinStatPar;
    I used a cluster to pass the data to the function but labview is crashing everytime. The  C output of the CLFN is :
    typedef struct {
     unsigned long LinMode;
     long baudrate;
     unsigned long Linversion;
     unsigned long reserved;
     } TD1;
    long _xlLinSetChannelParams28(long portHandle, uInt64 accessMask,
     TD1 *statPar);
    Why is labview sending a pointer to the struct instead of the structure itself? Is this the cause of my problem? Any Solution?

    The CLFN ouput shown in my previous message was done with the "handle to value" parameter. As you stated, it sends a reference to the struct memory location.The problem is that i need to pass the structure value as an input and not a pointer to it (well, that's what i think the problem is). I read the various documents about CLFN and I tried the examples but they are all have function of that kind:
    returnval ExampleFunc (structPointer *struct)
    While the function in my dll is made like that
    returnval ExampleFunc (structValue struct) (see the real function in my first message)
    I included the dll and Vi and documentation for the xlLinSetChannelParams function.  The CLFN node that calls it is the fourth one (the one with a cluster as input). The first 3 CLFN are used to call the initialization function:init driver,get channel and open port.
    Attachments:
    LIN test.zip ‏130 KB

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM

    aajjf wrote:
    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM
    You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
    First fixed size arrays in C are inlined inside a structure, so are not a pointer but for the case of your val1 element three doubles.
    Second although not relevant here because of above point: LabVIEW arrays are not the same as C arrays. LabVIEW uses a pointer to a pointer and has the size of the array in elements prepended to the array data. C simply uses a pointer and all the rest is the programmers sorrow. The Call Library Node does convert the top level element of variables you pass according to the type configuration of that parameter but does no conversion of internal elements at all. So passing clusters with anything like arrays or strings is always wrong unless the DLL is aware of the specific datatypes LabVIEW uses.
    Last but not least you can end up with alignment issues. Elements in structures are aligned by every C compiler to a certain value. This value can be defined by the programmer in the project settings or for Visual C through #pragma pack() statements in the C code. The alignment rule says that an variable is aligned to the smaller of the two values that are either a multiple of the variable element size or the alignment setting. Most 32bit code nowadays uses 8 bit default alignment but LabVIEW always uses 1 byte. In your case there is nothing to observe since the large variables are at the beginning. Otherwise you might have had to insert filler elements in the LabVIEW cluster.
    One last thing bool is a C++ type only. Its size is 1 byte and incidentially this is the same LabVIEW uses for Booleans.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling DLL function using LabVIEW 7.1?

    Here's the scinario:
    I have LabVIEW 7.1 and i'm trying to call a DLL function using 'CALL LIBRARY FUNCTION NODE'.
    I have used this in the past with no problem. But right now, when I use this node and link it to the
    library and function name, i get 'ERROR loading Dllname.dll' message.
    NOTE that the DLL is generated using VStudio2003 or VStudio.NET. Could this be a problem??
    Also, i noticed that there are some JUNK characters before & after the function name that show
    up in function prototype:
    long ?EcpvsSign@@YAHHPBEH0HPAE1@Z(long Signer, CStr NonRMsg, long NonRMsgLen,
    CStr RMsg, long RMsgLen, CStr SigR, CStr SigS);

    tbd wrote:
    Hi rkpat,
          You might check-out this thread on building WIN32 DLLs - expecially the bit re: "mangles names" under the paragraph titled "C Language Source File".  My recollection is that 'extern "C"' directive in the header file for the DLL solved the name-mangling problem, but it's been a few years!
    Cheers!
    Message Edited by tbd on 03-01-2007 11:19 PM
    tbd is right. You have to first disable name mangling as it creates all kind of troubles. Other issues might be that your Visual Studio 2003 or .Net edition links in dynamic runtime libraries that are not standard available on every Windows PC so that you need to redistribute the according runtime library installer together with your app for the DLL to be even loadable.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • FRM-40734 when calling external DLL Function from Forms 6

    Even though some answers were given to my previous help request ("Again: Forms 6 and user-defined data types") I wasn't able to solve the problem of passing a parameter of an user-defined type to an external DLL function residing in the SECURSIGN.DLL library (the closest solution was to declare that "composite" parameter using the ROWTYPE clause referencing a custom-made table created just for the sake of defining that perticular datatype).
    So I concentrated on SECURSIGN.DLL functions using more trivial data types, like a function requiring just four character strings as parameters.
    I generated the necessary PL/SQL support using the FFI.
    I discovered that also the simplest calls to external functions fail at runtime with the generic error FRM-40734.
    I located the error: it happens just at the moment of calling the function from within the FFI-generated package body. Before that, the DLL is loaded with no problem, the function is correctly registered, and a function handle is regularly returned.
    As long as I can regularly issue the very same call with the very same parameters from Visual Basic, I can't understand what's going wrong (ALL the needed DLL are in the same directory as the FMB/FMX forms).
    I will greatly appreciate any help that You may be able to provide.

    I have noticed just now that a dump file having a name like ifrun60_dump_299, is generated by FORMS every time I issue the aborted call to the foreign function.
    Inside the form dump file, apart from useless info like Registers and so on, the message:
    "Could not find Module32First"
    By a FILE/FIND/CONTAINING TEXT I searched all the DLLs, and I noticed that Module32First is a routine that can be found within each of the following DLLs:
    Cl32
    d2kwut32
    d2kwut60
    I tried to load those DLLs along with SECURSIGN.DLL by modifying the PROCEDURE LoadLibrary into the FFI-generated PLL code, and I have apparently no problem in loading all the DLLs that I wish, but the error persists, and that dump file is constantly generated, always looking for the "Module32First" routine.
    How can I avoid all that mess and the FRM-40734 error??

  • Taking an array of unsigned word an using it in a subVI that accepts an unsigned long

    I have a user specified sized array that is in unsigned word(16bit). I need to use a subVI, but the subVI only accepts unsigned long(32bit). I was wondering if anyone would know how to make this work.

    Hi Amy;
    Unless I am missing something, there should not be any problem inside LabVIEW.
    To play it safe and keep LabVIEW performance up, convert the array using the "To Unsigned Long Integer" vi located in the function palette:
    Numeric -> Conversion
    Regards;
    Enrique
    www.vartortech.com

  • Complicated structure for DLL function

    I need LV6 to pass and get back parameters to a DLL function whose prototype is:
    int APIENTRY GetData(ACQDATA *Data)
    ACQDATA has the following structure
    typedef struct{
    unsigned long huge *s0;
    unsigned long far *region;
    unsigned char far *comment0;
    double far *cnt;
    HANDLE hs0;
    HANDLE hrg;
    HANDLE hcm;
    HANDLE hct;
    }ACQDATA;
    From the DLL documentation I could see that
    - the function modifies its argument
    - the (fixed) length of the second, third and fourth parameter is specified
    No idea of the length of "s0". I've tried several LV clusters including a cluster with four pre-allocated arrays (buffers) and four scalars. But no luck so far.
    If a C wrapper function is the only solution to pass the parameters correct
    ly, can anyone show me an example. Can I use the Code Interface Node for that purpose though I only own the Base Package version of LV or shall I write another DLL function?
    Please help asap

    Unfortunately I am new to C programming, but I'll try to give you the complete picture of what happens.
    There's no definition for HANDLE in the DLL documentation but windows.h is included, so I guess the following
    #define HANDLE void * //32bit?
    In my LV routine I tried U32 variables for the HANDLE typed parameters.
    In one of attempt LV passes to the function a cluster (I make no mistake with the order!) with four arrays and four U32, all of them preset to some value. Well.. these values (all)are not changed when the function returns. The return value of the function says no error, anyway.
    I tried other clusters: with and without arrays, with all (or part) scalars and all (or part) strings. No way either.
    Sometimes LV itself crashes, sometimes I get
    the original values I imposed before the call.
    I suspect the LV cluster structure makes me miss the right level of indirection for the first 4 variables in the structure (called *s0, *region, *comment and *cnt): when either I pass arrays or scalars as components of the cluster.
    Hope this helps you to help me
    Cheers
    Piero

  • Scan function no longer working on my Printer

    Recently moved locations and had to re set up my PC. Since then the scan function no longer works. I get the error message "Scanner reported an error", "Failed to open a session on the device". I have uninstalled and reinstalled the HP drivers, i have checked the internet connections and all are working. Actually have had a lot of troubles earlier with the rinter and the scanner re wireless connections but hoped to have finally overcome these.
    Not part of the problem but a real gripe as to what is the purpose of wireless devices when they never work as well as the ethernet connected devices, someone really needs to get this sorted <gripe over>.
    Can anyone help me please to get my system back up and running. I surgent now as currently on paternity leave and need to get some administrative issues doen from home in the next couple of days.
    Many thanks,
    This question was solved.
    View Solution.

    StevieDoug,
    Thank you for trying my recommendations, I believe this is a wireless issue. Let's go ahead and start troubleshooting the network:
    I would like you to shut down the Router, Printer and Mac in that order. Wait atleast 60 seconds, then power on the items in the way they were shut down. Re-attempt the scan. Was this successful or are you still getting the error message?
    If you are still getting the error message, let's try Pinging the Mac and testing the connection, click on the link below:
    How to Ping on Mac OS
    If pings are successful the issue is not likely communication, instead it is probably a firewall blocking the scanning communication. Continue below:
    To turn on firewall protection:
    1. Choose Apple menu > System Preferences, click Security, and then click Firewall.
    2. 

Open the Firewall pane of Security preferences 


    3. Click the lock icon to unlock it, and then type an administrator name and password.


    4. Click Start to turn on Firewall.
    To allow only specified applications and services to connect:
    1. Click Advanced.


    2. Click the Add (+) button, and then select the application or service in the dialog that appears.
    Are you able to complete the scan? Please let me know the results!
    Thanks again,
    HevnLgh
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • Places function no longer works on iPhoto.

    My Mac has OSX 10.6.8 and iPhoto 8.1.2.  The Places function no longer works.  I can select Places that I used on earlier photos, but it no longer locates new Places on the map.  I have read other people's discussions of this problem on the web, but I am not technical and do not understand much of what they say.  Any suggestions for a no-technical person would be welcome.

    I have this same problem on my new MacBook Pro. The biggest problem is that the embedded Google will NOT find most things that Google Maps finds. For example, the Oberoi Amarvillas in Agra India.
    I also can't move the pin for any of the places it already knows. I wonder if this might be related to trackpad settings? I can't find one that looks like it might help.
    I can find locations using their map coordinates (for example, 27.168647, 78.049150) and then go back and rename the place to something more helpful. But I can't fine tune the size of the location, which makes it hard to have highly localized places. And it gets the name of the state wrong, which makes it hard to find locations by general location.
    This puts a damper on processing photos right away, if I can't record them while I still remember their locations.

  • How to Use DLL Function in Java Applet

    Hi all,
    I have been assigned a task to develop java applet. The problem is, I need to use DLL functions in my applet to read records. Could you pls anyone guide me how to interface DLL and applet to read records with sample code?
    I'm using JDK 1.5.0_06 and Windows XP OS. thanx..
    best rgds,
    jpdbay

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • Java newbie help (type casting, 64bit unsigned Long)

    Hi I am java newbie and need help on my project. I have a few questions. Can you put strings in a hashtable and test for their being their with the appropriate hashtable method? I want to test for equal strings, not the same object. Second question can you use all 64 bits of an unsigned long? java doesn't seem to allow this. Any packages that do?
    Thanks,
    Dave

    Try casting it to Long instead of long. Long (capital L) is an Object, while long (lower case l) is not. You may also check to make sure the value isn't null. I would have thought that autoboxing would have worked here unless the value was null. But I am no expert on autoboxing.
    Edit >> Checking for null ain't a bad idea but has nothing to do with the problem - this is a compile time problem. Sorry.
    Also>> This code should work:
    long cTime=(Long)session.getAttribute("creationtime");Edited by: stevejluke on Jul 1, 2008 11:00 AM

Maybe you are looking for

  • Purpose of lock in session method?

    wat is the purpose of lock objects in session method ? when we use lock objects ?

  • Applying an LOV to a dynamically populated VO

    I am a newbie at ADF so I'm not totally sure how to explain this. But I have a generic VO defined as a part of say a common popup picker which populates a table based on an already defined VOs. My requirement is for one such VO that I have defined wh

  • What are the best printers to use?

    I bought a HP Officejet 4500 but it's not even showing up during the installation. What printer/scanner/faxes are the best for my MacBook Pro 10.6.8?

  • Accounting document problem

    Hi friends, I am trying to release to accounting for a Billing document (Credit memo for returns) but i am getting an error "Missing export data".  Where could i missed some configurations? Whereas when i create a Normal billing document it is not th

  • Photoshop/Bridge CS6 Could not build preview because of a disk error: Mac10.8.2

    The crashes always occur while editing a photo  in the Camera Raw editor in Bridge (most of the time they are JPG files, yes you can edit JPGS in the Adobe Camera Raw editor) and then hit the "Open Image" button that will open the image in Photoshop.