|
-
Aug 20th, 2001, 03:35 AM
#1
C dll for vB
I want to recode an algorithm in my vb-program in c/c++ for faster execution. I think a dll is the only way to do that. But I have many problems using the vB "Declare" directive, so my quesiton is: is there an easy way to link into vBs COM? Is there maybe a predefined skeleton that provides functions to vB where I can simply write my function and register it?
This is something urgent, so plz help quick!
CornedBee
-
Aug 20th, 2001, 04:03 AM
#2
Monday Morning Lunatic
You don't need to register non-COM DLLs. Just code the function in C, and write a Declare for it.
If you search this forum for "Declare" (use my username) I made a long post about it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2001, 06:38 AM
#3
i can't find the post, maybe you can supply a link?
or tell me exactly what i have to type in the search form
thx
CornedBee
-
Aug 20th, 2001, 08:21 AM
#4
-
Aug 20th, 2001, 03:39 PM
#5
Monday Morning Lunatic
How about trying something like this:
Code:
declare sub reffunc lib LIBNAME (ByVal pArg as Long)
' ...
dim i as long
i = 20
reffunc VarPtr(i)
'...
This time, it's passing a Long value directly, using the return value of VarPtr which is like C's & operator: VarPtr(i) = &i
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 21st, 2001, 02:36 AM
#6
-
Aug 21st, 2001, 12:20 PM
#7
Monday Morning Lunatic
Hehe thanks Always nice to be appreciated 
Actually, whenever pointers are needed I always pass a Long by value (ByVal) using VarPtr (I'm still undecided on whether StrPtr does much different).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|