|
Thanks,
I will do that....
|
|
|
|
|
Hi,
I am trying to get the Cluster version and vendor id installed in the current machine.
I am using GetClusterInformation API for this...but i am getting "unhandled exception " problem for this..Please help me this.
Thanks in advacnce.
part of the code:
const int BufferLength=55345;
char Namme[BufferLength];
DWORD length = BufferLength;
LPCLUSTERVERSIONINFO lpClusterInfo;
lpClusterInfo->dwVersionInfoSize=sizeof(CLUSTERVERSIONINFO);
DWORD retVal = GetClusterInformation(cluster, name, &length, lpClusterInfo);
if i am using only GetClusterInformation(cluster, name, &length, NULL); this gives me the name of the cluster correctly.
|
|
|
|
|
programvinod wrote: LPCLUSTERVERSIONINFO lpClusterInfo;
lpClusterInfo->dwVersionInfoSize=sizeof(CLUSTERVERSIONINFO);
You are using uninitialized pointer.
You need to modify to ,
CLUSTERVERSIONINFO ClusterInfo;
ClusterInfo.dwVersionInfoSize=sizeof(CLUSTERVERSIONINFO);
DWORD retVal = GetClusterInformation(cluster, name, &length, &ClusterInfo);
p.s. Please read forum guidelines, such questions should be asked in VC++ forum.
|
|
|
|
|
I have initilized it....as
LPCLUSTERVERSIONINFO lpClusterInfo;
lpClusterInfo->dwVersionInfoSize=sizeof(CLUSTERVERSIONINFO);
|
|
|
|
|
Come on !
Pointer needs to point some thing valid. Here , you have just declared it, and not initialized with any CLUSTERVERSIONINFO address.
|
|
|
|
|
Awesome !!!
It works !!! Thanks a loooot!!!
Can you please please reply to another thread that i have started.
Do you know any API to get the Cluster Internal and exteranal IP ???
|
|
|
|
|
I want to Show the hour of execution of a process i try for:
System:iagnostics:rocess^ p1<br />
ListViewItem^ item1 = gcnew ListViewItem(p1->StartTime.ToString());<br />
listView1->Items->Add(item1);
But they are error on execution:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.dll
Additional information: Accès refusé
But this is work, it get using of memory:
item1->SubItems->Add(p1->WorkingSet.ToString());
listView1->Items->Add(item1);
Help me, to get solution for this problem;
Thank you
|
|
|
|
|
You don't have access to obtain information on every process on your system. If you run the following code, you may get an access violation:
array< Process^ >^ processes = Process::GetProcesses();
for each (Process^ process in processes)
{
Console::WriteLine(L"{0}: Started {1}",
process->ProcessName ,process->StartTime);
}
Read the following:
http://www.codeproject.com/dotnet/UB_CAS_NET.asp[^]
-- modified at 13:06 Monday 12th March, 2007
-- modified at 13:49 Monday 12th March, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I'm a bit new to this TCHAR stuff, so I'm confused as to how to do what I need to do.
I created a struct
struct gaugeSound
{
int buffer;
TCHAR* filename;
// char* filename;
bool loop;
bool isLoaded;
};
That I originally stored a filename in as a char*, but later changed to TCHAR* to try to deal with this issue. This has not worked.
With the above struct, I do this:
gaugeSound sound_EngOut = { 0, L"sound\\B206B-III\\Loop_EngOut.wav", true, false };
(here I added the 'L', but originally I just used a char*)
Then I try to do this:
LoadWaveFile(sound_EngOut.buffer, sound_EngOut.filename);
sound_EngOut.isLoaded = true;
however the LoadWaveFile() function was defined like this:
extern "C" VOID LoadWaveFile( WORD BufferN, TCHAR* strFileName )
{
// Create the sound buffer object from the wave file data
if( FAILED( CreateStaticBuffer( BufferN, strFileName ) ) )
{
return;
}
else // The sound buffer was successfully created
{
// Fill the buffer with wav data
FillBuffer(BufferN);
}
}
so originally I changed it to this:
//extern "C" VOID LoadWaveFile( WORD , const char* );
but since that didn't work I am trying to go with the original again.
Yet... there is a problem.... as in this function...
HRESULT CreateStaticBuffer( WORD BufferN, TCHAR* strFileName )
{
HRESULT hr;
// Free any previous globals
SAFE_DELETE( g_pWaveSoundRead [BufferN]);
SAFE_RELEASE( g_pDSBuffer [BufferN]);
// Create a new wave file class
g_pWaveSoundRead[BufferN]= new CWaveSoundRead();
// Load the wave file
if( FAILED( g_pWaveSoundRead[BufferN]->Open( strFileName ) ) )
<snip...>
the Open() call above requires (in WaveRead.cpp) a CHAR* !!!!!!
So, it seems that I have no clue how to use this DirectSound code that has been programmed with TCHAR*, especially since when I use the 'L', the above function can then not be called.
Help! What the heck am I supposed to begin doing?
|
|
|
|
|
It's up to you, as always to use the proper data types in C++.
The type TCHAR's actual type will vary depending on if you've defined _UNICODE, _MBCS, or neither.
If you choose to use the generic text mappings, and you use an API that requires a different type
char, then you'll need to convert strings to the appropriate type before passing them, or use
the appropriate type string literals.
Here's a link to the docs: Using Generic-Text Mappings[^]
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Thanks for the links.
Turns out the problem was that I had UNICODE defined and didnt' know it.
|
|
|
|
|
This is more on the mathematical side but I'm trying to convert metrics to english and vice versa.
I've got the main coding done but my equations are off. Maybe it's because I've been working on this for about 3 days straight and just cannot see what I'm doing wrong, OR I'm just have no clue as to what I am doing in the first place. LOL
here is the code I have for converting metric to english (grams and kilograms to pounds and ounces):
const double KILOGRAMS_PER_POUND = .454;
const double POUNDS_PER_KILOGRAM = 2.2046;
const double GRAMS_PER_KILOGRAM = 1000;
const double OUNCES_PER_POUND = 16;
const double GRAMS_PER_POUND = 453.59;
void convert_M_to_E( double £s, double& ounces, double grams, double kilograms)
// Parameters: Grams and kilograms values to be converted to pounds and ounces
// and references to variables that hold pounds and ounces
// Returns: None
// Calls: None
{ double total_pounds; // Grams and kilograms converted to pounds
double total_grams; // Pounds and ounces converted to grams
total_grams = grams + kilograms / GRAMS_PER_KILOGRAM;
total_pounds = total_grams / GRAMS_PER_POUND;
pounds = int( total_pounds );
ounces = pounds/OUNCES_PER_POUND;
} // End of convert_M_to_E()
And here is the code I have to convert English to Metric:
void convert_E_to_M( double pounds, double ounces, double& grams, double& kilograms)
// Parameters: pounds and ounces values to be converted to grams and kilograms
// and references to variables that hold grams and kilograms
// Returns: None
// Calls: None
{ double total_pounds; // pounds and ounces converted to pounds
double total_grams; // pounds and ounces converted to grams
total_pounds = (pounds + ounces)/OUNCES_PER_POUND;
total_grams = GRAMS_PER_POUND * total_pounds;
grams = double (total_grams);
kilograms = grams/GRAMS_PER_KILOGRAM;
} // End of convert_E_to_M()
I know I've got it completely wrong... can anyone help??
Thanks,
Ruby
|
|
|
|
|
You've done a good job of asking a detailed question, and showing hte code you've written to try and solve the problem. However, it looks to me like C++ code, and not C++/CLI. Please ask in the right forum.
RubyM wrote: double total_pounds; // Grams and kilograms converted to pounds
double total_grams; // Pounds and ounces converted to grams
total_grams = grams + kilograms / GRAMS_PER_KILOGRAM;
total_pounds = total_grams / GRAMS_PER_POUND;
pounds = int( total_pounds );
ounces = pounds/OUNCES_PER_POUND;
1 - NEVER declare your variables at the top, unless you use them right away. If this is actually C code, then you must do that, and you really are in the completely wrong forum.
2 - NEVER declare a variable without giving it a default value
3 - I do think you're doing the conversion wrong, but if your answer is only a little bit wrong, even double does not give exact answers.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sorry about posting in the wrong forum... I'm a student, and to be honest, I don't know what the difference is between C++/CLI or any other C++ programing. All I know is that it's C++ and this forum has "C++" in the title.
Sorry again.
Ruby
|
|
|
|
|
Hello,
Jus try:
1. total_grams = grams + kilograms * GRAMS_PER_KILOGRAM;
2. ounces = pounds*OUNCES_PER_POUND;
3. total_pounds = pounds + ounces/OUNCES_PER_POUND;
Regards,
|
|
|
|
|
For many years, I have been "naughty" in reusing my classes by copying the relevent files in to my current project in MSVC - I knew that I should be generating a library, but I was lazy !!! I have now generated a library and tried to alter my project settings to use MyLibrary. (I have experimented with a known working project) I have referenced the library by stating the path in MSVC/Project/Settings/Link and adding it to "Object/Library modules".
When I compile/link the project without making any source code changes (apart from adding a constructor for a class contained in MyLibrary), I get loads of errors (just under 200 !!), one of which I quote below:-
nafxcwd.lib(wincore.obj) : error LNK2005: "public: virtual void __thiscall CWnd::OnFinalRelease(void)" (?OnFinalRelease@CWnd@@UAEXXZ) already defined in mfc42d.lib(MFC42D.DLL)
If I remove the constructor for the class contained in MyLibrary, it links without error.
Can someone pin-point what I am doing wrong in the setup of my project within the MSVC (vers 6.0) build and usage of MyLibrary ?
Doug
|
|
|
|
|
DougButtimer wrote: 6.0
VC6.0 does not support C++/CLI, therefore this is the wrong forum, try the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My apologies !! I realised that I had the wrong forum JUST after I posted it, but decided to let it go in case someone on this side knew the answer !!
Doug
|
|
|
|
|
Hello,
I am developing a dozen or so C++/CLI assemblies in my solution. When I apply even a smallest change to one of them (so the binary is updated on build), all other assemblies that refer to this modified assembly are getting fully rebuilt (along with their precompiled headers). It takes quite a lot of time, and seem completely unnecessary to me, as I am not modifying any interfaces, only implementations.
Is there a reasonable way to prevent the dependent assemblies from being rebuilt?
|
|
|
|
|
I need to create an 2 dimension array, wich type is picture box, so I have write such code:
<br />
private: static unsigned short int n = 100;<br />
private: static array < System::Windows::Forms::PictureBox^ >^ m; <br />
m = gcnew array < System::Windows::Forms::PictureBox^ > (n);<br />
for(int i=0; i < n; i++){<br />
m[i] = gcnew array < System::Windows::Forms::PictureBox^ >(n);<br />
for( int j = 0; j < n; j++){<br />
m[i, j] = gcnew System::Windows::Forms::PictureBox();<br />
m[i, j]->Location = System::Drawing::Point(200 + i, 250);<br />
m[i, j]->Visible = true;<br />
m[i, j]->Size = System::Drawing::Size(1, 1);<br />
m[i, j]->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;<br />
m[i, j]->Load("a.gif");<br />
Controls->Add(m[i, j]);<br />
}<br />
}
but i get an error, that this array is not 2 dimension
what can be wrong?
|
|
|
|
|
To create it in two dimensions, you need to create an array of arrays.
private: static array < array < System::Windows::Forms::PictureBox^> >^ m;
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thank you for your help
|
|
|
|
|
array<System::Windows::Forms::PictureBox^,2>^ m;
m = gcnew array<System::Windows::Forms::PictureBox^,2>(n,n);
|
|
|
|
|
i would adding a menu on treeView,i try
TreeNode^ eventLogsNode = gcnew TreeNode("Event Logs");<br />
eventLogsNode->ImageIndex=2;<br />
eventLogsNode->SelectedImageIndex=2;<br />
eventLogsNode->ContextMenuStrip=computerContextMenuStrip;<br />
treeView1->Nodes->Add(eventLogsNode);
But they are error:
error C2065: 'computerContextMenuStrip' : undeclared identifier
|
|
|
|
|
i would set the shortcut menu associated with this tree node
-- modified at 15:40 Saturday 10th March, 2007
|
|
|
|
|