Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to use Cluster API (clusapi.dll) in Delphi?

Posted on 2003-02-27
3
Medium Priority
?
879 Views
Last Modified: 2013-11-13
Hi,

I'm currently trying to write a Cluster-Aware Service in Windows. Microsoft has provided us with clusapi.dll with all the necessary API to make a program cluster-aware.

The question is, how do I use it? Borland did not provide a unit which imports these APIs into Delphi. One of the procedure that I wish to use is GetClusterNodeState(). However, I do not know how to handle the result. I believe it is return as a DWORD, but not sure which value represent what state. MSDN Library is not very helpful towards Delphi programmers!...

Hope I get an answer soon...
Thanks!
Shah
0
Comment
Question by:ExpertWannbe
2 Comments
 
LVL 1

Accepted Solution

by:
ZhenyaS earned 200 total points
ID: 8054099
Hi. I use "clusapi.h" and "clusapi.lib" from VC++ but you can import functions from clusapi.dll. Code for checking node state can be like the following:

HCLUSTER hCluster = OpenCluster( L"<ClusterName>" );
HNODE hNode = OpenClusterNode( hCluster, L"<NodeName>" );
CLUSTER_NODE_STATE eState = GetClusterNodeState( hNode );
CloseClusterNode( hNode );
CloseCluster( hCluster );

<ClusterName> - name of the machine where a node is installed.
<NodeName> - name of the machine where a node is installed; can be different from <ClusterNode>

eState can be one of the following values:
ClusterNodeStateUnknown
ClusterNodeUp,
ClusterNodeDown,
ClusterNodePaused,
ClusterNodeJoining

Sorry I don't know how exectly it will be in Delphi but I am sure you can figure it out ;-)
0
 

Expert Comment

by:CleanupPing
ID: 9447464
ExpertWannbe:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Starting up a Project

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question