CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2001
    Posts
    47

    MFC in Visual Basic?

    Hello, peoples.

    I'm interested in accessing FTP through Visual Basic. One of my illustrious co-workers showed me a little program he wrote to perform FTP transfer using MFC in C++. It uses the CFtpConnection class. I said, "Well, that looks easy. Is there any way to do that in Visual Basic?"

    And he says, "Oh yeah, you just declare it as a class with VB after it."

    Now I wasn't going to totally believe that part of it, but I didn't know if accessing MFC classes in VB was possible, so I did some searches and found nothing so far.

    Is there indeed a way to access the innards of an MFC class within Visual Basic?

    Thank you for any help. And sorry if I sound green. I know I can access the win32 functions, but I'm not privy to the accessibility of MFC in VB.

    -killRoy

  2. #2
    Join Date
    May 2002
    Location
    San Miguel
    Posts
    66

    Lightbulb

    In Delphi there is a very cool FTP component BUT VB doesn't have one. It should have one.

    One solution is the following:

    Create a dll in VC++ to be able to access an instance of that class. Add the functions you need to get the desired functionality. Be careful with the string handling in C++.

    From VB you can access this dll.

  3. #3
    Join Date
    Jul 2001
    Posts
    47
    Ew, not exactly a straight forward way of doing it. And not as straight-forward as was suggested to me.

    Ok, thanks for the information!

  4. #4
    Join Date
    Jul 2002
    Location
    San Diego, CA USA
    Posts
    17
    Basically speaking KillRoy your talking about oil (VB) and water (C/C++ anything). They don't go together. Period. Sorry about that.

    As far as the CFtpConnection class goes, it's great. I know, because I've used it many times.

    Good luck with the DLL. This is the way I would do it.

    David
    If you are not what you say you are, then you are what you say you are not.

  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Actually if you search on either www.allapi.net or www.planetsourcecode.com, you'll find bunch of samples on FTP for VB This forum might have the links also. So search for it!

    -Cool Bizs

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