Tlbimp.exe creats DLL with no constructors

Q

QSIDeveloper

I need to add a method to a VB6 OCX that we are consuming with C# (VS 2005)
Unfortunately the person that created the original DLL to reference in the
C# code is not available. When I create a DLL using TLBIMP QDWorkFlowAx.OCX
/namespace:AxQDWorkFlow and then try to build the C# code I get a compile
error stating ‘the type AxQDassembly. QDassemblyAxClass has no constructors
defined’

I don’t see anything in the TLBIMP doc that covers this.

I also have tried creating a new VB control and a C# consumer for that
control with the same result.
 
J

Jialiang Ge [MSFT]

Hello QSIDeveloper,

For ActiveX control developed by VB6, we do not use tlbimp to generate its
.net wrapper (interop assemblies) because AxtiveX controls require a
AxHost. Instead, we use the tool: aximp, which can be found in the
directory: C:\program files\Microsoft Visual Studio.NET\FrameworkSDK\Bin\.
You can run the command as:

aximp QDWorkFlowAx.OCX

and it will generate two interop dlls: QDWorkFlowAx.dll and
AxQDWorkFlowAx.dll

AxQDWorkFlowAx.dll contains the constructor we need to create the ActiveX
control.

For more information, I personally recommend the book "Professional Visual
Basic Interoperability - COM and VB6 to .NET" written by Billy Holli, and
Rockford Lhotka. In its Chapter 13, it introduce the interop between .NET
and ActiveX control in very detail.

If you have any other concerns or questions, feel free to let me know.

Regards,
Jialiang Ge ([email protected], remove ¡®online.¡¯)
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top