|
Maybe somebody of you can guide me you to use the QoS SDK in order to use it as a Bandwidth Manager. I've searched for hours but without any success, maybe there is an tutorial or source code available.
thank you
Mario
|
|
|
|
|
I am running Visual C++ 6.0 Standard and when i compile my programs, the compiler never completes. I must then end the process to close c++ 6. If anyone can help, it would be appreciated.
|
|
|
|
|
Does it happen for hello world type program ? all programs or just one in particular ?
put some of your code in comments, and check where it freezes ?
if nothing works, uninstall VC and reinstall, apply patches and service packs; upgrade platform SDK, ...
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Hi i'm writing a multithreaded TCP server with my own protocoll. I had to switch to a simple multithreaded model because Win9x doesnt support IOCP. I've looked at a lot of examples already, but still i face the same problem. The samples i've looked at have a client thread function that handles each client seperately (like and echo server of files transfer server or whatever). But the problem is that i need to be able to send data to all of the clients at once, like a chat server would do.. When someone types a message, it gets processed and depending wether its a private message or a message intended for a certain room or just all clients it is broadcasted or sent to a specific ip. I thought about making a list of all the socket handles that have a connection running and then simple making a function that sends the data on all these sockets but i am affraid this will mess up the threads somehow.. and that it is just too simple. Does anyone know how this is generally implemented?
Kuniva
--------------------------------------------
|
|
|
|
|
This DWORD offset points to a list of null terminated strings containing alternate RAS phone numbers. I have gotten it to work using Visual C++ 6.0/Windows 2000 but it only seems to allow phone numbers.
Does anyone know if there is some magic format that will allow me to include strings for the alternate phone entry comments line? We have been manually copy and pasting numbers for ISP's for our state in the phonebook files and would like to automate it. The comment line is necessary to identify what city the phone number is good for.
I can parse the phonebook for the entry's key after using RASSetEntryProperties and trigger off of 'DEVICE=modem' to insert the alternate list including the comments section but this seems somewhat cheesy.
Any suggestions or alternate solutions welcome,
Thanks
|
|
|
|
|
hello,
I have a big problem, I want to print a page (with MFC) and everything worked fine until I tried to print a colored text .... if I try to draw on printer CDC a color line or rectangle it works but with text don't ! why ?... if my color is less then RGB(255,128,0) the text is black if my color is greater the text is white ... please help ...
thanks!
|
|
|
|
|
maybe a silly answer..
but maybe your printer driver has got gray-scale set as default?
check out the DEVMODE -structur (membervar in CPrintDlg).
It has a member dmColor. It can be set to DMCOLOR_COLOR or DMCOLOR_MONOCHROME. Set it correctly and it should work.
<code>
CPrintDialog dlg;
m_DC = new CDC;
m_DC->Attach(r_printdlg.GetPrinterDC());
m_DC->m_bPrinting = TRUE;
DEVMODE* pDevMode = r_printdlg.GetDevMode();
pDevMode->dmColor = DMCOLOR_COLOR;
m_DC->ResetDC (pDevMode);
Maybe this works..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000. I have used some header files to support some functions , I have included a header file #include <afximpl.h> which is giving error
The error is:
fatal error C1083: Cannot open include file: 'afximpl.h': No such file or directory
Error executing cl.exe.
Can any body suggest why this error is coming and some way to solve this error.
I have this header file in my vc/src directory
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
Try this: #include "..\src\afximpl.h"
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
It could be a number of things. First click Alt+F7 (Project/Settings). Select the C++ tab, and the Preprocessor category. In the Additional include directories box, add the (absolute or relative) path to the ...\MFC\SRC folder.
Did that do it?
|
|
|
|
|
I tried this still the problem remains there.
Any other way ?
|
|
|
|
|
Ok, let's rule out the obvious. Put the absolute path to the .H file in the #include statement.
Also, what is your INCLUDE environment variable set to?
|
|
|
|
|
Dear David,
I have set the path to absolute but it didnot solved my purpose. what do you mean by:
...Also, what is your INCLUDE environment variable set to?
//////////////////////////
http://www.thecodeproject.com/shell/RecycleBin/RecycleBin_src.zip
/////////////
I compiled this code and it gave the header file error.
Can you plz run it on your system and tell what may be the error.
Thanks.
|
|
|
|
|
Ok, I compiled the code as-is and got the C1083 error. Then I simply followed the instructions here and it compiled fine.
|
|
|
|
|
How to activate some choosen thread?
Even if it in sleep(time) state.
Thanks you.
|
|
|
|
|
what do u mean with 'activate'?
please explain your situation a little more precise!
Don't try it, just do it!
|
|
|
|
|
Do you want your routine to be called by a timer?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
What you really wanted to ask did not come across very good.
Did you look up SetTimer() , which will call a function of your programm in regular intervals?
Does it help you?
If working with MFC, be sure to also look up CWnd::SetTimer() and CWindow::SetTimer() !
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I work with Windowless ATL ActiveX.
I need to implement Window class to get a timer?
Or a possible to use some system timer,
like myltimedia timer?
Or I can do it with system syncronizing methods and objects?
|
|
|
|
|
The Win32-API call SetTimer() can either send your window a WM_TIMER, or you can provide it with a function to call. This is probably what you want to do.
I do not have any idea about multimedia timers, so I can not tell you if they are of any value in your case.
As for system synchronizing methods, I do not understand you fully, but if you mean something like WaitForSingleObject() , then no, this won't wake your application from a Sleep() . If you need to wait until, say, a socket or disk IO times out, then it might help you (but I can not )
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Thanks you
for that (right) scenario - WaitForSingleObject(),
SuspendThread();
may be better be used.
Or system timer - does it immediately can be freed?
|
|
|
|
|
I used SetTimer() right before I call SuspendThread() to make the function sleep.
void CSleeperThread::run()
{
UINT_PTR pTimer = SetTimer(NULL, NULL, job.Schedule.GetNextRunTime(), TimerProc );
SuspendThread();
}
In SuspendThread() I pass a call back function called ThreadProc().
I've implemented ThreadProc() I use ResumeThread() and KillTimer() like so:
void CSleeperThread::TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
::EnterCriticalSection(&lock);
KillTimer(NULL, idEvent);
if(idEvent == pTimer)
ResumeThread();
::LeaveCriticalSection(&lock);
}
I used critical sections because in my class there's a possiblity that ThreadProc could be called again, before it's finished processing the first time. It may be overkill, I haven't tested that part yet.
Mike Ellertson
|
|
|
|
|
Thanksyou for response.
You of course right applied CriticalSection -
no one must relay on thread sequencies assumptions.
error may happen on whatever unpredictable situation.
So using this is a must.
___________
But about timer - did you test how fast this timer is killed?
In comparison with WaitForSingleObject()timing.
This is a main issue here...
Please compare effectivenes.
|
|
|
|
|
I haven't tested yet how fast the KillTimer() executes. You could be right, it may be a performance issue.
I found another solution to the static requirement on the callback function. I found that if I declared a global function like this:
VOID CALLBACK functionName(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
Then passed it to to SetTimer() as the fourth parameter like this:
uiPtr = SetTimer(NULL, NULL, uiSeconds, TIMERPROC(functionName));
The compiler allows me to pass a pointer to the callback function without declaring it as static. This is great, because then I can access non-static variables and function. Just a note, make sure you type case the functionName as TIMERPROC otherwise this won't work.
The problem I'm having now, and here's where I need some input, is I want to pass a member function to a class as my callback function. So here's what I'm trying to do:
VOID CALLBACK CSomeClass::functionName(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime) {
}
And then I try and pass this function pointer to SetTimer like so:
CSomeClass::otherFunction() {
UINT_PTR uiPtr;
uiPtr = SetTimer(NULL, NULL, uiSeconds, TIMERPROC(functionName));
}
That's when the compiler complains. Basically it says that it can't convert from void (__stdcall*)(CSomeClass::*functionName)(arglist...)
to void (__stdcall*)(*functionName)(arglist...)
so what I'm getting from this error is, SetTimer() is meant to be used on global functions only. There is a class impelementation of CWnd::SetTimer(). Has anyone used this and do you know if it will solve the above problem?
Thanks in advance,
|
|
|
|