?
Solved

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

Posted on 2003-02-27
3
Medium Priority
?
869 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Progress
Introduction to Processes
Suggested Courses

777 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