CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2001
    Location
    China
    Posts
    15

    Can i call MFC Class from VB project?

    Can i call MFC Class from VB project?
    Such as:
    Dim a as CDialog

    I know it's ok,but i don't know how
    to config my VB enviroment.
    Who can help me?
    Thanks a lot.


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Can i call MFC Class from VB project?

    No, I'm afraid you can't.

    MFC and VB were two different approaches to the same problem, vis. hiding the complexity of windows application development. The strategies they took are very different and I'm afraid you can't mix and match them.

    HTH,
    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Jun 2001
    Location
    China
    Posts
    15

    Re: Can i call MFC Class from VB project?

    Then how can i use Dialogs in VB
    just like in VC?



  4. #4
    Join Date
    Apr 2000
    Posts
    737

    Re: Can i call MFC Class from VB project?

    Dialogs in VC is almost same as Form in VB. if you set the borderstyle to fixed dialog, it looks almost the same as VC dialog.

    .DoModal = .Show vbModal

    .Create(xxxx = Load xxxx

    .ShowWindow = .Show Modeless


    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

  5. #5
    Join Date
    Apr 2000
    Posts
    737

    Re: Can i call MFC Class from VB project?

    I know that VC can create MFC DLL, so if you wrap all function that you need in MFC DLL function, okay like this

    WINAPI DisplayDialog
    {
    .....
    ..... //use some MFC to create dialog & display it
    }

    VB might be able to use it. I haven't tried it, so if you plan to try, let me know if it can be done.




    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

  6. #6
    Join Date
    Jun 2001
    Location
    China
    Posts
    15

    Re: Can i call MFC Class from VB project?

    Looks like a great idea!
    If i have time, i'll try it.
    If you have tried it, tell me the result.
    Thx a lot.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured