dupa

Author Topic: VB with DLL???  (Read 3188 times)

prichard

  • Newbie
  • *
  • Posts: 7
    • View Profile
VB with DLL???
« on: June 13, 2007, 05:10:28 pm »
Simple VB experiment:

Dim chALBRAIN As New brain

Private Sub Command1_Click()

   Set chALBRAIN = New brain

   Text1 = chALBRAIN.ChooseSentenceFromFile("paraphrase")

End Sub

Doesn't work.

What is the problem? Is it the literal underline of the "paraphrase" filename? Or is initialization necessary...
 

prichard

  • Newbie
  • *
  • Posts: 7
    • View Profile
VB with DLL???
« Reply #1 on: June 14, 2007, 03:15:10 pm »
It works!

I used a textbox and the dLL returned the line with vbCRLF so it wiped the text.

Also the path was insufficient. When I put the dLL in the VB98 project folder the path was at VB98 folder. I appnded the path to access the hAL brainfiles properly.

SpyDaz Class file is extremely helpful.

Moving forward to creating the script functions in VB.

I'm more intrigued by what hAL can do with background process capabillity.

Will be trying to figure out how to analyze some Encarta texts. Emulating the Brain Editor textfile leaning functions will have high priority.

I have an HTML parser.


-



-
 

prichard

  • Newbie
  • *
  • Posts: 7
    • View Profile
VB with DLL???
« Reply #2 on: June 17, 2007, 11:44:28 am »


Download Attachment: 2007615185158_hALdemo.zip

This simple file demonstrates the DLL use from VB.

-
 

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
VB with DLL???
« Reply #3 on: June 23, 2007, 07:47:19 am »
When creating the VB PRoject ADD a REFERENCE to Ultrahalassist.dll

not add Component...

Option explicit
Public UhBrain as NEW Brain

Private Sub Command1_Click()
'Remember that the brain you are using Should be UHAL5
'If you are ussing uhal6 then your HALBRAIN.db should be in the same folder where the project is compiled. in vb the halbrain.db may also need to be in the defalt project directory for on the fly testing....



Text1 = UhBrain.ChooseSentenceFromFile("paraphrase") 'hal6

End Sub

I have found that using the hal5 dll works the best as the hal.db file is not easy to Browse. where as the hal5 dll works fine with textfiles .... And you can use ADO, in VB so you can customize you db more better in MSACESS, Which also uses SQL to search the DB for data{QUERY}...