Re: Function pointers for DLL functions?
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sat, 02 Dec 2006 00:13:48 -0500
You could use the VARIANT type. But then, you've just made significant progress in making
a bad reimplementation of ActiveX. For what you want to do, it just screams "ActiveX"
joe
On Fri, 1 Dec 2006 12:59:53 -0600, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote:
Joseph M. Newcomer [MVP]
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:%23dk%234MXFHHA.1232@xxxxxxxxxxxxxxxxxxxxxxx
Peter,
No, DLLs do not work this way, although you could pass a pointer to a
structure or whatever, which the DLL could then access.
How would I dynamically pass parameters selected at run-time to a DLL
function using function pointers to the DLL? What is the syntax for this?
For example a user enters a number into an EditBox of a program, how do I
pass this number to the DLL using function pointers? What is the syntax for
this?
You could create a class or structure that contains the arguments. For
example, you could pass an argument count followed by a pointer to an array of
arguments. You could include additional information if argument type data was
required. It depends on what you need, but you can pass data to the DLL
function just like you'd pass it to any other function. But I would certainly
think you would need some standard structures that describe the arguments
rather than trying to passing the data directly using C++ arguments.
I want to create an interpreted language that the user can extend by adding
new functions to the interpreted language, and writing these functions in
C++. AutoCAD uses this same method to extend the capabilities of its product.
Their system is called ObjectARX. I want to duplicate this capability for my
language.
I'm not familiar with ObjectARX. COM provides a bit more functionality, if
that's what it uses. But why not just come up with a standard function
signature, something like this:
BOOL pFunction(int nNumArgs, CArg *pArgArray);
That seems to be a good idea, and the *pArgArray can point to an array of items
that can be be any type. These are created by a union, and distinguished by an
integer TypeNumber. What is the syntax for calling such a function?
And define a CArg class that contains whatever data you need. That should be
enough functionality for most operations.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Function pointers for DLL functions?
- From: Peter Olcott
- Re: Function pointers for DLL functions?
- From: Ajay Kalra
- Re: Function pointers for DLL functions?
- From: Peter Olcott
- Re: Function pointers for DLL functions?
- From: Jonathan Wood
- Re: Function pointers for DLL functions?
- From: Peter Olcott
- Re: Function pointers for DLL functions?
- From: Jonathan Wood
- Re: Function pointers for DLL functions?
- From: Peter Olcott
- Function pointers for DLL functions?
- Prev by Date: Re: Function pointers for DLL functions?
- Next by Date: Re: repetition within randomization
- Previous by thread: Re: Function pointers for DLL functions?
- Next by thread: Re: Function pointers for DLL functions?
- Index(es):
Relevant Pages
|