Calling Native C++ functions 
Author Message
 Calling Native C++ functions

Hi,

I need some urgent help on this ..

I need to call some string manipulation functions from std C or
C++.
like strcmp, strcpy etc..

Can i call these functions from VB ? Can this be done ?
what .dll  will i have to refrence ? I have the whole Visual
Studio installed .. and these functions exist in VC++ .. so i
figured it shud be possible to call them from VB ..

any info will be appreciated !!

thanks
Vik.



Mon, 21 May 2001 03:00:00 GMT  
 Calling Native C++ functions
C strings (null terminated) are not the same technology as VB. C's string
manipulation functions are in the c runtime or inlined into a c program. You
could make a DLL (in C) with a set of functions that wrap the C string
routines but you have a conversion problem. To get stings back from a c
routine you have to pass fixed length straings from VB not variable lenth.
Then when the come back you have to find the null and copy the fixed length
to stings to Vb strings. Look at mscrt32.dll (c runtime and see if the
functions you want are there or more likely there in a C lib which VB can
not get to directly).

You might want to  look at the VB market place for allready built string
function DLLs.

Quote:
>Hi,

>I need some urgent help on this ..

>I need to call some string manipulation functions from std C or
>C++.
>like strcmp, strcpy etc..

>Can i call these functions from VB ? Can this be done ?
>what .dll  will i have to refrence ? I have the whole Visual
>Studio installed .. and these functions exist in VC++ .. so i
>figured it shud be possible to call them from VB ..

>any info will be appreciated !!

>thanks
>Vik.



Mon, 21 May 2001 03:00:00 GMT  
 Calling Native C++ functions
Nevertheless, it is possible to pass a fixed-length VB String into a
string function.

Dim your variables As String, and before you pass them, make sure to
initialize them with MyString = String$(0, <some length>).  Then pass
them ByVal.

On Thu, 3 Dec 1998 12:02:45 -0600, "LarryC"

Quote:

>C strings (null terminated) are not the same technology as VB. C's string
>manipulation functions are in the c runtime or inlined into a c program. You
>could make a DLL (in C) with a set of functions that wrap the C string
>routines but you have a conversion problem. To get stings back from a c
>routine you have to pass fixed length straings from VB not variable lenth.
>Then when the come back you have to find the null and copy the fixed length
>to stings to Vb strings. Look at mscrt32.dll (c runtime and see if the
>functions you want are there or more likely there in a C lib which VB can
>not get to directly).

>You might want to  look at the VB market place for allready built string
>function DLLs.


>>Hi,

>>I need some urgent help on this ..

>>I need to call some string manipulation functions from std C or
>>C++.
>>like strcmp, strcpy etc..

>>Can i call these functions from VB ? Can this be done ?
>>what .dll  will i have to refrence ? I have the whole Visual
>>Studio installed .. and these functions exist in VC++ .. so i
>>figured it shud be possible to call them from VB ..

>>any info will be appreciated !!

>>thanks
>>Vik.



Mon, 21 May 2001 03:00:00 GMT  
 Calling Native C++ functions

Quote:

>Hi,

>I need some urgent help on this ..

>I need to call some string manipulation functions from std C or
>C++.
>like strcmp, strcpy etc..

>Can i call these functions from VB ? Can this be done ?
>what .dll  will i have to refrence ?

You will have to build your own .DLLs in Visual C++.  Standard C++
library functions do not expose themselves to other applications.

--Elocutus
===
"Capitalism undoubtedly has certain boils and
blotches upon it, but has it as many as government?
Has it as many as marriage? Has it as many as
religion? I doubt it. It is the only basic
institution of modern man that shows any genuine
health and vigor."  --H. L. Mencken



Mon, 21 May 2001 03:00:00 GMT  
 Calling Native C++ functions
Vikram,

Why not just write your own version of strcmp in VB? That would be a *LOT*
easier than linking into some DLL. As far as I'm aware the string
manipulation features of VC & VC++ are not in a separate DLL.

Mike

Quote:

>I need to call some string manipulation functions from std C or
>C++.
>like strcmp, strcpy etc..

>Can i call these functions from VB ? Can this be done ?
>what .dll  will i have to refrence ? I have the whole Visual
>Studio installed .. and these functions exist in VC++ .. so i
>figured it shud be possible to call them from VB ..



Sun, 27 May 2001 03:00:00 GMT  
 Calling Native C++ functions
On Wed, 9 Dec 1998 10:23:28 -0000, "Mike Lacey"

Quote:

>Why not just write your own version of strcmp in VB? That would be a *LOT*
>easier than linking into some DLL. As far as I'm aware the string
>manipulation features of VC & VC++ are not in a separate DLL.

They're in msvcrt.dll.  

Not that I see much point in trying to use them, nor have I tried.  

--
 David Foster            |  "But I've been to the pointless forest,  

 finger for PGP key      |              -- Oblio, The Point



Sun, 27 May 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Calling Native C++ functions

2. Calling a C++ DLL function which takes an C++ object as parameter

3. Anyone seen R6025 error: Visual C++ pure virtual function call

4. C++ functions called from VBA

5. Calling VBA dll functions with C or C++

6. calling C++ functions from VB

7. calling a C++ function from Basic

8. Calling C++ functions from QuickBasic 4.5?

9. Calling a VB function in C++

10. How to call c++ functions from visual basic

11. How do you call a Visual C++ (DLL) function from Visual Basic

12. Calling Visual C++ 5.0 DLL Functions From Visual Basic 5.0

 

 
Powered by phpBB® Forum Software