PDA

View Full Version : Custom DLL - User Interaction



NewsArchive
04-22-2010, 01:17 AM
I have a custom DLL with a number of procedures I am calling from a SB7
script.
Does anyone know if there is a problem with opening a window in a Custom
DLL that gets interaction from the user (ie, the user presses a button or
enters text and presses a button)?
My SB program is GPFing after calling my custom dll if I prompt the user to
interact with a window.

I have a tested a number of scenarios.
1) I have a Clarion window open and do something on Event:OpenWindow and
then exit the window after the task so the user never interacts with the
window. This works fine.
2) Open the window and allow the user to enter a field and press OK. This
is GPFing.
3) Open the same window and press cancel. This is GPFing. There is no code
in the Cancel button except Post(Event:CLoseWindow)
4) hard-code the value the user is entering in the window and perform the
operations (in Clarion) without opening the window. This works fine.

This is completely source. The window is very simple:

I just noticed that none of the example DLL SB projects have a Clarion
window with Accept loop. There are some MESSAGE statements but no accept
loops.
Is this a limitation of the DLL interface? If so, no problem I can rework
to prompt the user for the values in the SB interface and pass the values
to the DLL. I wanted to check here before taking that option.

I'm using SB 7.2860 and Clarion 6.3.9058. As I mentioned other functions
form the DLL work fine and if I call this same function in a
non-interactive way it is fine.

Any pointers would be great.

Thanks,
Rick

NewsArchive
04-22-2010, 01:18 AM
What is the line of script you are using to call the DLL?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-22-2010, 01:19 AM
> What is the line of script you are using to call the DLL?
>

Call DLL "%TMPDIR%\sbdll_support.dll" -- Function "VALIDSQLCONNECTION"
(*CSTRING,*CSTRING,*CSTRING,*LONG, LONG)
(%SQLINSTANCE%,%_SB_INSTALLDIR%,%PRODUCTVER%,%FOUN DDB%,1)

Rick Martin

NewsArchive
04-22-2010, 01:19 AM
Sorry, the prototype of the procedure is:
ValidSQLConnection PROCEDURE (*CSTRING pSQLServer, *CSTRING pPath, *CSTRING
pProductVersion, *LONG pFoundDB, LONG pQuiet) !,LONG,PASCAL ! Generated
from procedure template - Window

Rick Martin

NewsArchive
04-22-2010, 01:20 AM
We have one window where the user can press a button.

Haven't heard of a crash.

Nothing fancy at all.


Jeff Slarve

NewsArchive
04-22-2010, 01:21 AM
Hi Rick,

> I just noticed that none of the example DLL SB projects have a Clarion
> window with Accept loop. There are some MESSAGE statements but no accept
> loops.
> Is this a limitation of the DLL interface? If so, no problem I can rework
> to prompt the user for the values in the SB interface and pass the values
> to the DLL. I wanted to check here before taking that option.

Here is a Clarion example with an ACCEPT LOOP:

Binary:
http://www.lindersoft.com/projects/Mike_Call_Dll_Exe.zip

Source Codes:
http://www.lindersoft.com/projects/Mike_Call_Dll_Src.zip

By the way, IIRC, Clarion DLLs with a "TIP" attribute on a BUTTON can cause
a stack-corruption.

Does this help?

Friedrich

NewsArchive
04-23-2010, 02:18 AM
>
> By the way, IIRC, Clarion DLLs with a "TIP" attribute on a BUTTON can cause
> a stack-corruption.
>

Friedrich,
You da man. It was a TIP on an ENTRY control.
I don't how I would have found that. Perhaps something could be added to
FAQs?

Thanks,
Rick

NewsArchive
04-23-2010, 02:19 AM
Dang.

Jeff Slarve