473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ActiveX objects with com callable wrapper

The general problem is that I have to start an Application, programmed in C#,
out of a c++-programm.
To do this, I have made a com callable wrapper around the assembly and
startet my application. Until here, everything works fine, I am able to start
the new dialog out of the mfc application. But now my problem:
The dialog from the assembly doesn´t start, if I use ActiveX components in
the C#-assembly. Has anyone an idea why this seems not to be possible?

Thanks
Jens
Nov 17 '05 #1
5 1621
Jens,

Have you simply tried running your C# app without it being started from
C++? If so, does the ActiveX work?

If you still have problems, try commenting out all the code in your C#
app that uses the ActiveX but keep a reference to the control. If your
C# app can load, then you know it has something to do with a property
or method of your control.

Best Regards
Johann Blake

Nov 17 '05 #2
> The dialog from the assembly doesn´t start, if I use ActiveX components
in
the C#-assembly. Has anyone an idea why this seems not to be possible?

Some more information would be useful:
- Does an error-message appear?
- Can you break the debugger somewhere in the assembly?
- Does the assembly work OK if you use it from managed code?

Greetings,
Wessel
Nov 17 '05 #3
> Some more information would be useful:
That should not be the problem.
- Does an error-message appear? No, there is no error Message. When i try to create the dialog, the
execution returns from the method without any comment.
- Can you break the debugger somewhere in the assembly? When stepping through the assembly, the execution stops at a line like this:
ActiveXComponent myActiveX = new ActiveXCompontent();
- Does the assembly work OK if you use it from managed code? Yes, the application has been used as normal application for a while. But
now we have to use it as DLL from an mfc program.


Greetings
Jens
Nov 17 '05 #4
> Have you simply tried running your C# app without it being started from
C++? If so, does the ActiveX work? Yes, I used the application some time as stand alone and had no problems.
But now I have to call the dialog from an mfc-program.
If you still have problems, try commenting out all the code in your C#
app that uses the ActiveX but keep a reference to the control. If your
C# app can load, then you know it has something to do with a property
or method of your control.

The described problem occurs not only for my activeX components, but for
all. I tried an Acrobat Reader Window in the form, and also the Microsoft
Calender ActiveX. Both resulted in the same error.

Jens

Nov 17 '05 #5
Jens,

If you are using MFC, you might be required to call the
AfxGetStaticModuleState system function (see "TN058: MFC Module State
Implementation" in MFC Library Reference). Also, be sure to call
CoInitialize[Ex] before you attempt to instantiate any COM objects.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Jens" <Je**@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
Have you simply tried running your C# app without it being started from
C++? If so, does the ActiveX work?

Yes, I used the application some time as stand alone and had no problems.
But now I have to call the dialog from an mfc-program.
If you still have problems, try commenting out all the code in your C#
app that uses the ActiveX but keep a reference to the control. If your
C# app can load, then you know it has something to do with a property
or method of your control.

The described problem occurs not only for my activeX components, but for
all. I tried an Acrobat Reader Window in the form, and also the Microsoft
Calender ActiveX. Both resulted in the same error.

Jens


Nov 17 '05 #6

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

Similar topics

12
by: Egil M?ller | last post by:
Is there any way to create transparent wrapper objects in Python? I thought implementing __getattribute__ on either the wrapper class or its metaclass would do the trick, but it does not work for...
2
by: Irene | last post by:
Currently I have in-house software package written around ActiveX(supporting VB and C++). Currently we are moving to .NET and I wonder what (component) in the .NET can replace(?) the ActiveX? I...
2
by: Berata | last post by:
Hello all, in VB6 we were able to create ActiveX-DLL's (In Process Components) and ActiveX-Exe's (Out of Process Components). We habe build up an application that exists of an main module...
1
by: Kenny ODell | last post by:
Can you create ActiveX controls in C#? I want to make a control that can be used by both VB 6.0 and VB .NET and C# developers. Can I write in C# or must I write in VB 6.0? I realize that more...
1
by: James Pannozzi | last post by:
I have a C++ App which currently uses #import to access some ActiveX DLL's provided to me from some companies. These desktop ActiveX apps typically have a GUI with a VB form in which the desktop...
5
by: Yama | last post by:
Hi, Can you create ActiveX controls in C# for reuse on IE, MFC 6.0, ASP classic, as well as .NET? Thanks, Yama
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
6
by: Ron Garret | last post by:
If I do this: def f(self): print self class c1: pass setattr(c1, 'm1', f) Then f is automagically transmogrified into the appropriate sort of method depending on how it is used:
3
by: Lou | last post by:
I know I can make an ActiveX dll in .NET and it uses interop. So I end up with 2 files, the .dll and the interop file. I also know I need to use Regasm or something like that to register the .dll...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.