Hello,
i have a vb.net project with a reference to an ActiveX object (ocx).
If i try to use the ocx from vb6 project (adding the reference) it
works ok (using CreateObject).
In vb.net,
the CreateObject works ok, the object gets initialized...
but when i try to run an object method or change an object property
vb.net raises an InteropServices .COMException.. . "Catastroph ic Error /
failure"...
The app type is console.
If i create a windows forms application and i add the ocx reference by
adding this one to the toolbar (personalize toolbar components)... it
runs ok using the name of the object dropped to the windows form.
But i can't use CreateObject for initialize the ocx object... and i
need to do this...
Any sugestions will be appreciated...
Thanks in advance,
Jorge. 2 8431
late binding in VB.Net requires some extra coding as in VB6 ( 2 lines extra
to be exact :-)
i do this wich works fine in my situation ( late binding to an VB6 Activex
executable )
Imports System.Reflecti on
Private HBSObject As Object
in my form load
Dim HBSCOM As Type
'Get the object
HBSCOM = Type.GetTypeFro mProgID("Hbase. clsHbase")
'Create instance of HBSCOM
HBSObject = Activator.Creat eInstance(HBSCO M)
in my cleanup routine
System.Runtime. InteropServices .Marshal.Releas eComObject(HBSO bject)
HBSObject = Nothing
hth
let us now if this did the trick
Regards
Michel Posseth [MCP]
"jdanoz" <jo*********@gm ail.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com... Hello,
i have a vb.net project with a reference to an ActiveX object (ocx). If i try to use the ocx from vb6 project (adding the reference) it works ok (using CreateObject).
In vb.net,
the CreateObject works ok, the object gets initialized...
but when i try to run an object method or change an object property vb.net raises an InteropServices .COMException.. . "Catastroph ic Error / failure"...
The app type is console.
If i create a windows forms application and i add the ocx reference by adding this one to the toolbar (personalize toolbar components)... it runs ok using the name of the object dropped to the windows form.
But i can't use CreateObject for initialize the ocx object... and i need to do this...
Any sugestions will be appreciated...
Thanks in advance,
Jorge.
Hi Michel,
i tested your code but i get the same error "Catastroph ic failure"....
Thanks,
Jorge.
m.posseth ha escrito: late binding in VB.Net requires some extra coding as in VB6 ( 2 lines extra to be exact :-)
i do this wich works fine in my situation ( late binding to an VB6 Activex executable )
Imports System.Reflecti on
Private HBSObject As Object in my form load
Dim HBSCOM As Type
'Get the object
HBSCOM = Type.GetTypeFro mProgID("Hbase. clsHbase")
'Create instance of HBSCOM
HBSObject = Activator.Creat eInstance(HBSCO M)
in my cleanup routine
System.Runtime. InteropServices .Marshal.Releas eComObject(HBSO bject)
HBSObject = Nothing
hth let us now if this did the trick Regards
Michel Posseth [MCP]
"jdanoz" <jo*********@gm ail.com> wrote in message news:11******** *************@g 14g2000cwa.goog legroups.com... Hello,
i have a vb.net project with a reference to an ActiveX object (ocx). If i try to use the ocx from vb6 project (adding the reference) it works ok (using CreateObject).
In vb.net,
the CreateObject works ok, the object gets initialized...
but when i try to run an object method or change an object property vb.net raises an InteropServices .COMException.. . "Catastroph ic Error / failure"...
The app type is console.
If i create a windows forms application and i add the ocx reference by adding this one to the toolbar (personalize toolbar components)... it runs ok using the name of the object dropped to the windows form.
But i can't use CreateObject for initialize the ocx object... and i need to do this...
Any sugestions will be appreciated...
Thanks in advance,
Jorge. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Yitzhak |
last post by:
I am having "Permission denied" error while calling
LogEvent method of WScript.Shell component.
Basically, ASP page calls Windows Script Host Shell
component to log events to the OS Application Event log.
My environment:
Windows Server 2003, IIS 6, WSH, Classic ASP, Vbscript
Below is the code and the error:
Code:
|
by: lauren quantrell |
last post by:
Admitedly a very open-ended question but here goes ...
Why so may "Connection failure" error messages when my Access 2K users
are executing stored procedures that contain UPDATE or INSERT
statements? I am using currentconnection before calling the the execute
statement and users are using Access built-in login to the SQL Server
backend using Windows NT authentication.
|
by: joef |
last post by:
I'm running VS.net on my PC (W2K) connected to a remote IIS server
(W2K)
SP4 that is not a domain controller. I've got the ASPNET and IWAM
accounts in the "Impersonate a client after authentication" user rights
on the server. I'm in the local admins and debuggers groups. When
trying to debug, I'm getting the:
Error while trying to run project: Unable to start debugging on
the web server. Catastrophic failure
|
by: HoustonComputerGuy |
last post by:
I am working on getting my web applications moved to .Net 2.0 and am
having some problems with System.Net.Mail. I get the following error
when sending the mail:
System.Net.Mail.SmtpException was unhandled by user code
Message="Failure sending mail."
Source="System"
StackTrace:
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at System.Net.Mail.SmtpClient.Send(String from, String
|
by: Radu |
last post by:
Hi. I have created a service which I needed to install. Therefore I use
InstallUtil.
On my dev machine at home I login as Administrator and I have *NO*
password set.
In my first attempts with InstallUtil I tried with username =
Administrator and I left the password textboxes blank. No go - it said
An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: No mapping between account names
and security IDs was...
| |
by: MikeJ |
last post by:
In my office, we have workstations with standard Win 2000 images (OS plus
standard apps like Office, etc.) as developers, we then install our
development tools on top of those images. other developers in my office
have installed VS8 and use it with no problems. however, on a new
workstation that I recently got, I have installed VS8, and get this error
whenever I try to access a C# project or create a new C# project:
"Project 'XYZ'...
|
by: Kevin Liebowicz |
last post by:
Yes, I wasted the past two days trying to fix this.
Yes, this is on a Win2003 Server.
Yes, this machine is a domain controller.
Yes, I seen the dozens of KB articles like this one:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315158
But the problem is that 99% of these are for ASP .NET 1.x and this
is .NET 2.x which I just installed to try and get .net working for the
first time ever. I've see all the HACKS to get .net 1.x...
|
by: Cirene |
last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.
NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.
Now I'm getting this error. Any idea why?
Server Error in '/myuser4/MyWebApp' Application.
--------------------------------------------------------------------------------
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |