473,670 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Big problem with classLib and ocx

Hi NG,

I have an OCX (VC++ 6.0) that fires some events. I have to use it on a form
an have to catch the events in event-handlers in another form (MDI-Child).

BUT: I have to create the other Form by Reflection, it is in a ClassLibrary
that has to be loaded dynamically. I first tried it without the ClassLibrary
and it works. I give the OCX to the Subform, declare my Eventhandlers there
and bind the ocx to these eventhandlers, no problem, works.

Then I made the same with a SubForm that lives in a Classlibrary, call it be
reflection, give the Form the ocx and so...but my event isn't fired in the
dll. I debugged it and the ocx IS passed to the classlib and the
eventhandler IS attached to the ocx. Here my code to call the SubForm:

Assembly _assy;

AssemblyName assyname = new AssemblyName();

assyname.CodeBa se = Application.Sta rtupPath +
"\\..\\..\\..\\ TestDLLEvent\\b in\\Debug\\Test DLLEvent.dll";

_assy = Assembly.Load( assyname );

Type _modType = _assy.GetType( "TestDLLEvent.S ubForm" );

Form _form = (Form)Activator .CreateInstance (_modType);

_form.MdiParent = this;

// OCX as Param
object[] myArgs = new object[1];

myArgs[0] = axVDev;

_modType.Invoke Member ("SetOCX",

BindingFlags.De fault | BindingFlags.In vokeMethod,

null,

_form,

myArgs);
_form.Show();

And here the Code inside the DLL-Form:

public void SetOCX( AxVDEVLib.AxVDe v ocx )

{
ocx.EventEntryE xit += new
AxVDEVLib._DVDe vEvents_EventEn tryExitEventHan dler(this.axVDe v_EventEntryExi t
);

ocx.GetObjects( "DE0001P52","E" ,1,"EX");

}

// This thing here isn't invoked if it is in a DLL

private void axVDev_EventEnt ryExit(object sender,
AxVDEVLib._DVDe vEvents_EventEn tryExitEvent e)

{

Console.Write(" EV_EX_SubForm") ;

}

Thanx in advance

Matthias
Nov 15 '05 #1
1 1483


Nov 15 '05 #2

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

Similar topics

1
8567
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the column below. The viewer can select states from the drop down lists above the other two columns as well. If the viewer selects only one, only one column fills. If the viewer selects two states, two columns fill. Etc. I could, if appropriate, have...
0
3075
by: FreeStyle | last post by:
Hi everybody, I'm using phpMyAdmin 2.2.6 with EasyPHP v.1.6.0.0 I wrote a php script which uses a username (added in the mysql base with phpMyAdmin). This user has no privileges. But in the script, I have the following request for the same username : INSERT TO table (...) VALUES (....) And it's working !!! The user can insert new rows with the php script to the database and he has no privileges. How it can be possible ?
3
6571
by: Marcus | last post by:
I'm really confused with something I never had any problems with before... I have a form with a textbox called password. On the second page that $password is posted to, if I test isset($password) after a submit, it always evaluates to true, regardless of whether or not anything was entered into the textbox... echoing the value simply echoes its contents, which is an empty string. If I test for simply if($password), however, that does...
2
4240
by: fartsniff | last post by:
hello all, here is a preg_match routine that i am using. basically, $image is set in some code above, and it can be either st-1.gif or sb-1.gif (actually it randomly picks them from about 100 gifs). then it processes them based off of which image type it selected, either the st- 's or the sb- 's.
2
8520
by: Fredrik Jonson | last post by:
Hello, I'm writing a newsletter poster for a website. I have some html news items which I want to turn into plain text and prettify before emailing it. Now, i have found wordwrap and strip_tags so the only problem remaining is the links. Below you see what I like to see, but I haven't got a clue how to get there.
0
2192
by: Aldo Polli | last post by:
Hi, I have this error when I start apache2 with php4 Syntax error on line 233 of /mypath/apache2/conf/httpd.conf: Cannot load /mypath/apache2/modules/libphp4.so into server: dynamic linker: /mypath/apache2/bin/httpd: relocation error: symbol not found: ap_pass_brigade; referenced from: /mypath/apache2/modules/libphp4.so I compile apache 2.0.46 with
2
6089
by: Marcus | last post by:
I am having some problems with trying to perform calculations on time fields. Say I have a start time and an end time, 1:00:00 and 2:30:00 (on a 24 hour scale, not 12). I want to find the difference in minutes, divide this result by a predefined size of interval, and make a loop that runs this many times. For example, with an interval size of 15 minutes, it will return 6 blocks... I have this all working fine, but am getting stuck on...
1
3419
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering converting a site of mine to PHP-Nuke, but if the individual modules aren't picked up in search engines I'm not going to do it. Thanks phpKid
4
2006
by: mike | last post by:
I'd like to port some C++ code to a .NET ClassLib for C# consumers. Am using VC2005, .NET 2.0 However I find that If I simply generate a C++ ClassLib using the wizard... // SimpleCLib.h #pragma once using namespace System; namespace SimpleCLib {
0
8466
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
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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
8659
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
7412
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...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
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...
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
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.