Opening an AppMain instance from a VB6 application


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
We are currently in the process of converting from VB6 to VB.NET.  We are eventually converting all of our program over to use StrataFrame and .NET, but for now we only have part of it done.  We have taken out the administrative functions and created a StrataFrame app with a separate MDI.  We want to open up this AppMain instance or something similar when we select the appropriate menu option in the VB6 app.  What is the best way to go about doing this?  I've done something like this before with an ActiveX EXE, but that no longer exists in .NET....not sure what the equivalent would be or how any of this would affect the functionality of AppMain in a StrataFrame app.  Please offer suggestions.
Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can make your .NET application COM-Visible (in the project properties, go to the Application tab, and click the Assembly Information button... "Make assembly COM-Visible" is at the bottom).  You should then be able to call methods directly on the application through some sort of interop in your VB6 application.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Andria,

To make this .NET COM assembly work, you will need to call the regasm.exe file from the command line to create your type library (TLB) and your registry entries.  When you get to deployment you will have to manually enter the registry classes and entries sinfce regsvr32.exe does not work on .NET COM assemblies.

If you need me to explain further here I can.  Your machine should work fine when you compile your assembly.  It is other machines that becomes more work when deploying your assembly.

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I did the register for COM and I already have the classes showing in my VB6 application.  I can create an AppMain object, but it doesn't recognize any properties or methods inside of it.  That's where I got stuck.  I've done this before with other .NET objects, but I wasn't sure if there was something different about a StrataFrame app that I was overlooking.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You have to specify each class that you want to make visible within the COM as COM Visible.  This will allow you to access the internal class when you create a reference of the .NET assembly.

It is an attribute that you assign to the class, like this:

<Microsoft.VisualBasic.ComClass()> _
Public Class MyTestClass

End Class

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search