Click to See Complete Forum and Search --> : Functions
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?
MPrestonf12
Aug 30th, 2000, 07:52 PM
You could add in file manipulation like creating directorys or moving files between directorys.
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.
Sam Finch
Aug 30th, 2000, 09:23 PM
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.
Thanks for your suggestons everyone.
Warmaster199
Sep 1st, 2000, 03:54 PM
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.
'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.
parksie
Sep 1st, 2000, 04:04 PM
How about something so that we can access the Registry as if it were a treeview? You know:
Dim reg As clsRegistry
reg.Root(HKEY_CLASSES_ROOT).Children.Count
...for the number of child keys under HKCR.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.