Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: functions with optional arguments in Windows DLLs

by spurperl (Priest)
on Dec 13, 2007 at 20:08 UTC ( #656903=note: print w/replies, xml ) Need Help??

in reply to Re: functions with optional arguments in Windows DLLs
in thread functions with optional arguments in Windows DLLs

Indeed, you're right about optional arguments in C. So I guess the DLL I'm looking at (rmchart) wasn't written in C, but probably some kind of Basic). This is how the particular function I'm interested in is described:
nResult (LONG) = RMC_Draw2File( ByVal nCtrlId (LONG), ByRef sFileName (ASCIIZ), Optional ByVal nWidth (LONG), Optional ByVal nHeight (LONG), Optional ByVal nJPGQualityLevel (LONG) )
And judging by the description, the behavior I need happens when the optional args are not provided.

Replies are listed 'Best First'.
Re^3: functions with optional arguments in Windows DLLs
by BrowserUk (Pope) on Dec 13, 2007 at 20:35 UTC

    According to this, optional arguments are 'filled in' to their default values, by the compilers of languages that support them. It also says that the default values should be clearly documented.

    The upshot appears to be that you will have to pass the default values when calling from a language that does not support this behaviour. So, you will need to look up the dfault values and provide them explicitly either every time you call via Win32::API or supply a wrapper function that fills them in.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Yes, I suppose I'll have to do that. Thanks for the help.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656903]
[ambrus]: ah, it's one of thos
[Eily]: what, there's a difference between proof of concept and production?
[LanX]: 20 years ago traders were complaining about the latency of the trading system...
[ambrus]: I'm currently in the process of rewriting my proof of concept programs. They sort of developped organically as I was experimenting, so now I've got an ugly mess of multiple programs and one-liners held together by nothing. I'll have to rewrite them to som
[ambrus]: ething that's both cleanly organized and mostly automated.
LanX in train, bad connection
[Corion]: ambrus: Yeah - we're in that situation too, except that there is no time to do the reorganizing :-/
[LanX]: ... so my boss started a project with the newest sun servers and invited the traders to come on weekend to test it... and they were so pleased, that they forced him to keep it in production...
[ambrus]: Corion: sure, this is the long-term plan. The short term is that I have to run this ungodly mess to get results from the new input data today.
[Corion]: ambrus: Most of our "automation" is tied to process exit codes and a shell pipeline :-\

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2017-03-29 11:49 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (350 votes). Check out past polls.