Paul Bennett wrote:
> I am trying to create a Crystal 8 User Defined Function dll which
> takes a single integer as a parameter and packs that integer up into
> a broadcast Message as the wparam parameter.
>
> My code is shown below.
>
> function LaunchApplication (ParamBlock : PUFParamBlock) : UFError;
Is this the function exported by your DLL? It should probably use the
stdcall calling convention, not register.
> var Param1 : PUFParamListElement; //a pointer to the first parameter
> var n : integer;
> fWakeup : Cardinal;
> MyWakeup: PChar;
> begin
> Param1 := GetParam (ParamBlock, 1); //the first param is the AppID
> to launch
> //check if the correct number of parameters is passed to our
> function
>
> if (Param1 = nil) then
> begin
> MyWakeup := Error;
> fWakeup := RegisterWindowMessage(MyWakeup);
> If fWakeup <> 0 Then
> nResult := PostMessage(hWnd_BROADCAST, fWakeUp, n, n);
What is the value of n?
Why are you storing an error string in a variable named fWakeup, as though
it's the same status the wakeup message you store in that variable later?
Go ahead and use different variables with appropriate names. It will make
the code easier to read.
And what is nResult?
--
Rob
.