Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NeroCOM
Message
From
20/11/2003 23:48:03
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00851551
Message ID:
00852204
Views:
8
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform