In order to make my code faster, I'm utilizing an option of a DLL
function to save a state internally.
I'm using a DLL function w/ following prototype:
Code:
int SOMEFUNCTION(double this, void that, . . . , int *phandle)
The handle allows for internal state to be saved but I am really
having trouble with syntax and a concept. In the description of
the parameters phandle it says:
. . . it is necessary to pass a pointer to a long integer for
phandle. phandle will store a handle that is used for each
following call to SOMEFUNCTION. Call SOMEFUNCTIONCLOSE
when done.
I've tried various approaches, but none have worked. I did get it
to compile once with the following:
Code:
int *phandle;
for (blah blah blah){
.
.
.
iReturn SOMEFUNCTION(stuff, . . . , phandle);
.
.
.
}//end for
SOMEFUNCTIONCLOSE(phandle);
Once I ran the code above I got a runtime error that phandle was
not initialized. What value should I put in phandle? I think that
my problem is that I am not understanding how to set ". . . a
pointer to a long integer. . . "
Could someone please help me understand what they mean?
Also one more question, this for loop is executed many times. Is
it necessary to declare this pointer outside of the scope of the for
loop in order for the state to be "saved?"
Thanks for your time.