Software Archive
Read-only legacy content
17060 Discussions

Using evaluation DLLs

Deleted_U_Intel
Employee
635 Views
I am new to the list, and spell check showed my post all jumbled up.
If that is how it will come across, I apologize

I'm trying to use a DLL for evaluation purposes.

Here is what the authors suggested I should use for VB:
 
DataToEncode = InputString.Text 
'Format the Output by calling the DLL 
'Make sure to add the COM Server DLL to the references!! 
Dim DMFontEncoder As DMATRIXLib.Datamatrix 
Set DMFontEncoder = New Datamatrix 
DMFontEncoder.FontEncode DataToEncode, 0, 0, 0, Printable_string 
'Printable_string contains the data formatted for the font 
PrintableBarcodeString = Printable_string 


This is the encoder DLL that formats the Data Matrix font. It can be found in the system directory after installation. Because it was created with C++ using ATL, it is small and has no dependencies.

How can I use it w/cvf?

Here is what I tried following a sample from the cvf's CD:

Program Test_2d_Barcode 
use kernel32 
INTERFACE  
SUBROUTINE rtn_FontEncode(STR_IN,I_TILDE,I_MODE,I_PREF,STR_OUT) 
CHARACTER STR_IN*25,STR_OUT*100 
INTEGER*2 I_TILDE,I_MODE,I_PREF 
END SUBROUTINE 
END INTERFACE 
 
CHARACTER BARCODE_IN*25,BARCODE_OUT*100 
POINTER (p,i) 
POINTER (q,rtn_FontEncode) 
 
	 
BARCODE_IN = '1234512340123456789801010' 
 
p = loadlibrary("IDAutomationDMATRIX.DLL"C) 
Q = getprocaddress(p, "dllgetclassobject"C) 
 
CALL rtn_FontEncode(barcode_in,0,0,0,barcode_out) 
WRITE(*,10) BARCODE_OUT(1:25) 
10 FORMAT(A,/,25(Z2,1X)) 
END 


I get a forrtl severe (157)

p returns a non-zero, whereas q returns a zero.

I have never coded anything that uses dlls written by someone else.

My son was able to get the VB code to work!!

Help please.

tia
0 Kudos
1 Reply
Intel_C_Intel
Employee
635 Views
I suggest reading the Using COM and Automation Objects chapter of the CVF Programmer's Guide. That should get you started.

hth,
JT
0 Kudos
Reply