DLL Calling Conventions, Need Help

Hey everyone,
need some help here...
How do I setup the 'call library function node' for a function in a dll which is called as such:
(in C)  bool get_dxdy_pos (signed short * pDXManual, signed short * pDYManual);
I'm not sure how I pass a pointer in labview, and as for the bool return I can just use an unsigned short int right?
Thanks

Hi IEC,
As attachement you will find how the setup should be in LabVIEW, hope this helps
Christian
Attachments:
Call Library Function.jpg ‏38 KB

Similar Messages

  • Bad DLL Calling Convention

    Hi,
    I've created a dll with LV8.6 and I'm trying to call it from VB6.0.  I get the message 'Bad Dll Calling Convention.  Run Time Error '49'.
    Questions:
    1.  Any idea what might cause this error?
    2.  What is the meanig of the second function appear inh the h file ( long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module)
    Thanks very much for your help
    Rafi
    The dll definition as appear in the h file:
         void __stdcall EDASAnalysis(double f_sampleMHz, char FilePathFromOut[],
             double *RMSValue, double *AmplitudePP);
         long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    The Decleration in Visual Basic 6.0:
         Declare Sub EDASAnalysis Lib "D:\NI Projects\eDAS400\DLL\ LV-DLL_V2\DLL\eDAS400_Analysis.dll" _
                (ByVal f_sampleMHz As Long, ByVal FilePath As String, RMSValue As Long, AmplitudePP As Long)
    Using the Function in VB6.0:
        Call EDASAnalysis(10, "D:\NI Projects\eDAS400\Data Files\Samples\10MHz.txt", rms, pp)

    Rafi2003 wrote:
    Hi,
    I've created a dll with LV8.6 and I'm trying to call it from VB6.0.  I get the message 'Bad Dll Calling Convention.  Run Time Error '49'.
    Questions:
    1.  Any idea what might cause this error?
    2.  What is the meanig of the second function appear inh the h file ( long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module)
    Thanks very much for your help
    Rafi
    The dll definition as appear in the h file:
         void __stdcall EDASAnalysis(double f_sampleMHz, char FilePathFromOut[],
             double *RMSValue, double *AmplitudePP);
         long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    The Decleration in Visual Basic 6.0:
         Declare Sub EDASAnalysis Lib "D:\NI Projects\eDAS400\DLL\ LV-DLL_V2\DLL\eDAS400_Analysis.dll" _
                (ByVal f_sampleMHz As Long, ByVal FilePath As String, RMSValue As Long, AmplitudePP As Long)
    Using the Function in VB6.0:
        Call EDASAnalysis(10, "D:\NI Projects\eDAS400\Data Files\Samples\10MHz.txt", rms, pp)
    muks already pointed you to a discussion that shows the problem. VB can not call cdecl exported functions, so when you create your DLL you'll have to tell LabVIEW to use the stdcall calling convention to export the function for VB.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • RoboHelp for Word Version 8-Run-time error 49-Bad DLL calling convention

    I just installed the trial version of RH8. I have RH5 installed. I also have Word97 installed. When I start RH8, the RH Explorer pane opens, but when it tries to open Word, the following error message appears: "Microsoft Visual Basic - Run-time error '49'. Bad DLL calling convention." Any ideas on what I can do to fix this problem?

    See Snippets on my site.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • VB Error  - Runtime error '49' Bad DLL  calling convention

    Hi Experts,
    When User is running report he is getting error VB Error  - Runtime error '49' Bad DLL  calling convention .
    Can you please suggest how to resolve this issue?
    User has already tried uninstalling SAP GUI and installing again.
    Thanks & Regards
    Deepak Chavan.

    Hi Deepak,
    this doesnt appear to be an SAP error.
    I did a Google search on the error & got lots of hits, including:
    http://www.bigresource.com/VB-WindowFromPoint-Bad-DLL-calling-convention-run-time-error-49--G1wKaVeqwY.html
    Its a Microsoft Visual Basic programming error code.
    Rgds,
    Colum

  • DLL calling convention

    I wonder what calling convention I should select at the call library node for these 2 cases of DLL
    if my functions in the DLL are declared as follow;
    1. extern "C" void PASCAL EXPORT my_function()
    2. void __declspec(dllexport) my_function2()
    thanks

    The first one uses the obsolete type PASCAL. This has been mapped to __stdcall so that is what you should put in your Call Library Node.
    The second one doesn't declare an explicit calling convention so I have to make some assumptions:
    1. This is not a member fuction of a C++ class.
    2. You haven't defined an explicity calling convension in the compiler (such as /Gz or /Gr).
    In that case, it defaults to __cdecl.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Customer Relations doesn't call Back -- need help on getting a refund.

    I’m looking to get a refund for a netbook that I purchased. Here’s my story.
    I bought a Lenovo ideaPad S10-2 in September and in October I had to send it in for repair on a cracked screen (plastic casing). Lenovo warranty received it Oct 21, 09. Expected fixed date was November 7, then got pushed to the 13th then got pushed to the 20th ……….As you can see Lenovo has had the product longer than I have, at this point I don’t want it anymore (I wasn’t even offered a replacement) I just want my money back because they can’t tell me when it can be fixed and I’ve had a lot of phones calls to their tech support and I’m getting nowhere. They have escalated it to customer relations and they were suppose to get back to me 5-7 business days, it’s the 9th day and nobody has returned my calls. All I want is my money back.
    If this is how Lenovo treats their customers, then I will have to inform our parent company to switch back to buying Dell products as their customer service is far superior.
    Is thier anyone who can help on these forums?

    fourtrack78,
    Can you send me a private message with your service case number and your contact information?
    The case will be WNxxxxx.     Apologies that this has been your experience so far... I'll ensure you receive some assistance.
    Best regards,
    Mark
    ThinkPads: S30, T43, X60t, X1, W700ds, IdeaPad Y710, IdeaCentre: A300, IdeaPad K1
    Mark Hopkins
    Program Manager, Lenovo Social Media (Services)
    twitter @lenovoforums
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • How to build a DLL that has Pascal calling conventions with application builder?

    Hi,
    I'm researching for possible solution to one of our problems.
    In one case, solution would be to build a DLL from LabView
    code. This should be simple task, but the application that
    is going to load the DLL requires that the functions in the
    library are exported using Pascal calling conventions,
    similar to the C/C++ example code below.
    DWORD APPEXPORT far APPPASCAL function(char hexr[])
    Could this be possible with LabView somehow? Or is it best just
    to write the DLL with C/C++?
    Thanks.

    Thanks Wiebe.
    I don't know whether I need pass string pointers or not. The example
    I posted was from the manual of the program that will be using the DLL
    I build with LabView. I only wanted to show with it the exported calling
    convention needed. It seems that it actually confused my question rather
    than clearing it.
    Anyway, now I know that it's possible to declare the calling convention
    when building the DLL. And it's always good to know that I might encounter
    different pointer types on the way, this may actually save me from a lot of
    debugging some day.

  • KILLING AN OLD ACCOUNT--TWO ACTUALLY. NEED HELP BA...

    I have 2 old skype accounts that I want to kill. This is a real PITA not having a customer service agent to call. Need help on this, because I established a new account, but when I sign in to skype it defaults to an account I'm trying to kill. Using 8.1

    If you're sending from the new account, that address is the outgoing mail address, by default. Did you try deleting the server of the old account? It could be sending mail out through that server instead of the one provided by the new ISP, which would change the outgoing mail address.
    Go to Preferences > Accounts and select the new account; look near the bottom of the window where it says "Outgoing Mail Server (SMTP)" and check to be sure that is set to the server provided by your new mail provider. If it's not, you need to select the correct one from the pop-down list.

  • WEBUTIL_C_API: Writing wrapper DLL's to address calling convention issues

    I am interested in calling the Windows API using WEBUTIL_C_API. In particularly, I am interested in calling FindWindow to obtain window handles. I registered the function as required, but have yet to get a meaningful result. Upon researching Metalink a bit, I encountered a post stating that FindWindow uses Pascal calling conventions, while WEBUTIL_C_API expects C calling conventions. The suggested solution is to wrap the API call in my own DLL, which adapts between the two calling conventions.
    I'm fairly adept at writing standard C code, albeit out of practice, and with a bit of Googling, I have even managed to compile a DLL using GNU gcc. Alas, I evidently don't understand all the compiler directives required to write the wrapper DLL that I have described. Has anyone else managed a similar task, who might share an example or direct me to some helpful documentation?
    Thanks,
    Eric Adamson
    Lansing, Michigan

    Mr. Ronald,
    Thank you for your assistance. After going through the webutil log file and the WebUtil Familiarization Manual a few more times, and lastly, metalink, it was stated in a metalink post that the "Cause for the Error WUC-20 can be that the webutil.cfg file has an invalid virtual directory: install.syslib.location".
    According the WebUtil Familiarization Manual (p.11 of 49), install.syslib.location=/webutil. I did just that, and the log file indicated that
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.746 WUI[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.ffisamp.dll
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.761 WUI[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.761 WUI[loadSettings()] No local properties file to load
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.761 WUI[getProperty()] Value of WUC_GET_LOCAL_PROPERTY=null
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.777 WUI[setProperty()] Setting property WUC_URL_DOWNLOAD to 1|40960|Y|/webutil/ffisamp.dll|ffisamp.dll|WebUtil Install|Downloading required libraries; Please wait...|ffisamp.dll
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.777 WUI[getProperty()] Getting property WUC_URL_DOWNLOAD
    xxx.xxx.xxx.xxx:xxxxxxx: 2004-Jan-22 11:32:53.777 WUI[downloadFromURL()] Source is http://<machine_name:port>/forms90/f90servlet/webutil/ffisamp.dll
    So I tried the absolute URL, http://<machine_name:port>/forms90/webutil, Voila! It worked. The point is somehow, the download url should not include .../f90servlet/...; just plain /forms90/webutil.
    Thank you for your time and assistance.
    Regards,
    thomas

  • Need help about a dll with panel function

    Hello,
    I try to create a DLL file with a graphical panel, and i want to use it on an other platform with visual c++ compiler.
    to release this DLL, i use an UI and generate a code with the option : Tools\UI to Code Converter.
    now i have a code which can create a user interface without the file .uir
    During the compilation there is no error, but when i want to test/execute it on Visual C++, I have an error message : The memory cannot be read, address 0x00000000.
    Someone can help me about this? and if you want my project to see the code, i can give it.
    thanks.

    One quick question: are you trying to avoid needing to install the LabVIEW runtime on the target machines?  If so, I don't believe packaging it in a DLL will accomplish that.  (Correct me if I'm wrong, but I think LabVIEW created DLLs still have dependencies on the LabVIEW runtime.)
    In general though, I agree with your suspicion as to why it isn't working.  One test you could perform to clarify the situation would be to added another VISA write and DLL read in line after the second form in your attached JPG.  If the resource is hosed up after your DLL read also, I agree, it would point to the DLL calls causing the resource to hang.  Perhaps the process of translating the VISA resource name from a string to the actual resource object causes the VISA session to be tied to the scope of the DLL function call (hence automatically releasing when the call is completed)?  If so, maybe passing the actual VISA resource name would help.  The VISA resource is really nothing more than a pointer to an object (a LVRefNum).  From the perspective of language independence, I think that probably amounts to a 32-bit integer.
    Also, perhaps you could just avoid building this level of granularity into the DLLs?  The idea of creating a DLL is to abstract away some complex task.  I'm not sure what benefit you get of creating DLLs out of such basic functions.
    Anyway, good luck. 

  • Need help loading DLL in labVIEW project

    I have a DLL that was written in C# that I want to load it to my labVIEW project. I have never done this before, so I need help. I chose Connectivity-Call Library Function Node then loaded my DLL. After, under function name, I typed in the function name from the code. I don't know what to do with other like Parameters.
    They don't let me attach dll file 
    Can someone explain how to set the parameters and etc?

    Well, it seems that you really need to learn quite a bit about .NET (ActiveX is very similar!) first.
    The constructor node in your code creates an object in your .NET CLR (Common Language Runtime). This object exposes properties and/or methods. Use Property Node(s) and Invoke Node(s) to access these. Usually, you get references to other objects which you can work this.
    Remember the golden rule for ActiveX and .NET:
    Close all references you created in your LabVIEW code on your own (using Close Reference)!
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.

    After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ

    Izit software or hardware? Confuse:(
    Only can use wifi now.
    Any way thanks guys for ur suggestion:) amishcake and simes

  • I NEED HELP My cellular data is not working! I called and went to Apple INC. And At

    So after July 4th 2013 I experienced wi-fi problems. I wasn't able to keep connected and i kept getting kicked out my own wi-fi. I left it continue a while because i thought it was only temporary. But i noticed my cellular data with at&t hadn't been working properly for about a month. Then it started getting worse till the point now I cannot use nor wi-fi nor cellular data. I called Apple Inc., they thought it was a bug, and we took procedures for trying to fix it. We restarted it, and reset network settings. Finally they suggested calling or going into at&t. I called first and we did almost same exact procedures as apple. So I decided going into At&t, they changed my original sim card and was only recieving 1 bar of signal, but i was bad. I couldn't do anything. After they scheduled and appointment at Apple store, ugh! which was such bad service. People everywhere and rushed through my problem and he didn't even let me explain. He only suggested I buy their ipad exchaging mine. In which come on. I couldn't back up my photos and stuff that instant. I asked him to give me a minute and he never came back. Like what was the point of that appointmet? After leaving I walked about 2 streets down and all my cellular data bars and 3g were up. It only worked there and when i was driving home and got home nothing once again. Not even inside the store. i mean others wi-fi works in some areas and my cellular data was good until now . I know At&t told me they were not experiencing any technical issues and everything was good, so i know its not due to that. My siste's mini ipad is working fine, so is my sisters ipod. I really need help and someone to take time in reading this and or helping me.Please thanks!

    Has any had you try a reset yet? Sometimes the WiFi &amp; Cellular anntennas get wacky.
    Hold Sleep/Wak &amp; Home buttons until the screen goes dark and you see the Apple logo

  • I just bought this iPhone 4S second hand and during incoming and outgoing calls I can't hear the other person talk unless it's on speaker or if I have headphones in. I don't know what to do I've turned up my volume and checked my settings!! Need help

    I Just bought a second hand iPhone 4S I am having issues with the hearing during incoming and outgoing calls, I have turned the volume up and checked my settings but I still have trouble hearing the other person speak. It works if it's on speaker or if I have headphones plugged in. I need help desperately!!!!! Any suggestions on what to do???

    Hey Itsanaasaunders,
    Thanks for the question. I understand that you are experiencing issues hearing sound while on a call (receiver wise, not speakerphone). The following resource provides troubleshooting steps for this symptom:
    If you can't hear a person on a call or voicemail or if the sound quality is poor on iPhone - Apple Support
    http://support.apple.com/en-us/HT203800
    Clear the receiver
    The iPhone receiver won't work properly if it's blocked or dirty. Here's where the receiver is:
    Follow these steps, testing after each:
    - Make sure nothing is blocking the receiver, such as a case or film.
    If you have a new iPhone, remove the plastic film on the front and back of the device.
    - Check the receiver opening to see if it's blocked or dirty. If necessary, clean the receiver opening with a clean, small, dry, soft-bristled brush.
    - While you're on a call, turn on speakerphone. If you still can't hear, then your network or reception could be the issue. Try calling again later or from a different location.
    Restart and update
    1. Restart your iPhone and test again.
    2. If there's still no sound or poor sound quality, update to the latest version of iOS.
    Get more help
    If you've tried these steps and there's still no sound or poor sound quality from your iPhone, contact Apple Support.
    Thanks,
    Matt M.

  • I need help authenticating my outgoing server settings in setting up my work email on my Galaxy S5.  It says unable to authenticate or connect to server and I even called helpdesk at my email support and they tried every possible port (80, 25, 3535 or 465

    I need help authenticating my outgoing server settings in setting up my work email on my Galaxy S5.  It says unable to authenticate or connect to server and I even called helpdesk at my email support and they tried every possible port (80, 25, 3535 or 465 SSL) and none of them work. Please help!

    You will need to get the required info to create/access the account with an email client from your school.
    Are you currently accessing the account with an email client on your computer - if you have a Mac with the Mail.app, or if you have a PC with Outlook Express, etc.? If so, you can get the required account settings there.

Maybe you are looking for

  • Action listeners and while loops

    Hi. I have a while loop, that runs for some condition in this loop, i'm adding as many buttons as the condition holds. for each loop, i adds an action listener. the problem is when i want to use the action listener. it, of corse, respond to the last

  • Instead-of Trigger of View on a Remote Table Fails!!!

    Hi all, I'm trying to create an INSTEAD OF (UPDATE or INSERT) trigger on a view V1 in DATABASE DB1 (Linux 7.3 or 7.2, ORACLE 9.2.0.1.0 - Production).The view V1 is created on a remote table through a DBLINK.But I always get such error when I update t

  • CLPBID - Collaborative Transportation planning - Shipment details in XML

    Hello All, Scenario: We are using the standard SAP application for APO Collaborative Planning - Transportation RFQs. We are on SCM 7.0 This basically launches an IAC (Internet application Component) CLPBID. The same screen can also be launched via tr

  • Facing problem in selecting from table vbrk

    Hi, I have developed a simple report for calculating the total logistic cost. That program was working fine in the development server. Now in production, its not working. While debugging i found that its getting stuck at a select query where its fetc

  • File compare utility?

    Hi Guys, Can anyone recommend a good, inexpensive file compare utility that works well with Dreamweaver 8? Thanks. Phil