Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with VFP dll in Excel
Message
De
14/01/2001 22:50:18
 
 
À
14/01/2001 19:33:10
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00463519
Message ID:
00463648
Vues:
42
Hi Matt,

I got an Idea, it may be a Bad news for you.

I got similar situation on C when I was in College.
Some of the Init Command may be NOT run again, Even you recall it in line!

Especially, When you call some external Command, such as SYSTEM to do shell execute.

Up to your question, My suggestion is very simple but sure work.
do Simple Copy Variable value to new variable before use. && Best way
or Release oTest && instead of assign the value to Nothing... && Worth for a test, you may know more info.
Or do the msgbox before set nothing.. && poorest but work..

Another possible error detail information:
For C, similar to your case, All variable are using Pointer to hold the Memory Address.
If you need the value/Content of it, accuately it search the appointed memory address and return it for you.

Now, Your function want to get the Reference of the variable,
Local Variable with short life-time(i.e. after the coding run, the variable gone),
which may implement as the similar way as above stated.
Now you clear the memory address, and thus it will generate an Error for empty referencing.
(In C, nearly sure Core dump..)

Hope this help! ^-^;




>Hi Barbara,
>
>>I don't know for sure, but could it be that the SECOND time you already have the oTest object? You might try deleting it in your macro or else checking to see if it exists before calling CreateObject()
>>
>>I've run into similar problems with Word....
>
>Thanks for the reply.
>
>I've tried the following code:
>
>Sub reftest()
> Dim oTest As Object
> Set oTest = CreateObject("refgen.ref_finder")
> cName$ = oTest.getref("substanc", "numb", "AZZZD", 1)
> Set oTest = Nothing
> MsgBox (cName)
>End Sub
>
>The code still fails if I run it a second time. The line causing the error is the second line, with oTest being an Object and having a value of Nothing at this stage during both runs.
>
>This is really a show-stopper. I've tried it in Excel and VB with the same result. Yet, it works great if the dll is used in VFP.
>
>I couldn't figure out how to release a variable in VB, but oTest is local to reftest() and I assume the code would error on the first line if oTest already existed.
>
>Best.
>
>Matt.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform