|
-
Aug 30th, 2000, 06:45 PM
#1
Hi,
I'm in the process of writing a Function Library for common/everyday routines. I find it annoying when I have to write the same routine each time for a different project so I have decided to place them in a DLL.
Basically it has things like...
- Number Conversions (Bin2Dec, Hex2Bin etc. and vise versa)
- String Manipulation (Find, InStrRev etc.)
- Working with Hwnds (Many API's made easy)
- Full Registry access
- Extentions to current VB functions (IsNumberic = IsNumberEx)
Anyhow, I would still like to add a lot more to that. So my questions is: What kind of functions/routines would you guys like to be added to this?
-
Aug 30th, 2000, 07:52 PM
#2
Hyperactive Member
Files
You could add in file manipulation like creating directorys or moving files between directorys.
Matt 
-
Aug 30th, 2000, 08:12 PM
#3
Major one we do is...................
decimal place conversion
e.g
cFixed_Costs = 1.0092
cVariable_Costs = 1.8801
cTotal_Cost = (cAmount * cFixed_Costs) + (cAmount * cVariable_Costs)
display cTotal_Cost too two decimal places.
Haven't got the display stuff with me, am on site and it's all compiled away in a dll. But use this stuff all the time, cos vb is pretty lame on maths functions.
-
Aug 30th, 2000, 09:23 PM
#4
Frenzied Member
Could you write a C++ Dll that subclassed a window procedure but rader than have its own window procedure it called yours (pass the address to the dll as a parameter, it would return a pointer to it's own procedure that called the function for you. So you're actually subclassing through 3 window procedures rather than one) This way you could subclass foreign window procedures easily in VB without having to write a seperate dll for each one, I'm not sure how possible this is, you may have to do some clever stuff in the dll to get it to work, and you may have to limit it to simple window procedures (using variables in them may be tricky) But give it a go, it would be a huge help to a lot of people if you got that to work.
-
Aug 31st, 2000, 07:43 AM
#5
Thanks for your suggestons everyone.
-
Sep 1st, 2000, 03:54 PM
#6
Hyperactive Member
Add INI file control to your super DLL. I've got a few Snippets I can give you for other functions. Here's some number functions for you.
Code:
'Changes a Radian to a Decimal
Function Rad2Dec(rads As Long)
Rad2Dec = ((rads * 180) / 3.141592654)
End Function
'Changes a Decimal to a Radian
Function Dec2Rad(decs As Long)
Dec2Rad = ((decs * 3.141592654) / 180)
End Function
There's some functions for converting Radians to Decimals and vice verca. Hope this will help you out. Try maybe an API Wrapper DLL for newbies. Declare the API in a module and in a class module, put the function that calls the API. That way, all the user has to do is call the function without declaring it. Maybe this Idea is hard to understand.
Designer/Programmer of the Comtech Operating System(CTOS)
-
Sep 1st, 2000, 04:04 PM
#7
Monday Morning Lunatic
How about something so that we can access the Registry as if it were a treeview? You know:
Code:
Dim reg As clsRegistry
reg.Root(HKEY_CLASSES_ROOT).Children.Count
...for the number of child keys under HKCR.
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
|