473,774 Members | 2,206 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Com Object Question

I have a program in Visual Basic that has a running object

Public objSAPGui As Object
Public objGUIApp As Object
Set objSAPGui = GetObject("SAPG UI")
If Not objSAPGui Is Nothing Then
Set objGUIApp = objSAPGui.GetSc riptingEngine
end if

I can't really create the same way in C#, so I imported the
Microsot.Visual Basic .NET object to create the first object.

object sapGUI = Microsoft.Visua lBasic.Interact ion.GetObject(" SAPGUI",
null);
if (sapGUI != null)
{
object sapApp = sapGUI.GetScrip tingEngine();
return true;
}

But can't go on since the GetScriptingEng ine returns this error

'object' does not contain a definition for 'GetScriptingEn gine'

Any ideas on how to bypass the gui checking for this and actually just
proceeding or is there a way to code it different

Thanks in advance
Jun 27 '08 #1
1 3644
On Wed, 16 Apr 2008 18:01:36 -0500, Chico Che <js*****@yahoo. com>
wrote:
>I have a program in Visual Basic that has a running object

Public objSAPGui As Object
Public objGUIApp As Object
Set objSAPGui = GetObject("SAPG UI")
If Not objSAPGui Is Nothing Then
Set objGUIApp = objSAPGui.GetSc riptingEngine
end if

I can't really create the same way in C#, so I imported the
Microsot.Visua lBasic .NET object to create the first object.

object sapGUI = Microsoft.Visua lBasic.Interact ion.GetObject(" SAPGUI",
null);
if (sapGUI != null)
{
object sapApp = sapGUI.GetScrip tingEngine();
return true;
}

But can't go on since the GetScriptingEng ine returns this error

'object' does not contain a definition for 'GetScriptingEn gine'

Any ideas on how to bypass the gui checking for this and actually just
proceeding or is there a way to code it different
As far as I can see, you're using late binding in VB, which is
possible (if memory serves) but cumbersome to do in C#.

The following article explains the differences:

http://support.microsoft.com/kb/302902

(the article is about Office but same difference :-)

If there is no special reason you're declaring e.g. objSAPGui as
Object (e.g. version dependency problems), my suggestion would be to
use early binding.

Regards,
Gilles [MVP].

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2578
by: sunaina | last post by:
This is the first program I am writing using PHP and Mysql. I am creating a game where user thinks of an object and my program guesses the object while asking series of yes/no questions. All a user has to do is say yes or no to the questions that my program asks. I have coded until the part where once user thinks of an object and enters submit and the program asks him the first question. Now when the user enters yes/no for this first...
6
2255
by: Chris S. | last post by:
I'm trying to make a graphical editor and browser for Pickled files. One aspect I'm not sure about is how to detect multiple references to the same data. For instance, say I had the Pickled data: a= b= c= d=
4
3092
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use the recordset to loop thru the recordset, update values from the recordset and then update the database by passing parmeters to another stored procedure. I would like to use the recordset object but can it be used to pass a parameter to a stored...
4
5555
by: Mark D. Anderson | last post by:
About a month ago Richard Cornford did an interesting analysis of a memory leak in jscript (internet explorer) when there are "circular" references between DOM objects and (real) jscript objects: http://groups.google.com/groups?selm=bcq6fn%24g53%241%248300dec7%40news.demon.co.uk This message summarizes some testing I've done and their results. These results somewhat contradict Cornford's conclusions; I haven't
6
2342
by: Luke | last post by:
Here is my emails to Danny Goodman (but probably he is very busy so he didn't answered it). First email(simple): Subject: JavaScript Arrays " We all know the array can act like HashMap, but is there a shortcut for creating such array ? eg //simple array indexed via numbers var a = new Array("a", "fdsf", "sada"); or,
100
5300
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
6
1557
by: Tom | last post by:
I have a problem, to which I have been unable to find a solution for days now, after checking numerous references (both in books and online). Perhaps someone here can help. Here's my problem: I'm trying to define a series of radio objects as a large array for a survey, like this: 1) Does this make sense? <input type="radio" name="question" value="Y"> Yes <input type="radio" name="question" value="N"> No
7
11954
by: Martin Robins | last post by:
I am currently looking to be able to read information from Active Directory into a data warehouse using a C# solution. I have been able to access the active directory, and I have been able to return "DirectoryEntry" objects within the path that I specify (either using the DirectoryEnrtry.Children or using the DirectorySearcher class) and all started well and dandy! Now the problem; some of the properties of the DirectoryEntry objects being...
26
5694
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized several parts of the DOM, but this does not include the window object. Thank you
15
1852
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.