|
-
July 12th, 2006, 05:30 AM
#16
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
-
July 12th, 2006, 07:01 AM
#17
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...
-
July 12th, 2006, 07:01 AM
#18
Re: DLL's Compatibility
 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.
-
July 12th, 2006, 11:23 AM
#19
Re: DLL's Compatibility
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|