[src] VB6 Plugin development example
Posted: August 24th, 2009, 2:36 am
Hi there. Well i'm new in this forum, but i want to contribute. I'm a VB6 coder, and i liked the way that LCDSmartie works, so i've developed this first plugin in VB6.
Yes, it's on VB6 without any wrappers, only with the VBAdvance Addin for VB's IDE. If some people worked with that addin, they will know that is possible to use all the VB functions on standard dlls, instead another ways that using VB functions will crash the application.
** if you don't have vbAdvance, you aren't able to compile this project... so, try to find vbAdvnace on google **
Well, for the Strings return on functions, i've used a trick. The code returns a Long value, that is a pointer to the String that you want to return.
That pointer it's a portion of memory, allocated by VirtualAlloc. And of course, when LCDSmartie calls the function again, the pointer used before its cleared and deallocated.
In this example, i've included 2 functions: a standard hello world and a function that says the name of the active window.
For the first function: will return:
Well, and the another function:
will return the active window title, for example:
Ok, i hope you like it
...
It's under Creative Commons BY-NC license

PD: Sorry for my bad english
Yes, it's on VB6 without any wrappers, only with the VBAdvance Addin for VB's IDE. If some people worked with that addin, they will know that is possible to use all the VB functions on standard dlls, instead another ways that using VB functions will crash the application.
** if you don't have vbAdvance, you aren't able to compile this project... so, try to find vbAdvnace on google **
Well, for the Strings return on functions, i've used a trick. The code returns a Long value, that is a pointer to the String that you want to return.
That pointer it's a portion of memory, allocated by VirtualAlloc. And of course, when LCDSmartie calls the function again, the pointer used before its cleared and deallocated.
In this example, i've included 2 functions: a standard hello world and a function that says the name of the active window.
For the first function:
Code: Select all
$dll(cocuslcd,1,hello,other)
Code: Select all
VB6: hello ; other
Code: Select all
$dll(cocuslcd,2,,)
Code: Select all
LCD Smartie ยท Post a new topic - Mozilla Firefox

It's under Creative Commons BY-NC license

PD: Sorry for my bad english
