|
ScotDolan wrote: the mainloop class inherits,
ClxThread object, and Poll_LenzeInvertors object. The Poll_LenzesInvertors objects also inherits ClxThread object.
Not a good idea. This is known as the diamond multiple inheritance[^] problem and is usually indicative of a design problem.
led mike
|
|
|
|
|
Is there any Network based API Call to determine whether a machine exists on a network, a bit like what the '_access' call does for files?
|
|
|
|
|
Not sure, but I would guess there is, have you checked the Network API Documentation?
led mike
|
|
|
|
|
Thanks Mike!
Gonna use NetWkstaGetInfo()
|
|
|
|
|
rw104 wrote: Is there any Network based API Call to determine whether a machine exists on a network...
Will IsDestinationReachable() work for you? If not, how about NetServerGetInfo() or NetWkstaGetInfo() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sounds good thanks!!!
|
|
|
|
|
I am trying to write a simple GDI program that displays a countdown timer(MM:SS:hh). I am just using the WM_PAINT message to display the updated time and calling InvalidateRect() in my main loop. This however causes the screen to flash as I am clearing the screen before I redraw the text.
FillRect(hdc, &rPos, (HBRUSH)GetStockObject(BLACK_BRUSH));
DrawText(hdc, stTime, stTime.GetLength(), &rPos, DT_CENTER | DT_WORDBREAK); Any suggestions on how I can stop the text from flashing while still being able to update at hundreths of a second?
Thanks, Dustin
|
|
|
|
|
InvalidateRect with the last [bErase] parameter FALSE. This will prevent from flickering.
If you will have a problem with the messed drawings (caused by previous drawings) you could use non-transparent mode or somth else like drawing a new background before the actual text is drawn [which I could see is done by your FillRect call].
--
=====
Arman
|
|
|
|
|
I had actually been using InvalidatRect with bErase set to false. The problem was that I was using transparent mode as you stated, and not seting the background of the text like Mark suggested.
Thanks for the help, Dustin
|
|
|
|
|
Now you are doing right.
The problem was that I was using transparent mode as you stated
Well, I said use 'non-transparent'
--
=====
Arman
|
|
|
|
|
Instead of drawing the background and drawing the text in two steps, try doing it in one:
::SetTextColor(hdc, RGB(0xFF,0xFF,0xFF));
::SetBkColor(hdc, RGB(0x00,0x00,0x00));
::DrawText(hdc, stTime, stTime.GetLength(), &rPos, DT_CENTER | DT_WORDBREAK);
You'll also want to follow Arman's advice so the background doesn't get repainted every update.
Also, WM_PAINT isn't the only place you can draw on the window from. You can draw the text from
anywhere you want. WM_PAINT messages are low priority so if you need better performance do
the DrawText from elsewhere. If it's from a different thread, you need to sync acess to the
HDC as always.
*edit* (Thanks Michael Dunn)
You'll still need to redraw the window contents in response to WM_PAINT and/or
WM_ERASEBKGND so the window is refreshed when it needs updating (e.g when another window is
dragged across it and/or off it).
*end edit*
Mark
-- modified at 14:21 Monday 14th May, 2007
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks for the halp Mark, that worked perfectly. I've become so dependent on DirectX I've forgotten how to use GDI properly.
Dustin
|
|
|
|
|
Mark Salsbery wrote: Also, WM_PAINT isn't the only place you can draw on the window from. You can draw the text from anywhere you want.
This is true, but if you do any drawing outside of WM_ERASEBKGND and WM_PAINT , you'll need to manually redo the drawing if the window becomes uncovered. (This is what causes people to ask "I draw something in WM_INITDIALOG but it goes away if I move another window over mine.") If you do all drawing in response to those two messages, you won't need to do that bookkeeping.
|
|
|
|
|
Yes. I should have included that in my response.
Thanks Mike!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello, I have an Xml and I want to put data from it in tables how can I do this ...please if you have an idea of example or something like this..help me...thanks
|
|
|
|
|
Are you wanting to know how to parse the XML file?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to know how can I put data from XML in a table so I can use this data...in may code in c++
|
|
|
|
|
lavy2883 wrote: I want to know how can I put data from XML...
So are you already parsing the XML file?
lavy2883 wrote: ...so I can use this data...
Have you successfully created the database and table(s)?
What type of data source (e.g., ODBC, DAO, ADO) are you using?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I created the Xml file...and now I have my function like this...
void readfromfile()
{
String^ strFName = gcnew String("d:\\Contload.xml");
DataSet^ ds = gcnew DataSet();
DataTable^ table;
DataRow^ row;
int i;
try
{
ds->ReadXml(strFName);
DataRowCollection^ dr = ds->Tables[0]->Rows;
}
finally
{
delete strFName;
}
}
but I don't know how to do next....to put the data from the Xml in Tables[]
I created an for like...
for (i=0; i<ds->Tables->Count; i++)
{
table = ds->Tables->Item[i];...................
.......}but it give me an error :
Error 6 error C2039: 'Item' : is not a member of 'System::Data::DataTableCollection' ...
|
|
|
|
|
So wouldn't it make more sense to ask your queston in the Managed C++ forum?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You have another error. this is the C++/MFC forum and does not pertain to .NET development. There is a C++/CLI forum for those subjects. Also see the many, many, many Database articles for C# here on CodeProject. They will show how to work with database in the .NET platform.
led mike
|
|
|
|
|
led mike wrote: You have another error. this is the C++/MFC forum
But why another error?
|
|
|
|
|
Is it possible to compile an exe to include inside of it some dlls.
That is: my exe size is less than 1MB, and I have some dlls (10MB) that the program needs,.....I would like to have only the exe, that probally will be 11MB.
Is there a flag in the project properties?
thanks
Cheers,
Russell
|
|
|
|
|
Link with the static library.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes...it is exactly what I'm searching for....but I'm not finding the flag on VS.
Can you tell me the path of this flag?
many thanks.
Cheers,
Russell
|
|
|
|