Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Creating an Activex with a Windows Forms Control for MS Access

$
0
0

Hi!

First I would like to apologize if my english is not perfect but it is not my mothertongue. Moreover I have not a real experience in programming neither in C++/C# nor with Visual Studio 2010.

 

I need to create a new interface for entering data in a Access 2010 database based on a tree control (to have a general idea I need to do something similar to what is described here,http://www.codeproject.com/Articles/14544/A-TreeView-Control-with-ComboBox-Dropdown-Nodes , and I think the only viable solution is extending the Windows.Forms.TreeView control: it seems to me that the other tree controls present in the Microsoft library cannot be extended in such way.

Now I need to create an Activex Control to insert this control in the Access project, but I encountered several problems:

1) firstly I have tried to create an ActiveX from the C# library that include my extended TreeView control, but it seems that it is not possible to create an Office-compatible ActiveX starting from a C# library so I have abandoned this road.

2) I tried to create a MFC ActiveX merging two tutorial: this one ( http://www.codeproject.com/Articles/14533/A-Complete-ActiveX-Web-Control-Tutorial ) that describes how to insert a DialogBox in an ActiveX and this one ( http://msdn.microsoft.com/en-us/library/b1kyh79x.aspx ) that describes how to intergrate a .NET User Control in a DialogBox. Both procedures work if performed alone, but if I try to integrate them and to test the ActiveX with TSTCon32.exe or inserting it in Access I get two different exceptions, both during the painting of the ActiveX:

-> if I try to use my control, called sharpControl, from another project in the same solution I get "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module with the additional information that it is impossible to load the assembly 'sharpControl, version...' or one of its dependencies. Impossible to find required file", but sharpControl.dll is correctly in the release folder with the ocx file. I get the same exception realising sharpControl in C++.

-> if I try to create a Windows Forms control in C++ in the same project of the MFC ActiveX, via Add - New Item, I get "An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module. Attempted to read or write protected memory"

 

Could someone suggest me something to try to solve this problem? Note that I only bounded to realise an Access-compatible ActiveX control with a tree-like interface provided with a textbox on every node, so I am not forced to extend the Windows.Forms.TreeView control.

Thanks a lot

Luca


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>