Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Library file MyDll.dll is invalid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01535860
Message ID:
01535861
Vues:
40
For VFP DLL you need to use createobject syntax. SET LIBRARY is used for FLL.

>Hi,
>
>I want to create a DLL. Things look good when I compile as single thread DLL. I have no message indicating that the DLL wasn't registered and, when I open the file using the object browser I can see methods and properties created.
>
>My problem is that, when I want to declare the library with SET LIBRARY TO myDLL.dll I receive the message "Library file "MyDll.dll" is invalid". It's the first time that I try to create a DLL so I don't know where is the problem.
>
>There is my code. As you will see I tried many things...
>
>
>Thanks for your help!
>
>
>*!* LPARAMETERS cAction,cData
>
>
>*!* PUBLIC cNewAction, cNewData, cRetValue
>*!* cNewAction = UPPER(cAction)
>
>*!* DIMENSION aRush(4)
>*!* STORE "X" TO aRush
>
>*!* SET CLASSLIB TO _base.vcx
>
>*!* oHandler = CREATEOBJECT("MyHandler",cNewAction)
>
>*!* *MyHandler.init(cData)
>
>*!* RETURN oHandler.value
>
>*!* *READ EVENTS
>
>
>DEFINE CLASS MyHandler AS Custom OLEPUBLIC
>* cParam = ""
> Value = "*"
>*!* FUNCTION init (cString)
>*!* * m.valeur = cString
>*!* * INSERT INTO dllTest FROM MEMVAR
>*!* * value = cString
>*!* * RETURN cString
>*!* DO CASE
>*!* CASE cString = "INSERT"
>*!* this.insert2
>*!* CASE cString = "DELETE"
>*!* this.delete2
>*!* OTHERWISE
>*!* this.other2
>*!* ENDCASE
>*!* ENDFUNC
>
> * Procédure d'insertion
> PROCEDURE Insert2
> this.Value = "J'insère"
> ENDPROC
>
> * Procédure d'effacement
> PROCEDURE Delete2
> this.Value = "J'efface"
> ENDPROC
>
> * Procédure Autre
> PROCEDURE Other2
> this.Value = "Paramètre non valide"
> ENDPROC
>ENDDEFINE
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform