- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see from the manual that if I do not include the string length in a call from vb6 to cvf, the string must be the same length in both languages eg
cvf
subroutine test(strng)
character strng*1024
vb6
strng as string * 1024
call test(strng)
But I find it works ok if I just use a normal string in vb6
strng as string
If the vb6 string is longer, then it is trucated in cvf. If the cvf string is longer, then it is padded out with nulls - at least for the cases I have looked at.
My question is; will it always be padded with nulls; or am I just picking up undefined locations which happen to be nulls?
You ask why do this? Well I produce a dll for use by writers of Excel macros, and would like to make use as simple as possible.
cvf
subroutine test(strng)
character strng*1024
vb6
strng as string * 1024
call test(strng)
But I find it works ok if I just use a normal string in vb6
strng as string
If the vb6 string is longer, then it is trucated in cvf. If the cvf string is longer, then it is padded out with nulls - at least for the cases I have looked at.
My question is; will it always be padded with nulls; or am I just picking up undefined locations which happen to be nulls?
You ask why do this? Well I produce a dll for use by writers of Excel macros, and would like to make use as simple as possible.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My question is; will it always be padded with nulls; or am I just picking up undefined locations which happen to be nulls?
I'm affraid the latter is the case. However, isn't it more flexible to pass the real string length as a separate argument? This is a bit more effort to Excel colleagues but at least bulletproof.
For strings that are INTENT(IN) in nature, you don't really have to know the length -- see this recent thread on how to declare a string of "right" length.
I think this MSDN article hits the nail.
Jugoslav
I'm affraid the latter is the case. However, isn't it more flexible to pass the real string length as a separate argument? This is a bit more effort to Excel colleagues but at least bulletproof.
For strings that are INTENT(IN) in nature, you don't really have to know the length -- see this recent thread on how to declare a string of "right" length.
I think this MSDN article hits the nail.
Jugoslav
Message Edited by intel.software.network.support on 12-09-2005 01:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The MSDN link is dead.
Can you respecify.
TX
Tim
Can you respecify.
TX
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I could swear it worked for me yesterday (but it doesn't today, it's Microsoft site ;-) )... try this form.
Jugoslav
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page