Jump to content

A basic question: how to use a dll


Recommended Posts

I am recently learning how to use those useful dlls coming with Windows. But the header part of the dll file is all confusing to me :headbang: , like this one:

uint32_t SystemParametersInfoW(int32_t uAction, int32_t uparam, CStr lpvParam, int32_t fuWinIni); :lightbulb:

which is one method in user32.dll. Cannot even understand what those parameters are supposed to mean.

Anywhere I can search or figure out how to use these dlls? Appreciate it. :worship:

Link to comment

QUOTE(menghuihantang @ Dec 9 2007, 09:26 PM)

Yes, http://msdn.microsoft.com/' target="_blank">MSDN (Microsoft Developer Networks) is your friend for any Windows API question. If it's not there it is undocumented and that means any other information you can find on the net might be right or completely off the tracks.

As far as to your function prototype, where the heck did you get that from? It uses datatypes Microsoft never used so far and is also inherently wrong. The W suffix to the function indicates that it is a Widechar (16bit Unicode) function, but the third parameter is CStr, which is basically an 8 bit ANSI string. That simply can't be right.

TIP: When searching for a WinAPI function on MSDN, never use the function name with the A or W suffix. While those functions are exported with the W or A suffix, Microsoft considers them equal as far as documentation is concerned. Which one is used and pulled in gets decided during compilation, based on preprocessor settings. For LabVIEW you always want to use the A version since LabVIEW strings are 8 bit MBC strings.

For the general understanding of these things: Knowing a good bit of C will help very much. The DLL calling interface is inherently C based and so are all its terms and conventions. That means that the Call Library Node can't really make it in any other way either, as unfriendly that interface can look to a LabVIEW only programmer. And that means as tempting those API calls could seem to you, without learning some basic C knowledge first you are really in for a hard ride with lots of crashes when you go down that road.

Rolf Kalbermatter

Link to comment

QUOTE(rolfk @ Dec 10 2007, 01:16 PM)

Ok, found the name. It's Relf, who has a book on imaging stuffs.

Well, a book can be a collection of articles, a working progress I guess :thumbup:

Link to comment

QUOTE(menghuihantang @ Dec 10 2007, 05:32 PM)

That is our resident http://forums.lavag.org/crelf-m181.html' target="_blank">LAVA champion in number of posts. He has for anything and everything here on LAVA an answer, but sometimes it is tongue in cheek. But he seems to slow down recently. Probably due to his preparations for a travel back home to down under.

And his book on LabVIEW imaging is quite good.

Rolf Kalbermatter

Link to comment

QUOTE(rolfk @ Dec 11 2007, 04:56 PM)

That is our resident http://forums.lavag.org/crelf-m181.html' target="_blank">LAVA champion in number of posts. He has for anything and everything here on LAVA an answer, but sometimes it is tongue in cheek. But he seems to slow down recently. Probably due to his preparations for a travel back home to down under.

Actually, it's because I've been absolutely flat ou at work :) I've recently changed positions at V I Engineering, Inc - I'm now the Chief Software Architect, and I've been busy during the transition period. That said, my new position will afford me even more time to work on technical solutions, ergo bother you good people here at LAVA even more :D

PS: I'll be offline for a couple of week - as you suggested, I'm heading home and I'm *gulp* not even taking my laptop with me :unsure:

Link to comment

QUOTE(rolfk @ Dec 12 2007, 06:51 PM)

Could that be because of intervention by some other significant person? :rolleyes:

Yes, but in a very roundabout way - I pack very light when I travel, so she's taken the "opportunity" to fill my remaining luggage allowance (including that which I can carry) so there's no room for the laptop. That said, I'll have plenty to keep me busy on my vacation - friends, family, beer, lamb roasts, real beef sausages, cricket...

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.