Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2007

Tip: Looking for answers? Try searching our database.

Calling .net window using COM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Feldaspar - 16 Jan 2007 06:08 GMT
Hi,

I'm trying to call a .net window using COM, this my .net code:

-------------------------------------------------------------
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Hcn.Cv.CVSupportPrompt.1")]
[Guid("8DFA5C56-A510-11DB-AB24-9F7255D89593")]
public class CreatePrompt:MarshalByRefObject,ICreatePrompt
{
    public void Create()
    {
        CVSupportPrompt prompt = new CVSupportPrompt(); //CVSupportPrompt is
just Form
        prompt.ShowDialog();
    }
}

[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ICreatePrompt
{
    void Create();
}

-------------------------------------------------------------

I have this in my post build event to create the tlb file, which seems
to work OK as the file is built:

c:\windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
%targetdir%$(TargetFileName) /tlb:%targetdir%$(TargetFileName).tlb

This is my code I am trying to call from using CA-Visual Objects:

-------------------------------------------------------------
FUNCTION CheckShowCVPrompt() AS VOID

LOCAL CVPrompt,Factory AS OBJECT
Factory := oleautoobject{"HCN.Cv.CVSupportPrompt.1"}
CVPrompt := Factory:Create()
-------------------------------------------------------------

Nothing happens though when I run it, no window appears as would be
expected.

Regards,
Feldaspar - 16 Jan 2007 06:10 GMT
Hi sorry,

I just figured it out after I posted it I had mispelled:

Factory := oleautoobject{"HCN.Cv.CVSupportPrompt.1"}

It should be:
Factory := oleautoobject{"Hcn.Cv.CVSupportPrompt.1"}

> Hi,
>
[quoted text clipped - 44 lines]
>
> Regards,

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.