[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2497.0. "Construct OLE method call at runtime?" by BCFI::MLUNDGREN (Magnus Lundgren @JAR) Mon Feb 17 1997 04:35

Hi!

I want to call a method on an OLE server, but I don't know the method name at 
design time. I will get the method name from a database. The code would look 
something like the following:


  dim objApplication as Object
  dim strMyMethod as string

  strMyMethod = "TheNameOfMyMethod"

  set objApplication = CreateObject("My.Application")

  'WHAT SHOULD I WRITE HERE TO EXECUTE objApplication.TheNameOfMyMethod???
  call objApplication.strMyMethod


Is it possible to do something like this in Visual Basic? The bypass solution 
would be to send the method name as a parameter to a common 'Init' method in the 
OLE server which would have a switch statement to determine which method to 
execute.

Regards,

Magnus Lundgren@jar
DIGITAL BCFI
Stockholm
Sweden
T.RTitleUserPersonal
Name
DateLines