Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView

Hi All,
I need to access some functions in a C++ .lib within LabView, but has no source code for the library.  Can I build a Dll in Visual C++ that calls this library, then have LabView calls the Dll? If so, how different is building this Dll compared to building a Dll from a .cpp file?  I am new to C++, could some one suggest how to use the .lib in Visual C++ 6.0 studio to build the Dll?
Thanks for your help.
Bryan

BryanL wrote:
Hi Rolf, thanks for the info. I will try to build a vi to call that function. For a more immediate need, I can use a downloaded vi that calls SetActiveWindow function, then use its output windowshandle to find the window name with a lvwuser32.dll function. The problem is this find window name function vi requires a windows reference input, which does not take the window handle output from the SetActiveWindow vi. How do i convert the window handle into a reference number? Thanks again.
Don't try to write a VI to call that function. That function requires a callback function pointer, something that is more or less impossible (well you can get it done but it is not worth the trouble) to create in LabVIEW. You will need an external DLL that does the enumeration and returns an array of strings to LabVIEW.
The lvwuser32.dll also just uses window handles. Look inside those VIs and you should see that those window references are typecasted into uint32 and then passed to the Call Library Node if I remember correctly. You definitely should be able to typecast the (probably uint32) you get from your other function into the window reference that that VI takes. The window reference of the lvutil library is just a nice trick to make it refnum like so that you can not inadvertly wire something else to it (and confuse/crash Windows).
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.   I have been searching every other day for over a month trying to find a fix in Windows Safari with n

    I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.
    I have been searching every other day for over a month trying to find a fix in Windows Safari with no joy.  I want to resolve, not switch browsers. Please offer up a solution that only refreshes the Top Site thumbnails once a day or as some controlable interval.  Started about two versions ago, now on ver 5.1.5. Windows 7 64bit.
    Safari 5.1.5 for Win64 bit, Windows 7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I think I solved the wifi connection problem, just by switching off completely the router! sounds trivial, but in this case it worked!!!
    the funny behaviour of the trackpad/cursor still persists. any suggestion???
    thanks again

  • My iPod touch 4th gen. Won't charge with a enercell charger that I've used since December. It will only charge with the apple USB cord that came with it. And even the takes it about 6 sec. To realize its charging. Help me fix this?

    My iPod touch 4th gen. Won't charge with a enercell charger that I've used since December. It will only charge with the apple USB cord that came with it. And even the takes it about 6 sec. To realize its charging. Help me fix this?

    Yes, I've been using it for months. And I can charge other devices with it. (my iPhone) but something weird just happened..... I kept on pluging it in the iPod and sometimes it would start to chàrge then sometimes it won't charge. Charges every time with the iPhone though.

  • I have an iPhone 5 unlocked. I have been using it for few weeks but 4 days ago I turned it off and in the morning it had NoService. Called tmobile and apple costumer services no one helped. Did any one had this issue and solved it?

    I have an iPhone 5 unlocked. I have been using it for few weeks but 4 days ago I turned it off and in the morning it had NoService. Called tmobile and apple costumer services no one helped. Did any one had this issue

    If you got the Unlocked message it means it was successfully unlocked by AT&T.  Apple will not relock or block it.  They have no objections to it being used on T-Mobile.  It is still under warrantee.  Take to an Apple store.  They can test it with a SIM from AT&T.  If that doesn't work have them replace the phone.  Have them verify that the new phone is unlocked.  If it does work with the AT&T card then it is a T_Mobile problem.

  • I deleted the photos from my iPhone 6 that were synced from my computer automatically but it is still using my storage. How do i fix that? I have tried all of the steps listed in the community.i have the new iTunes 10.

    I deleted the photos from my iPhone 6 that were synced from my computer automatically but it is still using my storage. How do i fix that? I have tried all of the steps listed in the community.i have the new iTunes 10.

    Hi QuisB123,
    If you are having an issue with reclaiming free space after deleting photos from your iPhone, use the steps in this article to assist -
    If you get a "Not enough free space" alert on your iPhone, iPad, or iPod touch - Apple Support
    Specifically -
    Orphaned files might remain on your iOS device if it's physically disconnected while syncing music, podcasts, videos, or photos. This can prevent iTunes from syncing the iOS device on subsequent sync sessions. When this happens, you might see a large amount of "Other" disk usage for the iOS device in the Capacity indicator in iTunes. Try these steps:
    Turn off the music or photo sync option in iTunes for the device.
    Click Apply to sync the changes to the device.
    Turn the music and photo sync options for the device on again.
    Click Apply again to try to sync the device to iTunes. If you see the "Not enough free space" alert, continue to step 5.
    Turn off the automatic syncing functions for the iOS device:
    Select the iOS device from the iTunes window and click the Summary tab.
    Deselect "Automatically sync when this device is connected" and select the "Sync only checked songs and videos" checkbox.
    Click Apply to sync the changes to the device.
    Reduce the amount of data that is being synced to the device and resync the device. For example, if syncing your Music library exceeds the memory capacity of the device, choose "Selected playlists" to transfer rather than "All songs and playlists" under the Music tab in iTunes. If you see the "Not enough free space" alert, continue to step 6.
    Restore using iTunes.
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • Hello! I use the VSCO preset that was easy to download and use right away a few months ago. This morning I did the same thing and it downloaded successfully but none of the presets are listed under the new VSCO folder I bought. How can I fix this? Does Li

    Hello! I use the VSCO preset that was easy to download and use right away a few months ago. This morning I did the same thing and it downloaded successfully but none of the presets are listed under the new VSCO folder I bought. How can I fix this? Does Lightroom have a limit on presets?

    Hello! I use the VSCO preset that was easy to download and use right away a few months ago. This morning I did the same thing and it downloaded successfully but none of the presets are listed under the new VSCO folder I bought. How can I fix this? Does Lightroom have a limit on presets?

  • I am using a DLL from VC++ labview6.1 crash upon loading the DLL

    Labview crashes when I load my DLL from VC++ that calls device net software. It is only _stdcall function. Sometime my whole PC crash upon loading it. I Appreciate any help from anyone......

    Your problem is most likely caused by a memory error. Insure that you are passing the correct data types (especially pointers) into the Call Library Function and make sure that if the DLL is expecting any memory to be allocated that the proper data has been created in LabVIEW (for instance, if the DLL was expecting a string of a certain length, LabVIEW would need to create a string constant which was long enough to satisfy the DLL). Also insure that there are not any race conditions (conditions within LabVIEW in which the order of execution is not defined) which could cause your DLL to access memory which has not yet been allocated. You can generally fix race conditions by using sequence structures. Also, make sure that your DLL cleans up any memory that it all
    ocates.
    Hopefully that helps,
    Ryan
    NI Applications Engineer

  • DLL Adapter: Change function name & params without unloading the DLL

    Hi,
    I'm using teststand adapters API to dynamically build a DLL call step. Each dll function is called thru this "DLL Manager" sub-sequence. 
    Tried 2 methods (here is an abstract of the code): 
    1. ActiveX steps: 
    CommonCModule.ModulePath = myDllpath
    CommonCModule.FunctionName = myFunction  (note: this call unload the previously loaded DLL)
    Module -> LoadPrototype
    for( to set params)
    2. Statement steps: 
    RunState.Sequence.Main["Call DLL function"].TS.SData.Call.LibPath = myDllpath
    RunState.Sequence.Main["Call DLL function"].TS.SData.Call.Func = myFunction (note: this one not, but the info seems to not be updated => The new function is not called properly)
    Module -> LoadPrototype
    for( to set params)
    The two methods don't have exactly the same behavior, but work well for the 1st function that I call or work well if I unload the dll after step execute. 
    However, is there a way to use these steps (or others) to setup the step, but without unloading the DLL between each call. In my test sequence, I have to OpenConnection with the UUT before launching my commands, so the dll must not be unloaded to keep the connection opened... 
    e.g. 
    1) OpenConnection()  => This function keeps the communication handle with the device
    2) myCommand1()
    3) myCommand2()
    4) CloseConnection()
    Thank you for help
    C.
    Solved!
    Go to Solution.

    Hi all, 
    To recap:
    I'm looking for a method to dynamically loads and executes C/C++ DLL functions without unloading the DLL between each call. I already have a DLL manager that dynamically loads and executes dll functions, but it unloads the DLL between each call even if I set the unload option to: "Unload when sequence file is unloaded"...
    The problem is: 
    When I change the name of the function to execute (using the CommonCModule.FunctionName property), teststand automatically unloads the DLL before applying the change. Therefore, I can't open a connection handle with my UUT using one function and sends my commands with the others...
    To help you with the understanding of my issue:
    I created a simple example that will let you experiment the problem that I try to describ... You will notify that TestStand unloads the dll even if I don't request it... 
    1) download the attached zip file
    2) extract it anywhere
    3) open sequence file "dll_called_dynamically.seq"
    4) read comment of the first step of the sequence
    >> To analyse the case:
    >> 1) Break and run the sequence using step-by-step (use F10)
    >> 2) Run one iteration of the loop to execute the dll once, ,
    >> 3) Execute launch_listdlls.bat and verify in the outputfile.txt that the dll has been loaded (search for testlib.txt)
    >> 4) Then, step over the step "Set Dll Function Name to call"
    >> 5) Execute launch_listdlls.bat and you will notify that the dll has been unloaded... ...
    The testlib.dll file provided in the zip file is a basic dll that I used to confirm my test engine. Mainly, it only performs additions on the variables passed as argument to the dll. 
    The provided batch file executes the free application ListDlls.exe and create an outputfile.txt listing all currently loaded dll.
    Please note that I use TestStand 2013
    Thank you very much for your help,
    C.
    Attachments:
    dll_unexpected_unload_ex.zip ‏313 KB

  • Can I use internet sharing to give internet to my Apple TV through my Macbook and use Airplay on the same computer at the same time?

    So I am using internet sharing from my Macbook to my Apple TV. The router providing internet to my Macbook has an ip address that looks like 192.168.0.x. Since the internet sharing feature assigns an ip address that looks like 192.168.2.x to my Apple TV, the Macbook is unable to see the Apple TV ("different" networks). Is there a way around this so I can share internet and still be able to use Airplay between the two?
    BTW I am using a Macbook Pro Retina 15'' (late 2013) on Mavericks 10.9.1 and Apple TV 3.
    Thanks.

    Why are you tyring to spilt your connection though the MBP?  Why don't you just connect them both to the router as they are meant to be setup?

  • I have uninstalled and reinstalled the new iTunes but it still will not work.  I keep getting the error mesage relating to MSVCR80.dll, the installation error 7 (windows error 126). I have tried moving and removing the dll files including the QTMovie dll

    I have tried uninstalling and reinstalling iTunes 15 times regarding the latest release and still get the MSVCR80.dll and Error 7 (Windows error 126) messages.
    I have tried moving the dll filesincluding the QTMovie dll file to now avail.  Can anyone please help, as I am sure you all, like me, have thousnads of dollars and songs invested in this system and need a fix fast.  Can anyone please help???

    Dear avid iTunes users - I have cracked it!!!
    The response from Apple/iTunes was extremely poor and did not solve the problem.
    I have a look in msconfig and observed which applications/services were running - one of which was the 'Apple Application Support'
    So ... I had a look at what was in this folder and found the APS Daemon.exe file causing all the trouble.
    So ... I simply deleted the Apple folder found in C:\program files\common files\.
    I did a restart and did not get the MSCVCR80.dll or Error 7 (windows 126) error messages.
    I reinstalled the current version of iTunes (for the 16th time!)
    Hey presto!!!
    IT WORKED :-O Woooohooo!!!
    So ... to all those smarty-pants boffin-brianiacs out there (apple/iTunes): this is how you do it!!!!!!!!!!
    YOU DO NOT NEED TO UNINSTALL ALL THE APPLE/QUICKTIME OR RELATED PROGRAMS - JUST DELETE THE APPLE FOLDER IN THE C:\PROGRAM FILES DIRECTORY.
    Nuff said.

  • How can I send a jpg picture file to someone so that they can download it and use it?  I can send a picture in an Email, but they can't open it

    How can I send a jpg of a photograph to someone so that they can download the file and use it to put into an article?  I can send it in an Email, but there doesn't seem to be a way for the recipient to extract the jpg from the Email

    If the person is using a pc, make sure the picture has the suffix .jpg 
    Example:  your picture.jpg

  • I've bought an USB-to-ethernet-adapter and a minidisplay-port-to-VGA-adapter. But I can't use them at same time. At first, I plugged those two adapters and only the USB-to-ethernet worked. Tried restarting the mac then only VGA adapter worked.

    I've bought an USB-to-ethernet-adapter and a minidisplay-port-to-VGA-adapter. But I can't use them at the same time. At first, I plugged those two adapters and only the USB-to-ethernet worked. I tried restarting the mac then only the VGA-adapter worked. I also tried to reinstall the OS.
    I'm using new 13-inch MacBook Air early 2015. OS X 10.10.3.

    Thanks Malcolm - Do you think it might be worth trying to flash the firmware on these cases - there seem to be updaters available on Prolific's website. Obviously I'd have to do it on a PC. I've emailed Prolific asking them about my problem. No reply as yet, and I'm not holding my breath! Do you know if there are any other posts on these boards relating to Prolific? Stupid question really - I'll just do a search...
    Thanks again for your post. Cheers from Bonnie Scotland.

  • Calling a stored procedures and using its output parameters in a report

    Hi,,
    I have a procedure defined in a package on the database. This procedure returns a number of output parameters. How do I call this procedure and use the output parameters in my report ?
    Thanks, Mark

    Depends on the level at which the procedure has to be called. If its at report-level, call the Form in the BEFORE-REPORT-trigger (or AFTER-PARAMFORM) and store the out-values in Placeholder-columns. These you can use anywhere in your report.

  • Can't make or receive calls but can text and use data

    I have had signal problems since I have got this phone which is an s4 my wife s3 mini gets better signal while at the same location. Tried everything customer service doesn't know and now I can't even make or receive a call. I can though send and receive text and use data but when I try to make a call it just says dialing then quits. Anyone trying to call says it will ring until voicemail but I never got the call. Can anyone help

        haynes88,
    Yikes! I want you to be able to make phone calls on your cell phone! I would recommend what others have stated on here as well. Remove the sim card for a good 30 seconds while the phone is off. Then try to make the phone call again. Have you ever replaced the sim card on your device before? You can always get a new sim card for free at a corporate store location: http://bit.ly/3SdsA Please keep us posted.
    KevinR_VZW
    Follow us on Twitter @VZWSupport

  • How to Build a Flex App that works with both SQLite and MySQL?

    Let me explain a bit: I am developing an app that will
    be published as an AIR application using SQLite, as well as a FLEX application that will use MyDSQL via web services.
    I want to develop both applications in such a way that all the components can be reused, and I only have to do minimal redevelopment. I have started witht the AIR application. Once I have it completed, I want to publish the application (with minimal redevelopment) as a FLEX web app.
    My thinking is that I contain the database accesses in the Application, and passing the data via interfaces to the respective modules, as well as receiving data from the modules back to the Application to be written to the database. This was the only changes between the FLEX and the AIR application will be how the database access is handled in the Application file, and I can leave all modules as is and will be able to maximize reusability,
    I haven't done this before, and was wondering what the best approach for this is?
    Thanks!

    It seems very difficult to find best practices on how to structure your database layer in FLEX. None of the books I have go into detail about it, nor do any of the websites I have found so far, including the Adobe Flex tutorials. Sure, they explain how to interact with databases, but don't seem to care about best practices for structuring your application.
    Can anyone point me in the right direction for this?
    Thanks!

Maybe you are looking for

  • Studio 12 rather unstable

    ~/src/apps/kmt/clamps> dbx ./clamps For information about new features see `help changes' To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc Reading clamps Reading ld.so.1 Reading libuuid.so.1 Reading libsocket.so.1 Read

  • Printing Crystal Report to Printer from Windows Service

    Hello Support, We are currently using 13.0.3.612 version of Crystal report. We want to print the report to the printer from the windows service. For printing the report to the printer we are using the "PrintOutputController.PrintReport" method. At ou

  • Why can't I see the social media widgets in Firefox?

    I have noticed that the social media widgets "follow" on both FB and Twitter seem to show up fine in Chrome but fail to appear in Firefox. What can I do to rectify this?

  • Patching JES  in whole root zone (where JES never installed in global zone)

    We ran into a problem today - we have a server (Solaris 10 x86 on 4150) with two full root zones. JES 5u1 was intsalled in each full root zone at a later date and never installed in the global zone. Now when trying to install the latest JES 5 patch c

  • Asset Depreciation Planned values

    Hi Everyone,    There is a requirement for us to pull planned as well as posted depreciation values for assets. The input for the program would essentially be Fiscal Year, selected list of asset class & cost centers. We are using the FM 'AM_SHOW_POST