Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in VFP9?
Message
 
 
To
26/03/2019 14:45:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01667575
Message ID:
01667645
Views:
77
Hi,

I have related question. I think I recall that calling someFunction(@tcLongString) is quicker than someFunction(tcString) if we don't make any changes with tcString inside the function.

Do I remember correctly and it's indeed better to use first syntax?

Thanks in advance.

>Does anybody have any experience passing parameters by reference to a DLL, with a DLL that uses SendMessage() to call back into the running VFP9 app?
>
>I think I've found a bug where if you do this, the initiating function loses its by-reference context and doesn't update the variables updated in the DLL upon return.
>
>Example flow:
>lcUpdateVar = SPACE(32)
>VFP9 calls some_function(@lcUpdateVar) in DLL
>some_function() issues SendMessage() to call back into the VFP9's _vfp.HWnd, to which a BINDEVENT() has been added to capture a particular message.
>VFP9's handler for that message does something and returns.
>some_function() goes to update lcUpdateVar with the text "Hi, mom!" and returns
>
>When VFP9 returns from some_function() and goes to the next VFP9 source code line, the value lcUpdateVar is not updated.
>
>If I disable the SendMessage() callback, it works.
>
>I'm wondering if anyone knows of this bug in VFP9? Or a way around it? I'm using _stdcall in the DLL and all parameters are aligning. It only seems to fail when I use SendMessage() to call back, making me think something in VFP9 is being altered to where it loses the by-ref parameter reference, and just ignores the return values when it comes back.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform