CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: DLL's Compatibility

    ConvertStringToBSTR is declared in comutils.h.

    You can use ConvertBSTRToString to get your char* back from BSTR if needed in C++ application.
    Last edited by Krishnaa; July 12th, 2006 at 05:32 AM.
    Regards,
    Ramkrishna Pawar

  2. #17
    Join Date
    Jun 2003
    Location
    Bangalore,INDIA
    Posts
    122

    Re: DLL's Compatibility

    Hello..,

    I have tried using BSTR but i want my DLL to be compatible in C, Borland C++, VB, VC++, Java and .Net..so if i use BSTR then i wont be able to use it in basic 'C'., is there any other way to do so...

  3. #18
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: DLL's Compatibility

    Quote Originally Posted by cheery_poori
    I have developed a DLL in VC++, i want to use it in VB and VB.net.. When i try to use the DLL in vb it is giving...
    Perhaps the standard way of exposing functionality developed in C++ to an automation client like VB is by using COM. i.e. Making your class Automation-COM compliant will allow you to use functionality using standard VB syntax, like this -
    Code:
    Set objectName = CreateObject ("YourDllName.ClassName")
    
    objectName.DoSomething ()
    Further read:
    The approach you have chosen so far is to use the export functionality of a "C" style DLL - a relatively outdated mechnism when compared to DLLs programmed in C++ that are COM compliant.

    COM compliance brings with it the advantage of adhering to standards designed for cross-language programming capabilities.
    Last edited by Siddhartha; July 12th, 2006 at 07:08 AM.

  4. #19
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: DLL's Compatibility

    Quote Originally Posted by cheery_poori
    I have tried using BSTR but i want my DLL to be compatible in C, Borland C++, VB, VC++, Java and .Net..so if i use BSTR then i wont be able to use it in basic 'C'., is there any other way to do so...
    What a mistake! BSTR type is a generic type for COM. Since COM is applicable for basic 'C' (is it a surprise for you?), so the BSTR type does.

    And what about Borland C++? Do you think it's kinda extraterrestrial in Windows world? Or C++ world?
    Last edited by Igor Vartanov; July 12th, 2006 at 11:27 AM.
    Best regards,
    Igor

Page 2 of 2 FirstFirst 12

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