Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable-length parameter list in DllImports

Status
Not open for further replies.

chiph

Programmer
Jun 9, 1999
9,878
US
I need to call into a Win32 DLL where the function prototype has a variable-length parameter list (much like the printf function in classic C).

I suspect using parameter-arrays may work, but curious if anyone has done this yet.

Thanks.
Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Hi chiph,
You can do that using RunTimeArgumentHandle and ArgIterator classes (structures). I have not an working example (with a WIN32 DLL) now to post here but the RunTimeArgumentHandle structure is the only one that support C/C++ functions that take a variable number of arguments.
-obislavu-
 
Cool, thanks. I hadn't seen those structures. I'll take a look (it'll be a few days, I just got pulled off onto something else).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top