473,395 Members | 1,666 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,395 software developers and data experts.

how to call .Net Form VC++ OCX

Hello,

I am facing a problem when i am calling a .Net class from VC++ ocx.


One function in Class1 lib is

public static void ShowDialog()
{
Form1 Dlg = new Form1();
Dlg.ShowDialog();
}

------------- code in ocx -----

#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>

using namespace System;
using namespace System::Windows::Forms;
using namespace System::Windows;
using namespace TestClsLib;


From one function in OCX. I am using the following code

Class1* cls;
cls->ShowDialog(); //getting exception from here

----

It is compiling without any error. But it is giving an exception on function call.File not found from mscorelib.dll.


If the caller is a VC++ exe it is working.It shows the dialog without any problem.

Please assist me.

soj
Sep 17 '06 #1
0 1162

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Eugene Safrankow | last post by:
Hello All! I've encountered with the error when I call a method of dependency library (written in managed VC++) from Smart Client placed on a web page. In general, I make a call to the Windows...
8
by: Paul | last post by:
Hi all may I know how to use C# DLL inside my VC++ Project ? Thanks in advance.
1
by: Jiang Yue Brandon | last post by:
I am very confused about the different ways of VC++ and C# for doing windows form/dialog design in Visual Studio.NET. In C#, after you drag & drop the components to the form, the underlying...
1
by: Alleg | last post by:
hi everyone I am new to VC++.NET, however, I have to implement this project in vc++.net. Here is the trouble I am facing. I wanna disable the red close button at the right upper corner of a...
2
by: Al | last post by:
Could anybody point me to some resource about how to call a VB.net DLL in VC.net? Thanks in advance. Al
1
by: Robert Ludewig | last post by:
I have sucessfully imported and compiled a complex MFC 6.0 project from vc++6.0 (MFC6.0) into vc++ 8.0 (MFC 8.0). It contains several subprojects (libs and dlls). In vc++ 6.0 those project linked...
1
by: C.C. \(aka Me\) | last post by:
I am looking for a sample of how you execute/invoke a method in a form from one thread and have it run on the thread that created the form instead of the thread that actually made the call. The...
4
by: Charles | last post by:
Hello Everyone, I have been gettting great feedback from microsoft.public.vc.language group but after doing more searching I think my post should be directed to this group. I am trying to make...
5
by: Filippo Bettinaglio | last post by:
I have a DLL written in C++ (unmanaged), which I want to inteface with. I created a standard window form program with VC++ 2005, all fine I have imported an .h file the .lib file and all works. ...
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: 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: 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
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...
0
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,...
0
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...
0
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...

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.