|
I am searching for a way to do a one-to-many data broadcast on internet, but since most routers have digestion problems with UDP broadcast i am looking for alternative. I have encountered multicast, but i dont know how covered is internet with multicast enabled routers...
Does someone know for any alternative? Central server is not an option.
|
|
|
|
|
Hi,
I a beginner VC++ programmer,
What are the step to folow to add a custom control to a dialog ?
thanks
|
|
|
|
|
1. If it's a ActiveX, just select and drag it to dialog
2. If you have a define class of it, add to project.
After that, use functions of this class to create control.;)
Hung Son
|
|
|
|
|
How can display a Bitmap image on FULL screen using MFC ?
Thanks
|
|
|
|
|
GetDC(NULL) will get a DC for the entire screen. You can then draw on to that DC in the normal way.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
How do you make to use derived CListCtrl (for example CListCtrEx) into CListView with CListView::GetListCtrl() call.
|
|
|
|
|
One way is to use CView instead of CListView. Derive a class from CView that has a CListCtrEx as a member variable. Create the CListCtrEx window as a child of the CView window in OnCreate (or OnInitialUpdate) in your CView derived class. Handle OnSize in your CView derived class to resize the CListCtrEx window to the client area of the CView window. Implement GetListCtrl in your CView derived class to return a reference to the CListCtrEx member.
|
|
|
|
|
When I enumerate all my network printers, I also get the Acrobat Distiller, and Microsoft Fax. Is there any way of telling the difference between actual hardware printers, and software versions? Thanks.
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Hi,
I've seen others putting in a sleep statment after a call to CreateThread(). They claim that you need to wait while the thread starts. This sort of makes sense but I can't find anything to confirm this in MSDN. I was wondering what you guys have to say on this subject. Here is what I've seen others do:
thread->CreateThread();
Sleep(750);
thread->PostThreadMessage(UWM_MY_MSG, 0, (LPARAM)info);
Do you need the Sleep statment? In my program it seems to work w/o it but i don't want it to crash when its released. 750 seems like a long time to wait if do have to wait. what is the shortest time you should wait (if you do)?
|
|
|
|
|
I dont think you need the Sleep in between unless you are doing some UI stuff. If so you'd prolly wanna make sure that the window is created and on screen before trying to do fancy stuff on it. But even for that using Sleep is a stupid approach. You can set some kinda event or some other such sync object that you can WaitForSingleObject on
Nish
My miniputt high is now 29
I do not think I can improve on that
My temperament won't hold
www.busterboy.org
|
|
|
|
|
As a rule of thumb, I would use an event object to signal the thread creation at start of ThreadProc, remove the Sleep and use a WaitForSingleObject.
750 ms is too much time to spend in some ocasions. But, if the machine is at 100% CPU, with lots of processes running in a slow machine, it may not be sufficient.
Crivo
Automated Credit Assessment
|
|
|
|
|
Use waitforsingleobject or with the threadID you can Know the status of the Thread, of is is running or not....
But if CreateThread returns valid Handle is because the Thread was created....
Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos' comment is the way I'd approach it as well - if it returns a valid handle the thread is up and you can post the thread message. Sleep is an extremely bad idea because it's arbitrary timing that leaves you wide open to race conditions in multithreaded apps (and debugging race conditions is less fun than you ever want to have).
If you want to wait until other processing takes place in your thread proc before you post the thread message, then you can use the other technique suggested here of setting an event in the thread proc when you're ready, and using a call of WaitForSingleObject() after your call to CreateThread().
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
The handle isn't signaled until the thread is terminated, not started.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
The handle isn't signaled until the thread is terminated, not started.
Absolutely. I probably didn't word things properly - I had meant that, as Carlos mentioned, that if beginthread returned a valid handle (instead of 0) then the thread proc had started, not that you should block on the handle. In the second example I meant to indicate that you signalled an event in the thread proc (that you created via CreateEvent(), etc.) and blocked on this after creating the thread if you wanted more control.
It's early here, I clearly need more caffeine...
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
It's early here, I clearly need more caffeine...
LOL, been there, done that.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi,
How do i can add printer like "add printer " from "control panel", i already have my own print driver, print processor. But i don't know how to add printer automatic ???
Please help me !!
Best regards,
mits
Never say "it's to late"
|
|
|
|
|
I've never used this command before, so iI may be completely wrong but there is an AddPrinter command. Look for it on MSDN. Perhaps this is what you're looking for?
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Use the function
HANDLE AddPrinter(
LPTSTR pName,
DWORD Level,
LPBYTE pPrinter
);
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I can't make my object get focus after clicking it while using normal view in word/excel.
Unlike in design view ,where u can resize the object....
|
|
|
|
|
So. Like I was saying, the powers that be took away my precious, precious ClassWizard. It used to be quite easy to add an OnInitDialog to my About box, just by going to the message map in the ClassWizard and adding a functino for the predefined OnInitDialog.
What are the steps to take to add one now, with the VC7 MDE?
- Jason
Do you have a Pulse?
SonorkID: 100.611 Jason
|
|
|
|
|
In vc7, there's no class wizard !!! Vc7 manage classes, files... by properties. To handle message, override method, virtual method, simple right click in your classes then select properties. the properties dialog should appear and then you can select message tab, attribute tab, or method tab and select what you need !!!
Hope this helpful !!
Good luck !
|
|
|
|
|
mits wrote:
In vc7, there's no class wizard !!! Vc7 manage classes, files... by properties.
I haven't moved to VC7 yet, and I've heard a lot of noise about no class wizard, but from what you're saying, it sounds like we didn't lose any functionality in this regard - they just moved it to a different UI.
Would this be a correct statement?
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
Hmm. Yes and now. There are wizards for most things like creating classes and projects. Creating methods or event handlers however, is much easier without the wizard interface and a welcome change.
Cheers,
Tom Archer
Author, Inside C#
Best mini-putt score = 22
|
|
|
|
|
I've found this MSDN page* that helps us with the transition.
* opens in new win
- Jason
Do you have a Pulse?
SonorkID: 100.611 Jason
Veni, vidi, VC
- I came, I saw, Visual C
|
|
|
|