Hi,
Previously I asked how to speed up and generalise a routine I wrote in VBA (and VBS and XAL( a darker portion of Microsoft our company works with)). Mainly the routine is to pass the next character substring from another character string using a string containing given delimiter characters like space, comma, semicolon, quote, double qoute, carrage return, linefeed etc. I got the answer to write a .dll in C++.
I successfully made a .dll in C++ passing integers to and from VBA fine, but no way I can find a way (I have tried several things,but VBA always crashes) or example of passing a string from C++ and VBA and vice versa. I confess I am C ignorant, but I am trying (I am Dutch so excuse my English). Even how a character string is supposed to represented in C(++) is an enigma to me this moment (I see Unicode character strings and Ascii/Ansi character strings discussions, but this seem irrelavent in VBA)
My aim would be:
VBA pseudo:
Declare Function ... "NextWord" ....
......
Dim Word as String * 255
Const Delim = " ,;'""" & vbCr & vbLf
Dim strParams as String
strParams = ..... (some string)
Word = String(Char(0),255) ' Reset Word To 255 Char(0)
Word = NextWord(strParams, Delim) 'Read first Word
Do While Word <> ""
.... process Word (first, next or last)
Word = String(Char(0),255) ' Reset Word To 255 Char(0)
Word = NextWord 'Read next Word
Loop
Can somebody point me in the right direction
Would be very gratefull.