Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a String to a DLL
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00499201
Message ID:
00500223
Vues:
24
>>>>>>What am I doing wrong?
>>>>>>
>>>>>>Stephane.
>>>>
>>>>>Have you tried declaring the paramater ByVal?
>>>>
>>>>>Is this DLL written in VB?
>>>>
>>>>This may seem like an obvious question, but do you have to register the DLL with windows?
>>>
>>>What kind of DLL is it?
>>>
>>>DLL that are to build on the COM specifications (like the ones build with VB) needs to be registered. Also, you can't «Declare» procedures from it, you need to set a reference to the component, to create an instance and use the instance:
>>>Dim X as new ComponentName.ClassName
>>>X.DoSomething
>>
>>Ok, it's a dll written in straight C and it wasn't built on my computer. I tried registering the dll (using regsvr32) but I got the "no entry point" message. I almost always get this message to a point that I think that my "regsvr32" program is corrupted. So, I wouldn't mind the message.
>>
>>Now, what do you mean when you say that I need to set a reference to the componenent?
>
>Since it is a real library, you don't have to set a reference and you can't register it.
>
>Have you changed the declaration to ByVal?
>
>Do you have the real declaration in C?


>>Here's how I declared my external DLL function in my VB program:

>>Private Declare Function make_call _
>> Lib "e:\programmes\visual basic\sync\system_call.dll" _
>> (ByRef thecommand As String) As Integer

Also a C Integer must be a Long in VB.

Try this:
Private Declare Function make_call _
Lib "e:\programmes\visual basic\sync\system_call.dll" _
(ByVal thecommand As String) As Long
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform