Page 1 of 1

[src] VB6 Plugin development example

Posted: August 24th, 2009, 2:36 am
by el coco
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:

Code: Select all

$dll(cocuslcd,1,hello,other)
will return:

Code: Select all

VB6: hello ; other
Well, and the another function:

Code: Select all

$dll(cocuslcd,2,,)
will return the active window title, for example:

Code: Select all

LCD Smartie ยท Post a new topic - Mozilla Firefox
Ok, i hope you like it ;)...
It's under Creative Commons BY-NC license
Image

PD: Sorry for my bad english :P

Re: [src] VB6 Plugin development example

Posted: August 28th, 2009, 8:29 pm
by limbo
Great work... Thanks for your example.

Re: [src] VB6 Plugin development example

Posted: August 30th, 2009, 5:14 pm
by el coco
limbo wrote:Great work... Thanks for your example.
:D

if the project admins wants to add this example to the source of the next release, it will be great =)