CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB and C++

  1. #1
    Guest

    VB and C++

    Is there any way that I can call C/C++ functions from VB? I like the interface to VB better but I have some C/C++ functions that I need to call. Can I use VB or do I have to create my app in VC so I can use those functions?


  2. #2
    Guest

    Re: VB and C++

    if you have the C++ functions in a DLL you can use them in VB
    Example: the following line lets you use the function Sleep from then kernel32.dll


    private Declare Sub Sleep Lib "kernel32" (byval dwMilliseconds as Long)




    In VC you have to declare the function as follows:

    extern "C" __declspec(dllexport) void Sleep(DWORD dwMilliseconds);

    hope I could help
    Tom


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