Page 1 of 1

Windows DLL Help

Posted: Tue Jul 10, 2018 4:34 pm
by ASF
I am using Liveocde Indy 9.0 and am trying to use Windows DLL via livecode external I have Visual Studio 2017 and used the following article which seems a little dated. I could use some insight and help to get it to work.
I am stuck with not being able to actually invoke the funciton that the example talk about. In Livecode I am getting an error invoking the external function. I have PATHs setup in PATH variable as well through the External Helper. I have also updated the Windows SDK tool to reflect the SDK version 10 and not the version 8.0 as prescribed in the tutorial.

Anyone out there worked successfully with calling functions in Windows DLL? I have Windows 10

livecode. wikia . com/wiki/Working_with_DLL

Re: Windows DLL Help

Posted: Tue Jul 10, 2018 5:14 pm
by Klaus
Hi Azim,

welcome to the forum!

I had a look at the lesson and it is made for LC 2.4xxx, so it is not only outdated, but completely out-of-date. And it was meant to create a windows DLL from scratch and never meant for any interaction between LC and existing Windows DLLs!

I am not an expert, but I tink the days of creating and using DLLs for specialized tasks in LC are over, once LC introduced "Livecode Builder" in LC 8.

Please open the dictionary, select "Guide" on the topleft corner, scroll to "Extending Livecode" and start reading. That is the future of LC!


Best

Klaus

Re: Windows DLL Help

Posted: Wed Jul 11, 2018 1:00 pm
by MaxV

Re: Windows DLL Help

Posted: Wed Jul 11, 2018 1:04 pm
by Klaus
MaxV wrote:
Wed Jul 11, 2018 1:00 pm
Did you read this post? https://livecode.wikia.com/wiki/Working_with_DLL
Yes, he is referring to exactly this lesson in his intitial posting!

Re: Windows DLL Help

Posted: Thu Jul 12, 2018 12:12 am
by capellan
Time ago, Ken Ray posted instructions to use a Non-LiveCode DLL with LiveCode
(named Revolution, back then):
http://www.sonsothunder.com/devres/live ... ext002.htm

There are many other useful tips in his website:
http://www.sonsothunder.com/devres/live ... vecode.htm

DataGrid-TextEncoding-SQLSERVER

Posted: Thu Jul 19, 2018 5:12 pm
by ASF
The Collation on the SQLSERVER database that I am using is SQL_Latin1_General_CP1_CI_AS

My Query to extract the customer table is as below. When I hardcode something like lastname like 'F%' it is working. Whenever I am using the search field for userinput, the datagrid is empty. I understand it is a TextEncoding issue, I simply dont know how to encode the tFirstName and tLastName local variables.

Thank you in advance

put "select lastname, firstname from customer" into tQueryString
set itemdel to tab
put item 1 of tSearchString into tFirstName

put item 2 of tSearchString into tLastName

put "%" after tLastName

put "% " after tFirstName

put " where lastname like " & "'" & tLastName & "'" & " and first name like " & "'" & tFirstName & "'" after tQueryString

..

..

// Connect to the Database

put revOpenDatabase("ODBC","DRIVER=SQL Server;SERVER=" & gServer & ";DATABASE=" &gdatabase & ";UID=" & gUsername & ";PWD=" & gPassword & ";Trusted_Connection=No",,,) into tConnID


set the dgData of group "Customer DataGrid" to empty

put revdatafromQuery(,,tConnID,tQueryString)into theDataGridArray

set the dgText of group "Customer DataGrid" to theDataGridArray