Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel variables and VFP
Message
From
13/09/2004 04:55:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00937401
Message ID:
00941546
Views:
30
This message has been marked as a message which has helped to the initial question of the thread.
>Hello!
>
>I am guessing that this line
>myServer = "MyClass"
>BUILD DLL myserver from myserver recomp && the DLL is called myServer
>on a clien't machine will register the DLL, myServer, on a client machine.
>But is there faster way to find out if a DLL has already been registered?
>Thanks
>Steve
*function _IsClassRegistered
lparameters tcClass
#DEFINE HKEY_CLASSES_ROOT    -2147483648
#DEFINE ERROR_SUCCESS		0	&& OK

DECLARE Integer RegOpenKey IN Win32API ;
	Integer nHKey, String @cSubKey, Integer @nResult

DECLARE Integer RegCloseKey IN Win32API ;
	Integer nHKey

local lnKey
lnKey = 0
llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS )
if llRetVal
  RegCloseKey(lnKey)
endif
*vfp7 and up
*CLEAR DLLS 'RegOpenKey', 'RegCloseKey'
return llRetVal
You can call this as:

if _IsClassRegistered("myDllName.myClassName")
...

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform