|
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,
|
|
|
|
|
Converting from global(static) calling conversions to this-call,
van be made by using Boost library templates.
Find on the www this very widely used library.
___________
Problem not in direct performance but in delays that can cause killtimer,
to up to period of timer
that is already big performance - die.
|
|
|
|
|
Hi all,
New to programming, writing my first app using TCP.
I need to make a client server that will send messages to a server. Right now i have two dialog windows. One that takes in the IP that the user wants to connect to(Connection), and another window where the user will set the information that will be sent (Format_Msg). I would like to have a third window that tells me what is sent over and what it receives.
I can get the app to connect to the server, I just can not send the appropriate messages over to the server. I do all the connecting and instantiate a socket called ConnectServer in the Connection class. I do all the formatting of the message in the Format_Msg class.
my question is how do I send these messages now? I am trying to use the:send (SOCKET s, const char FAR * buf, int len, int flags) command but don't know what I am doing wrong.
Can I use the same connection that I made (ConnectServer), or do I have to instantiate a socket in the Format_Msg class too? If I don't, could you please tell me how I could get it to recognize the other socket that was instantiated in the Connection class?
If you have code to how i could do this, it would be great.
Many thanks in advance.
|
|
|
|
|
|
Hi,
I read those articles, thats how i got the app to connect to the server.
I am still having problems sending the information though. I don't know if I should be passing in the same connection or instantiating a new one in the second class. Don't know how to use the same connection actually. Can anyone help me with that?
Thanks in advance.
|
|
|
|