Calling a user-written 32-bit dll from 32-bit vb 4.0 
Author Message
 Calling a user-written 32-bit dll from 32-bit vb 4.0

Wondering if anyone can provide me a clue....

I wrote a regular 32-bit c dll with vc++ 4.0 and am calling it from a vb 4.0
32-bit application.

The small function in the c-dll takes a char * from a vb string, does some
manipulations on it, and passes back another char *.

When debugging from c, the char * to about to be passed back looks fine, but
when back in vb, it's truncated or messed-up.

This happens most times when the app is run, but it has also worked correctly
as well, though I don't know why.  I've tried, from vb, both setting and not
setting a variable-length to space(128)...Still a problem.

Any ideas are appreciated.  Thanks in advance.

Rgds,
MAH.

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQBtAzEeqw4AAAEDAMDvcqrZmWy3NUVirGeyiACKPetKzYPRut9V8Wpd+p0B8pbO
kWMlhf5PFrN68ZKBisjd6cAojztXVwNSC81M09PBD1P6OX/BjI1eCPNu5bGBt+NF
qigRJ0OWy6pEgwBlAQAFEbQhTWFyayBBLiBIYWxsZXJtYW4gPG1haEBwYW5peC5j
b20+
=i5tF
-----END PGP PUBLIC KEY BLOCK-----



Mon, 16 Nov 1998 03:00:00 GMT  
 Calling a user-written 32-bit dll from 32-bit vb 4.0

VB Strings are represented internally as BSTRs. VB CD docs or the KB
provide info about how to pass args to user written DLLs
--
Hope this helps,
Gadi
----------
Gadi Naveh
Software designer and engineer, Netro Corporation

----------
So long and thanks for all the fish (Douglas Adams, Hitchhiker's Guide)


Quote:
> Wondering if anyone can provide me a clue....

> I wrote a regular 32-bit c dll with vc++ 4.0 and am calling it from a vb
4.0
> 32-bit application.

> The small function in the c-dll takes a char * from a vb string, does
some
> manipulations on it, and passes back another char *.

> When debugging from c, the char * to about to be passed back looks fine,
but
> when back in vb, it's truncated or messed-up.

> This happens most times when the app is run, but it has also worked
correctly
> as well, though I don't know why.  I've tried, from vb, both setting and
not
> setting a variable-length to space(128)...Still a problem.

> Any ideas are appreciated.  Thanks in advance.

> Rgds,
> MAH.

> -----BEGIN PGP PUBLIC KEY BLOCK-----
> Version: 2.6.2

> mQBtAzEeqw4AAAEDAMDvcqrZmWy3NUVirGeyiACKPetKzYPRut9V8Wpd+p0B8pbO
> kWMlhf5PFrN68ZKBisjd6cAojztXVwNSC81M09PBD1P6OX/BjI1eCPNu5bGBt+NF
> qigRJ0OWy6pEgwBlAQAFEbQhTWFyayBBLiBIYWxsZXJtYW4gPG1haEBwYW5peC5j
> b20+
> =i5tF
> -----END PGP PUBLIC KEY BLOCK-----



Tue, 17 Nov 1998 03:00:00 GMT  
 Calling a user-written 32-bit dll from 32-bit vb 4.0


[...]

Quote:
>This happens most times when the app is run, but it has also worked correctly
>as well, though I don't know why.  I've tried, from vb, both setting and not
>setting a variable-length to space(128)...Still a problem.

[...]

Is the string declared in VB fixed-length?  I.e., Dim sBuf as string *
128.  That may help.



Wed, 18 Nov 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. TIME TO WIN 32-Bit DLL for VB 4.0 32-Bit or Higher (VB5)

2. How to create 32-bit DLL in Watcom C and call from 32-bit VB

3. Calling 32-bit DLL function from 32-bit VB4 app

4. TIME TO WIN 32-Bit (v4.04) (+750 functions) for VB 4.0 32-Bit

5. Need to write 32-bit DLL to do 16-bit calls to a software interrupt

6. 16 bit API calls in VB 3 supported in 32 bit VB 4.0

7. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

8. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

9. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

10. CARDS.DLL 16 Bit doesn't work on VB 4.0 32 Bit

11. calling a 16-bit dll from VB 32-bit

12. Problem calling DLL from 32-bit VB 4.0

 

 
Powered by phpBB® Forum Software