|
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
|
|
|
|
|
|
if u can't then don't ....
|
|
|
|
|
Now excuse me sir!
Have a think about it before you ask such foolish and useless questions.
What bloody button code? Which bloody article?
What was the response you got when you asked how to use the code on the page you downloaded it from? Is there not an example application that may be obtained from the article page?
Like you said - if you can't ask a reasonable & sensible question, then just don't!
|
|
|
|
|
I am using COXTreeCtrl from the Ultimate Toolbox in my code. I have a parent tree and under it, 4000 child items with unique IDs. When I click on the "ID" column for this tree, it is calling a CALLBCK procedure to sort these 4000 items.
But the real problem is THE TIME IT IS TAKING to sort 4000 items -- More than 5 Min.
Is there any way I could sort the column, which will take less time to sort??
|
|
|
|
|
Does it draw the tree during the sort process? I mean, do you see as items get swapped? Becuase you can speed up things a lot if you disable the repainting of the control while the process is running. You can try using SetRedraw(FALSE) just before you begin the sort and SetRedraw(TRUE) and RedrawWindow(NULL), after it. I hope that can help some.
|
|
|
|
|
No, the items are not getting swapped. I think it will draw the tree items only after completing the sorting process. And drawing of 4000 items is taking approximately 10 Sec of time.
I also tried SetRedraw() function while sorting but could not see any improvement.
While debugging, I observed that for sorting 4000 items, it is entering into callback procedure >100000 times.
Is there any way to sort the list using other than callback method??
|
|
|
|