|
It's the NetConnectionID member of the Win32_NetworkAdapter WMI class.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi,
I made an app with an ok and cancel button in visual studio c++ 2005, but they are blocky (old look). How can I enable the XP look and feel so these buttons look nice? My computer is running XP.
Thanks,
Max
|
|
|
|
|
Probably the easiest way is to open the stdafx.h file and near the bottom, you'll find an
#ifdef _UNICODE
...
...
#endif
Remove the #ifdef and #endif lines (leave the others). This will enable the manifest which will give you the new look.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I am trying to make use of the Containers::SortedList class for storing objects of my own class type and using an unsigned int type as the key.
I can add objects of my class each with a key value to the list no problem. However, I only seem to be able to obtain list values by using SortedList::GetByIndex . When I attempt the default[i] indexer or methods such as SortedList::IndexOfKey and SortedList::ContainsKey I get the following exception:
"An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
Additional information: Failed to compare two elements in the array."
I have no comparison method for my own class type but as the SortedList is sorted by the key value then I believe this should not matter.
Knowing that I have entered a key of 1 in the list, calling the following code results in the above exception occurring.
if(mObjectList->ContainsKey(1))
{
....
}
If anyone has any ideas that would be great.
|
|
|
|
|
I don't get it[^]
led mike
|
|
|
|
|
I want to show images in each subitem in List view of style report. I am able to show the image at the beginning of the subitem by SetImag API, but I want to place the image at the end. The image should be after the text. How can I do that?
|
|
|
|
|
See the documentation for the OWNER_DRAW style. Also there will be samples and examples on MSDN and probably here on CodeProject as well.
led mike
|
|
|
|
|
I have more than 500 controls and for each of them i need to display tool tip, for this I have stored the tool tip data(min, max values) for every control in string table, now how do I display that stored data as tool tip dynamically?
-- modified at 10:58 Monday 26th March, 2007
|
|
|
|
|
how the user defined cursors & icons can be impliment in application window in SDK
I did create an cursor
stored it in project file
open it with note pad
save the cursore ID.
include the resourse file in program.
add the .rc file in resorse file & main code in header file
use the LoadCursor(hInstance,IDC_CURSOR1); in WinMain stuff.
Eventhough i m getting error " Undeclare IDC_CURSOR1
Plz help
Regards,
Shailesh Sali,
Response Team,
MH-GOA circle
Reliance Communication.
|
|
|
|
|
its_me_shailesh wrote: Implimentation of user defined cursor & icon in application window.
Replace ur LoadCursor call with the follwing:
LoadCursor(hInstance,MAKEINTRESOURCE(IDC_CURSOR1)); // should work now
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
its_me_shailesh wrote: Eventhough i m getting error " Undeclare IDC_CURSOR1
This indicates, you have not included resource header, where it needed.
its_me_shailesh wrote: use the LoadCursor(hInstance,IDC_CURSOR1);
As already shown, use macors MAKEINTRESOURCE .
|
|
|
|
|
Hi all,
How can I remove a null character froma array of charater pointers.
See the thing is I'm reading data from a file, and sending the data over TCP/IP to the host, and the host writes the data to a file, but the data in the file looks all funny, with a strange little charater (null 0x00).
How can I remove that from every element in the array?
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
You could replace it with a space. Or, you could use memcpy to move your memory down so it's just gone ( this is more expensive ).
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 )
|
|
|
|
|
I need help with the following code that will also output the warmest and coldest days entered:
#include "stdafx.h"<br />
#include "hightemp.h"<br />
#include <vector> <br />
#include <fstream><br />
#include <iostream><br />
#include <iomanip><br />
#include <string><br />
<br />
<br />
using namespace std;<br />
CWinApp TheApp;<br />
<br />
<br />
<br />
int main()<br />
{<br />
vector <int> daily_temp(31,0);
int num_values;
int index;
double average_high;
int total = 0;
<br />
do
{<br />
cout << "Enter the number of days for which you have data: ";<br />
cin >> num_values;<br />
if ((num_values < 1) || (num_values > 31))<br />
{<br />
cout << "The number of days must be in the range 1 to 31"<br />
<< endl;<br />
}<br />
} while ((num_values < 1) || (num_values > 31));<br />
<br />
for(index = 0; index <= (num_values - 1); index++)<br />
{<br />
cout << "Enter the high temperature for day " << index + 1 << ": ";<br />
cin >> daily_temp[index];
}<br />
<br />
cout << "The array contains high temperatures for " << num_values<br />
<< " days.\n";<br />
cout << "The values are as follows.\n";<br />
for(index = 0; index <= (num_values - 1); index++)<br />
{<br />
cout << "Day " << index + 1 << ": " << daily_temp[index] << endl;<br />
total = total + daily_temp[index];
}<br />
<br />
average_high = double(total) / double(num_values);<br />
<br />
cout.setf(ios::fixed);<br />
cout << "The average high temperature during the " << num_values<br />
<< "-day period was " << setprecision(2) << average_high<br />
<< " degrees.\n";<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
Can you tell what problem you are facing ?
|
|
|
|
|
I have no problem with the code when compiled, I just need help on how to output the high and low temperature
|
|
|
|
|
Each time you enter a new temperature, you check with the previous one entered if it is bigger or lower.
|
|
|
|
|
klutez123 wrote: // The following loop gets the high temperatures from the user for as
// many days as the user specified in num_values.
for(index = 0; index <= (num_values - 1); index++)
{
cout << "Enter the high temperature for day " << index + 1 << ": ";
cin >> daily_temp[index]; // input value into array
}
How about:
int low = 500;
int high = -500;
for (index = 0; index <= (num_values - 1); index++)
{
cout << "Enter the high temperature for day " << index + 1 << ": ";
cin >> daily_temp[index];
if (daily_temp[index] > high)
high = daily_temp[index];
else if (daily_temp[index] < low)
low = daily_temp[index];
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
We can't see many of the < or > characters in you post or what's between them; please revise and correct your post.
Steve
|
|
|
|
|
hello,
i want to get the mouse position outside of my window, for example with windows messages.
i can't find the funktion or some code for this.
can someone help me?#
thx
|
|
|
|
|
Isn't it GetCursorPos ?
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 )
|
|
|
|
|
Use GetCursorPos . Convert screen co-ordinates you will get to client co-ordinates.
|
|
|
|
|
I probably should be avoiding this, knowing that a request for a code sample might follow, but have you tried browsing the MSDN for "GetCursorPos", or anything containing the word "cursor"?
If not, please also try to remember from now on, that the "mouse" in most programming languages is referred to as "cursor".
The mouse is the device controlling the cursor. It's position on your desktop is not known by the system. ;) I.e, Unless you tell it you're left handed, it couldn't care less.
Cheers,
Gabriel
|
|
|
|
|
Hello,
I have created a windows service application in windows XP and VC++.Net.
In this windows service application, i am connecting to MySQL database on the same computer. My application is to get the USB plug-n-plays. I am opening the MySQL db not in the ServiceMain() of the service, rather, since i have to every time check for the database connection, so in case of everyrequirement.. i am opening the database and throwing the exception, on db connection failure.
I can see that, everytime the statement :
usbDB.OpenEx(szConnectString_USB,CDatabase::noOdbcDialog); is throwing the exception.
in the catch() block i reported the error too, but it is not displaying the error report.
After that, i restarted the system and then i see that, when i follow the debugger, the breakpoint at the usbDB.OpenEx(..) is not getting triggered.
myServiceMain(int arg, char *argv)
{
hStatus=RegisterServiceCtrlHandler(szServiceName, handlerFunc);
SetServiceStatus(hStatus, &ServiceStatus);
initService();
....
....
RegisterDeviceNotification(hStatus),&NotificationFiler,DEVICE_NOTIFY_SERVICE_HANDLE);
....
....
while(ServiceStatus.dwCurrentStatus=SERVICE_RUNNING)
{
/*do my task*/
....
....
}
ServiceStatus.dwCurrentStatus=STOPPED;
SetServiceStatus(hStatus,&ServiceStatus);
}
InitService()
{
/* intialisation code for my Service*/
}
I think, in the MyServiceMain(..) the code after the RegisterServiceCtrlHandlerEx(...) is not getting executed. So, the breakpoint kept inside the InitService() is not getting called. Even the breakpoint inside the MyServiceMain() is also not getting called. To trigger the breakpoints in the MyServiceMain() callback function, when i am stopping and restarting or restarting the service from the control panel... the service is not getting stopped ..it is only showing that... "stopping".
I have checked the dsn name, user id and password also... but i don know why, it is not getting connected to my windows service application.
Thank you
Anee
Anee
|
|
|
|
|
anumadhu wrote: myServiceMain(int arg, char *argv)
{
hStatus=RegisterServiceCtrlHandler(szServiceName, handlerFunc);
SetServiceStatus(hStatus, &ServiceStatus);
Are you initializing the contents of ServiceStatus somewhere? Also, if connecting to your database (not shown in the code you included) can take a noticeable period of time, you should do it AFTER you report to the SCM that your service is started.
Do you receive notification in your handlerFunc telling your service to stop? Do you handle those notification?
Judy
|
|
|
|