Windows DLL Help

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
ASF
Posts: 2
Joined: Tue Jul 10, 2018 4:06 pm

Windows DLL Help

Post by ASF » Tue Jul 10, 2018 4:34 pm

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

Klaus
Posts: 10169
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Windows DLL Help

Post by Klaus » Tue Jul 10, 2018 5:14 pm

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

MaxV
Posts: 1509
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Windows DLL Help

Post by MaxV » Wed Jul 11, 2018 1:00 pm

Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 10169
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Windows DLL Help

Post by Klaus » Wed Jul 11, 2018 1:04 pm

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!

capellan
Posts: 441
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: Windows DLL Help

Post by capellan » Thu Jul 12, 2018 12:12 am

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

ASF
Posts: 2
Joined: Tue Jul 10, 2018 4:06 pm

DataGrid-TextEncoding-SQLSERVER

Post by ASF » Thu Jul 19, 2018 5:12 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”