Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please. Help call me call OCI in Foxpro...a DLL Question
Message
From
25/02/1999 21:38:33
 
 
To
25/02/1999 04:00:50
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00191311
Message ID:
00191748
Views:
13
The parameters (some of them) of this function are pointers to functions. There's no way to have/use pointers to functions from VFP. So, it's not possible to use this function. The only solution is to write a dll that would expose the functionality of the functions you need in a VFP compatible mode... if possible.

Vlad

>How can I make a C call like:
>(void) OCIInitialize (OCI_THREADED | OCI_OBJECT, (dvoid *)0,
> mymalloc, myrealloc, myfree);
>
>I am trying to run a dll in foxpro but I am not very good at
>this.
>I tried ...
>#define SX_ORACLE
>#define SX
>#define ORATYPES
>#define ub4 int
>
>#define TRUE 1
>#define FALSE 0
>
>DECLARE INTEGER OCIInitialize IN Ociw32.dll as OCIInitialize
>
>I have no idea..!!!!
>Any hints!!!!
>
>
>From VFP where: OCIIntialize is:
>
>sword OCIInitialize ( ub4 mode,
> CONST dvoid *ctxp,
> CONST dvoid *(*malocfp)
> (/* dvoid *ctxp,
> size_t size _*/),
> CONST dvoid *(*ralocfp)
> (/*_ dvoid *ctxp,
> dvoid *memptr,
> size_t newsize _*/),
> CONST void (*mfreefp)
> (/*_ dvoid *ctxp,
> dvoid *memptr _*/));
>
>Notes: From the .h file
>typedef unsigned int ub4;
>
>#ifdef lint
># define dvoid void
>#else
>
>
>Further more here is more info on the call..
>Parameters
>
>mode (IN)
>
>Specifies initialization of the mode. The valid modes are:
>
> OCI_DEFAULT - default mode.
> OCI_THREADED - threaded environment. In this mode, internal data structures not exposed to the user
> are protected from concurrent accesses by multiple threads.
> OCI_OBJECT - will use object features. ctxp (IN)
>
>User defined context for the memory call back routines.
>
>malocfp (IN)
>
>User-defined memory allocation function. If mode is OCI_THREADED, this memory allocation routine must
>be thread safe.
>
>ctxp (IN/OUT)
>
>Context pointer for the user-defined memory allocation function.
>
>size (IN)
>
>Size of memory to be allocated by the user-defined memory allocation function
>
>ralocfp (IN)
>
>User-defined memory re-allocation function. If mode is OCI_THREADED, this memory allocation routine
>must be thread safe.
>
>ctxp (IN/OUT)
>
>Context pointer for the user-defined memory reallocation function.
>
>memptr (IN/OUT)
>
>Pointer to memory block
>
>newsize (IN)
>
>New size of memory to be allocated
>
>mfreefp (IN)
>
>User-defined memory free function. If mode is OCI_THREADED, this memory free routine must be thread
>safe.
>
>ctxp (IN/OUT)
>
>Context pointer for the user-defined memory free function.
>
>memptr (IN/OUT)
>
>Pointer to memory to be freed
>
>Comments
>
>This call initializes the OCI process environment.
>
>OCIInitialize() must be invoked before any other OCI call.
>
>This function provides the ability for the application to define its own memory management functions through
>callbacks. If the application has defined such functions (i.e., memory allocation, memory re-allocation, memory
>free), they should be registered using the callback parameters in this function.
>
>These memory callbacks are optional. If the application passes NULL values for the memory callbacks in this
>function, the default process memory allocation mechanism is used.
>
>Example
>
>The following statement shows an example of how to call OCIInitialize() in both threaded and object mode,
>with no user-defined memory functions:
>
>OCIInitialize((ub4) OCI_THREADED | OCI_OBJECT, (dvoid *)0,
>
> (dvoid * (*)()) 0, (dvoid * (*)()) 0, (void (*)()) 0 );
Previous
Reply
Map
View

Click here to load this message in the networking platform