How to use .dll file

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

How to use .dll file

Post by sudip »

Hi All,
I want to convert some of my old VFP routines into HMG. I am facing problem regarding some functions for barcode printing. For that perticular barcode printer, I need to use .dll files. But I don't know how to convert following code (with .dll file):

Code: Select all

local i, j, mRecno, mBarcode, lFstCol, nCopyno, mColctr, mGrndtStr, mLookupStr, mFinalStr, mRowCtr, ;
	mBarcode1, mBarcode2

declare openport in C:\ajanta\tsclib.dll  string
declare closeport in C:\ajanta\tsclib.dll
declare sendcommand in C:\ajanta\tsclib.dll 
declare setup in C:\ajanta\tsclib.dll  string,string,string,string,string,string,string
declare downloadpcx in C:\ajanta\tsclib.dll  string, string
declare barcode in C:\ajanta\tsclib.dll  string,string,string,string,string,string,string,string,string
declare printerfont in C:\ajanta\tsclib.dll  string,string,string,string,string,string,string
declare clearbuffer in C:\ajanta\tsclib.dll
declare printlabel in C:\ajanta\tsclib.dll  string,string
declare formfeed in C:\ajanta\tsclib.dll 
declare nobackfeed in C:\ajanta\tsclib.dll
declare windowsfont in C:\ajanta\tsclib.dll  integer,integer,integer,integer,integer,integer,string,string 
Thanks in advance.

With best regards.

Sudip
With best regards,
Sudip
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to use .dll file

Post by sudip »

Should I use

CallDll32 ( <cFunctionName> , <cDllName> , ... <parameters> ... ) --> xReturnValue

I am trying with it.

Regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to use .dll file

Post by Rathinagiri »

I think you can use calldll32 function. This is from c:\hmg\samples\dll\demo.prg series.

Code: Select all

CallDll32 ( "sndPlaySoundA" , "WINMM.DLL" ,  "sample.wav" , 0 )
CallDll32 ( "GetWindowText" , "USER32.DLL" , GetFormHandle ('Win_1') , @Buffer , 128 )
So, you can call like the below:

calldll32("openport","tsclib.dll",string)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to use .dll file

Post by sudip »

Hello,
I wrote:

Code: Select all

CallDll32("openport", "tsclib.dll", "TSC TTP-245")
And it works. :) Thanks a lot.
Now, is there any way to create a library from .dll file, so that we don't have to send .dll file separately. (may be I am asking for a silly question :lol: )
With best regards.
Sudip
With best regards,
Sudip
Post Reply