473,791 Members | 3,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Access-VBA object to C# method

Hi there,

I have the following situation:

1. DOT.NET Application is started
2. DOT.NET Application instantiates Access.Applicat ion.8
3. Opens a specified database (MDB)
4. DOT.NET application sets a global variable in the access
application to itself (type object)
5. Runs a macro
6. In the access vba code methods of the DOT.NET application are
called (works fine), this is done within a VBA class.

Problem:
Some of the methods in the DOT.NET application display a WinForm to
the user. Depending on the things the user does, I would need to query
information from the access application. For this I would need some
kind of a callback from the DOT.NET method to the calling vba-object
that originally called the method.

To solve this problem, I thought I can pass the vba-object to the
method as a parameter.

In the DotNet is added a parameter of type "object" to the method.
In the vba-class I added Me as a parameter:

C#: public void Show(object caller, string message) {...
InvokeMethod... . // for callbacks }
VBA: dotnet.Show Me, "Hello"

I get an error message and the problem seems that I cannot pass an
"vba object" to the parameter. Many other data types work just fine,
but I cannot pass a vba object.

Do I need to define a different data type in the C#-method? Is it
possible at all?

Before, I had another architecture, where I implemented a COM-Object
which was then instantiated from VBA in Access. I had big problems,
because displaying a WinForm in the Access97 ActiveX containter is not
supported by microsoft and many things do not work correctly. But
passing an vba object to a C# method had worked with this solution.

Some experts with good ideas would help.

Thanks

Andreas
Jul 21 '05 #1
0 2067

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

Similar topics

10
2544
by: Rigga | last post by:
Hi, Ok first please bear with me as I am a total Python n00b.. Can anyone explain why this does not like me using % FileLoc in the os.system call??? #!/usr/bin/python import sys import os
2
12642
by: Jonathan Driller | last post by:
I am attempting to block repeat downloads from a site. I need to have a landing page pass a referer to a secured page. I have tried a meta refresh redirect and several Javascript redirect strategies but none pass the referer. How can I force this since the referer property is read only? I have set up an .htaccess file so it will only let people into a secure directory if they come from an internal page on my site. This is done by...
58
10182
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of code... TCHAR myArray; DoStuff(myArray);
11
3103
by: comp.lang.php | last post by:
On one of my sites, I have a TCL CGI script that has a security hole in spite of it having effective server-side validation (the fact that it's CGI IS its security hole). The front end is a PHP script, and I am writing server-side validation onto it, however, it is required to redirect to the TCL CGI script because only a CGI script has the ability to access a group-accessible XML script on the back end. I had to take the whole thing...
2
4316
by: Morgan | last post by:
Thanks to all of you because I solved the problem related with my previous post. I simply made confusion with pointers to pointers and then succeeded passing the reference to the first element pointer. :-)) You were right about by mixed code: quickly writing an example to clarify the matter I made a C++ program, sorry for the inconvenience. Anyway, although it all works fine with monodimensional arrays, I still have a problem with...
4
2500
by: hello smith | last post by:
I have a lot of functions that add values to an array. They alos update a global variable of type int. Currently, I use a global variable to hold this array. All functions access this array global variable and add their values. Then they increment the global int variable. Is it faster to pass the array and the int variable by reference to each function or just access the global variables? I have tried using gprof, I did not get...
3
2263
by: Das | last post by:
Hi all, I'm writig an application that sends an http request to java servlet file. I have to pass an xml file to the servlet. How should I pass xml file to the file. When I try to access the url directly it shows me Forbidden You do not have permission to access /RequestListenerServlet on this server.
8
3506
by: S. | last post by:
Hi all, Can someone please help me with this? I have the following struct: typedef struct { char *name; int age; } Student;
1
6321
by: Dean Slindee | last post by:
VS2008, .NetFramework 3.5 SP1: I have built a LINQ data access layer project. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was correctly, automatically, placed into the Settings for the LINQ project. It works, but it's a "static" connection string. I would like to be able to use this one LINQ data access layer against both test and production databases without having...
4
5307
by: arnuld | last post by:
I am passing an array of struct to a function to print its value. First I am getting Segfaults and weired values. 2nd, is there any elegant way to do this ? /* Learning how to use an array of struct */ #include <stdio.h>
0
9666
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
10419
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...
0
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9987
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
9023
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
7531
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.