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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

define class in project - build to dll

Status
Not open for further replies.

monkey666

Programmer
Oct 18, 2002
34
EU
Afternoon,

Just learning how to create ActiveX dlls and need a bit of help.

I have a project which contains only a prg file with the following:

*********************************************
DEFINE CLASS myclass as custom olepublic

FUNCTION Myfunc (cTextin as String)
ctextout="Hello"+ctextin
RETURN ctextout
ENDFUNC

enddefine
************************************************

I can then build the project into a single thread dll - named mydll.dll

from a seperate form I have a command button with the code:
********************

DECLARE string Myfunc IN "mydll.dll";
string cTextin

creturn=Myfunc("monkey")

MESSAGEBOX(creturn)

********************

The error i get is "Entry point Myfunc not found in mydll"

What would the entry point be? The class or the function?

This is the first time i have used define class programmatically so that may also contain errors.

Help much appreciated.

Monkey



 
Monkey,
Try:
Code:
ox = createobject("mydll.myclass")
creturn = ox.Myfunc("monkey")
MESSAGEBOX(creturn)
COM DLL's are never DECLARED and called. You need to create an object and invoke a method.

Rick
 
Thanks.

I would like to discontinue this as I have created the dll in VB

monkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top