PDA

Click to See Complete Forum and Search --> : I know this might be a brain killer


Das Mad
Sep 24th, 2000, 07:45 PM
I am tired of the slow VB and I am tired of Designing in
Assembler(even though I use the best Compiler there is Pass32).

I can do Win32 DLL files in Pass32 4 Win32

I know that u always Push the Parameters to the stack when calling DLL's, And u get the Answer in eax

But I do not know how VB codes the "Declare" function

Example

Declare Function Proc Lib "C:\Asm\Pass32\WIN32\testdll.dll" (ByVal N As String) As string 'The VB Line

How does VB code "ByVal N as String", I guess that the offset to the string is pushed into the stack

And the most important Question

How do I get VB to Accept that the DLL returns a string

Paul282
Sep 25th, 2000, 09:04 AM
There are several different types of "Strings", in VB a string is like a pointer to a string pointer which is why you:

1) use StrPtr to pass a pointer rather than VarPtr
2) pass a vb string by value to a DLL expecting a string pointer.

If you need to pass a unicode string pointer then what I do is map the unicode to a byte array, and pass varptr(Bytes(0)) to the Dll as a long var.

If you need inline assembly and pointers with basic syntax try:
http://www.powerbasic.com

Das Mad
Sep 27th, 2000, 07:54 PM
Thanks for the tip Paul, hope I can use it.