DLL function with variable argument list ?

DLL function with variable argument list ?

Post by Ernst Kloeck » Tue, 19 Sep 1995 04:00:00




>is it possible to export DLL functions with a variable argument
>list ?
>DLL functions are usually declared using the PASCAL calling
>convention which does not allow that.
>I would like to declare some functions using the C calling
>convention. I know these functions could only be accessed
>by C in this case, but I wouldn't mind that.
>The functions are supposed to be exported, so that other
>DLLs and the main program can call them.

Sorry to follow up my own post, but I just tried to export
a DLL function without the PASCAL keyword, and guess what
it worked. (I could call the function with a variable argument
list from another DLL, no problem).

So is there any reason not doing that ?

Cheers, Ernst.
--
-------------------------------------------------------------------------

-------------------------------------------------------------------------

 
 
 

DLL function with variable argument list ?

Post by David Conn » Tue, 19 Sep 1995 04:00:00


original post deleted

Quote:>Sorry to follow up my own post, but I just tried to export
>a DLL function without the PASCAL keyword, and guess what
>it worked. (I could call the function with a variable argument
>list from another DLL, no problem).

>So is there any reason not doing that ?

Yes.  If my compiler has PASCAL as its default calling convention, it won't
work.  Just replace PASCAL with cdecl.

--------------------
Dave Connet

My opinions are my own.  I think...

 
 
 

1. Howto call a variable argument function from another variable argument function?

Hi,

Is there a SAFE way to call a variable argument function from another
variable argument function passing the variable arguments (see sample).
All I can think about is using the va_list / va_start/va_arg macro's, but
since I don't known the number and size of the arguments it is not safe!

Any bright ideas??

Thanks,
Marc.

Code sample.
void Fun1( char *lpStr, ... ){
    //... Do something

void Fun2( char *lpStr, ... ){

    Fun1( lpStr, ??? )


      [ about comp.lang.c++.moderated. First time posters: do this! ]

2. spie.sty?

3. Variable List of arguments to a function

4. Manufacturing with OLE for Design and Modelling

5. macro definition for function with variable argument list

6. JFS and NFS client tuning question

7. Variable argument lists in DLL?

8. Logica Inc. - FL- Software Test Engineer

9. DLL function with variable argument

10. Access variable-argument lists.

11. variable argument lists

12. Variable argument list

13. Variable Argument List