Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and Clarion Dlls 2

Status
Not open for further replies.

JannieE

Programmer
Oct 8, 2003
1
ZA
Is it possible to access clarion dll's from a
VB application?

I've tried to register the dll with regsvr32.exe
but it cannot find the DllRegisterServer entrypoint.

When I try to create an entrypoint, clarion creates
it as DllRegisterServer@F, which regsvr32.exe
doesn't pick up as well.
 
I do not know much about VB, but from what I know VB DLL's are Object (ActiveX) DLL's which do not export all its procedures whereas CLarion DLLs are similar to Windows DLLs. So I would assume that you have to access the Clarion DLLs in a similar fashion as Windows DLLs in VB.
 
Hi,

It is possible to do this and it is also quite easy.
Declare a function in your clarion App like that :

MyFunc(Long MyStringAddress,Long MyLong),Long,Pascal,Name('MYFUNC')

In VB the code to use it is :

Public Declare Function MYFUNC Lib "ClarionDLL" (ByVal MyStringAddress As String, ByVal MyLong As Long) As Long

You need to pass the address of a string, but you can pass directly a long.

In Clarion to get a string from its address use the window APi lstrcpy

lstrcpy(address(MyString),MyStringAddress)

the same in VB.

The easiest is to use only long for parameters / return values.

No ActiveX or DLL registration... etc. Just be carefull with the paths.

I have an example APp if you want.

Valery.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top