Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NeroCOM
Message
De
20/11/2003 23:48:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00851551
Message ID:
00852204
Vues:
9
Hi Paul,
>PMJI,
dunno that one...

>I am working with a problematic AutoCAD ActiveX (VFP can't seem to pass a zero-based array correctly to it) -- I have been contemplating doing a VB wrapper for it -- would you be able to share any of your VB wrapper code or suggest links to start me on the path to writing my own?

Most of the times it was getting other interfaces - in VFP6 not natively possible, and in VB a breeze. If it is "only" parameter passing, I follow the pattern:
if (code it in VFP for use in the program) = problem
  if (code a simple PRG just to call the activeX)= problem
    if (above PRG-code translated into VB) = problem
      get some rest
      if above VB-code translated into c++ = problem
         get some rest
      endif
    else
      if (retranslation into vfp) = problem
        if (calling VFP_App.Exe as activeX) = possible
          make the VB app the "main" and ask VFP via COM for the variables
          ** great for batch jobs / datacrunching
        else
          create a VB COM project
          build some VB methods to set properties from VFP
          call from VFP
          set the properties via COM
          call a "activate" method in your VB-com-object
          in "activate" read out the properties into the variables
          call the activeX with the tested code 
          (check perf - this is trial'n'error and marshalling can hurt you)
        endif
      else
        get a lot of rest - I must have missed something ;-)
      endif
    endif
endif
The technique above is great if you have "semi-constants",
which have to be in the most of the calls to your activeX
but don't change during the program run
(directories / file names can be a prime example).

If you ONLY have problems with one method, create a corresponding method signature in your VB-COM, call it in VFP and check the results in VB.
Simple manipulations in VB should be enough to fix array bounds,
if that is the only problem.

HTH

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform