For that prototype I think the following VB sub would work:
Sub myprint(ByVal s)
This should work because VB strings are really pointers to the string, so
by passing the pointer ByVal, VB gets a copy of the pointer to a string,
which is exactly what it expects.
Hope this helps,
Jason Bouzane
Quote:
> Hi,
> we are developing a VB applications that calls a DLL (written in C) that
> does
> some calculations. The DLL should print its output using a VB Routine.
> Thus,
> we would like to call the DLL with the address of a VB Routine as a
> paramter.
> The DLL then uses this routine to print values (for example to a message
> box).
> We succeded to give the pointer to the VB function to the DLL and to
> call
> this VB function from the dll. However, we did not manage to print out
> the
> C-style string. The C-Prototyp of the VB-function is:
> void WINAPI myprint(char *s);
> But how can we code this in VB? VB only knows its own strings, but no
> pointers.
> Anyone knows a solution?
> Thanks in advance,
> Juergen