Board index » cppbuilder » Optional parameters in DLL call?

Optional parameters in DLL call?


2006-02-21 05:10:03 AM
cppbuilder28
Hi,
Is it possible to use optional parameters in a dll-call?
I have:
extern "C" int __declspec(dllexport) __stdcall MYDLL (
char *file_in,
char *file_out
)
and would like something like this:
extern "C" int __declspec(dllexport) __stdcall MYDLL (
char *file_in,
char *file_out,
optional char *logfile,
optional int method
)
Thanks in advance!
Peter
 
 

Re:Optional parameters in DLL call?

Hi,
I think you could overload the two functions, I mean put the prototypes
you need to export. I think that could work.
Peter Slabber escribi?
Quote
Hi,

Is it possible to use optional parameters in a dll-call?

I have:

extern "C" int __declspec(dllexport) __stdcall MYDLL (
char *file_in,
char *file_out

)

and would like something like this:

extern "C" int __declspec(dllexport) __stdcall MYDLL (
char *file_in,
char *file_out,
optional char *logfile,
optional int method

)

Thanks in advance!

Peter
 

Re:Optional parameters in DLL call?

"Peter Slabber" < XXXX@XXXXX.COM >wrote in message
Quote
Is it possible to use optional parameters in a dll-call?
Only if the exported function(s) use the __cdecl calling convention. But
then your function(s) are no longer usable in environments that do not
support that convention (VB, for example).
Gambit
 

{smallsort}

Re:Optional parameters in DLL call?

Remy Lebeau (TeamB) wrote:
Quote
"Peter Slabber" < XXXX@XXXXX.COM >wrote in message
news:43fa2f30$ XXXX@XXXXX.COM ...

>Is it possible to use optional parameters in a dll-call?

Only if the exported function(s) use the __cdecl calling convention. But
then your function(s) are no longer usable in environments that do not
support that convention (VB, for example).


Gambit


Hmmm,
I was a little afraid of an answer like that.
Thanks for your answers!
Peter