|
Check out the EN_MAXTEXT notification, maybe it's what you need.
|
|
|
|
|
Hi,
I am calling this function, from my MFC app in VS 2005.
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);
If this call is made, printer selection dialog opens, if i select a printer and click ok, printing starts and everything works fine.
However, there is case, if the printer dialog is open and I do not click on ok and wait for a few seconds (say more than 10 sec), a server busy dialog shows up.
Server Busy
This action cannot be completed because the other program is busy. Chose
'Switch To' to activate the busy program and correct the problem.
But 'Switch To' activates the Start menu, and there is no way to make the
Server Busy error to go away except by killing my program altogether, and
then deleting the print task from the task list.
And i do not want to use, OLECMDEXECOPT_DONTPROMPTUSER for the second param.
Any suggestions please....
Thanks in Advance.
Saleem
|
|
|
|
|
What happens to the "server busy dialog" when you click OK on the print dialog ?
|
|
|
|
|
Nope, you cannot do anything with the app once the server busy dialog comes.
You have to kill the app from the task manager, and also the print window has to be killed.
|
|
|
|
|
I see..
I think this is because of the way how OLE request are dispatched : the OLE client sends a request which is not handled within the context of it current thread, rather by another thread (of course this may be dependent on the type of OLE server which you are dealing with).
Then the client blocks on sort of double events : one related to a timeout for a timer that has already been started ny the client, the other is related to a notification sent back by the OLE server which it finalizes the request job.
In your case, what happens is that the timeout occurs before the request is done.This has lead to a bizarre situation between the OLE client and the OLE server. Of course because of the way this has been internally coded (not because of your code).
I think your only solution is to try play on the timeout value or even force somehow the OLE framework not to show the busy dialog..
Link : http://support.microsoft.com/kb/248019[^]
Good luck.
|
|
|
|
|
Thanks for the inputs.
This what is tried ..
{
OleInitialize(NULL);
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);
OleUninitialize();
}
This does not work.
Then i tried this...
{
AfxOleGetMessageFilter()->EnableBusyDialog(FALSE);
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);
}
This did not work either.
Any inputs will be great.
Thanks,
Saleem
|
|
|
|
|
try COleMessageFilter::SetRetryReply in order to force your app, to repoll on the OLE server response, when the internal timer is expired.
|
|
|
|
|
Try this instead:
AfxOleGetMessageFilter()->EnableNotRespondingDialog(false);
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);
|
|
|
|
|
Hi to all!
I never used Pointer Functions, and now i'm trying to use a C Pointer Function in Visual Studio 2005. But there's a problem... the pointer function isn't working properly... This kind of functions doesn't work in the same way in C and in C++?
My pointer function declaration in C is:
void (*FktFunction)( void * RegistFuncPtr, TOnDriverEvent eventcallback);
and the call definition is:
(*FktFunction)(TDriverLayer_RegisterDevice, TSMAData_OnNewEvent);
At this time, the function TDriverLayer_RegisterDevice isn't working at all.
The declaration of that function is:
int TDriverLayer_RegisterDevice(struct TDevice * newdev);
Anyone could help me with this?
Best regards.
|
|
|
|
|
ajorge2008 wrote: void (*FktFunction)( void * RegistFuncPtr, TOnDriverEvent eventcallback);
RegistFunctPtr is NOT a function pointer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hum... I've changed the Pointer Function definition to this one:
void (*FktFunction)( int (*RegistFuncPtr)(struct TDevice * newdev), TOnDriverEvent eventcallback);
But the register device function still not working
Could you give me any help please?
Best regards.
|
|
|
|
|
ajorge2008 wrote: But the register device function still not working
Which means what exactly ? Please be precise in your answer (e.g. if you have a compilation error, supply the error message).
|
|
|
|
|
Ok
I'm debugging the program that uses those functions mentioned earlier. I've attached a checkpoint on TDriverLayer_RegisterDevice function body and it doesn't stop there. So i'm thinking that when running my program, that function isn't even being considered. But we're calling it from (*FktFunction)(TDriverLayer_RegisterDevice, TSMAData_OnNewEvent); ?! That's the problem...
Best Regards.
|
|
|
|
|
Possibly you should post more code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Declaration:
void (*FktFunction)(int (*RegistFuncPtr)(struct TDevice * newdev), TOnDriverEvent eventcallback);
Calling:
(*FktFunction)(TDriverLayer_RegisterDevice, TSMAData_OnNewEvent);
Register Device Function Definition:
int TDriverLayer_RegisterDevice(struct TDevice * newdev)
{
struct TDevice * CurDev;
foreach(&DeviceBase, CurDev)
{
if (strcmp(newdev->cName, CurDev->cName) == 0)
{
return PHY_ERROR_DEV_TWICE;
}
}
newdev->DriverID = NextUniqueDriverID++;
ADDTAIL(&DeviceBase, &newdev->Node);
return PHY_OK;
}
|
|
|
|
|
ajorge2008 wrote: foreach
??? (the above is not a C++ statement).
ajorge2008 wrote: FktFunction
What function is this pointer assigned to?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
foreach is earlier defined as a function to search any kind of object we need to find in a list.
FktFunction pointer is assigned to
int TDriverLayer_RegisterDevice(struct TDevice * newdev)
|
|
|
|
|
ajorge2008 wrote: foreach is earlier defined as a function to search any kind of object we need to find in a list.
OK.
ajorge2008 wrote: FktFunction pointer is assigned to
int TDriverLayer_RegisterDevice(struct TDevice * newdev)
Nope: RegistFuncPtr points to TDriverLayer_RegisterDevice .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i have 2 files a.cpp and b.cpp
i want to use the variable (suppose int x) which is public in .cpp1 in .cpp2(means i want to asign the value in d=x in cpp2).then how i can acess the value x in cpp2 .
remember
cpp2 is a class
cpp1 is cpp1 is a class derived publilicly from ccdialog
|
|
|
|
|
If x is a member of the cpp1 class (what a bad name for a class) the you must have access to an instance of the cpp1 class in order to gain access to x .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
why do we need to use CreateCompatibleDC to create a DC even though we can create a Dc using CreateDC?
Regards,
KDevloper
|
|
|
|
|
Performance!!!
BitBlt between compatible DC as many TIMES faster than otherwise.
|
|
|
|
|
They are two different functions that create different kinds of DCs.
You don't "need" to use CreateCompatibleDC. You use it when you need
a memory DC compatible with an existing DC.
It's not the same as CreateDC.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
how i can use the code available in code project to my project..means suppose i need a different style buttons(whose .h and .cpp i download from net)and i want to use that perticular style button in my project then waht is the setting for that
thanks a lot
|
|
|
|
|