LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PDA 8.5: Calling the Windows user32 dll MessageBox function results in unknown fonts (empty square characters) in the displayed message box

I'm calling the Windows user32.dll MessageBox function from a LabView PDA 8.5 VI.  When it runs on the emulator or the PDA target, the characters in the two strings passed to the function, ipText and ipCaption, are displayed as empty squares (indicating an unknown font, I think).  Also, the VI name at the top of the front panel changes from intelligible characters to empty squares while the MessageBox is displayed.
 
MSDN describes the MessageBox parameters the same way for both Windows XP and Mobile.  The strings are of type LPCTSTR, which translates to a LabView parameter type of string, format of C string pointer, no minimum size.
 
I've tried setting the string parameters to constants in the library call configuration.  I've tried setting the font of the input strings to every available choice on the block diagram pulldown (in desperation, I'm sure those choices are for the block diagram display only).  No joy.
 
Any help would be appreciated.
 
 
0 Kudos
Message 1 of 5
(9,774 Views)

I just realized that the library call is configured to C:\Windows\system32\user32.dll instead of the dll on the PDA.  I don't seem to be able to browse the PDA during configuration.  There is no user32.dll on the PDA, there is a user.dll.  There's no C drive either, I think the directory is simply \Windows on the PDA.

Anyone know how to select the correct dll for a library call on a PDA?

0 Kudos
Message 2 of 5
(9,766 Views)

As the light bulb goes off over my head...  LabView is creating an executable, using the Windows XP dll.  I'm surprised it works as well as it does.

I suppose i need a Microsoft development platform to call the indows Mobile dlls on the PDA.

0 Kudos
Message 3 of 5
(9,754 Views)


Dan57 wrote:

As the light bulb goes off over my head...  LabView is creating an executable, using the Windows XP dll.  I'm surprised it works as well as it does.

I suppose i need a Microsoft development platform to call the indows Mobile dlls on the PDA.



A few things here. user32 does not export MessageBox but MessageBoxA and MessageBoxW. You want to use MessageBoxA since LabVIEW strings are ASCII strings too.
 
Then try to just enter user32.dll in your library name, without the whole path. LabVIEW might change that back to the whole path when you dismiss the dialog but it does normally make a difference. Full paths are apparently (in some LabVIEW versions) considered to be user DLLs while the name only seems to be considered a system DLL. Not sure about the exact details here as it also seemed to have changed slightly between versions. System DLLs will not be copied into a build by LabVIEW, user dlls will.
 
The Windows CE system is built a bit different but there should be shared libraries which export most of the standard 32bit API somehow. There is also an application note somewhere on this site about calling external code in LabVIEW PDA , mostly when you have your own DLLs which requires the real DLL for the target and a stub DLL for the host platform to satisfy the linker requirements while the application is built. I'm pretty sure it can give you some more detailed insight into the nitty gritty details of DLLs in LabVIEW PDA.
 
Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(9,725 Views)

rolfk wrote:

There is also an application note somewhere on this site about calling external code in LabVIEW PDA , mostly when you have your own DLLs which requires the real DLL for the target and a stub DLL for the host platform to satisfy the linker requirements while the application is built. I'm pretty sure it can give you some more detailed insight into the nitty gritty details of DLLs in LabVIEW PDA.


Here is the application note rolfk spoke of: How to Call External Code in LabVIEW PDA for Pocket PC or How to Call External Code in LabVIEW PDA for Palm OS. Since you're using Windows Mobile, see the link for PocketPC and this example, Calling External Code in LabVIEW for Pocket PC - Battery Information Example. There's also an example in the Example Finder called "Calling External Code - DLL Method.lvproj" that may help you get started as well. I hope this helps!

0 Kudos
Message 5 of 5
(9,589 Views)