|
Christian Graus wrote:
anything you can calculate once and put in a variable, do it.
...but run a benchmark after each sub-optimization. quite often you'll hit a point where the compiler's optimizer will start to fight you: ie. it can do a better job if you don't make a certain optimization.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
Make sure you building in release mode with optimize for speed.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I'm looking for the linker equivalent to the #pragma warning (disable:xxxx) directive that will enable me to suppress, or disable, specific linker warning messages.
Cheers,
Tom Archer - Archer Consulting Group
Programmer Trainer and Mentor and Project Management Consultant
|
|
|
|
|
Hey,
I have a simple problem. I want the toolbar buttons to respond to double-clicking. Can i do this directly or do i have to create a toolbar(or rebar) manually with all the buttons and add a double-click event to a particular button? Can someone give me some pointers?
thanks and greetings Joris
|
|
|
|
|
This is completely non-standard and I'm sure will baffle your users. Why do you want to do this?
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Hey,
It isn't really a necessary item. But i want the toolbar buttons to do more then just invoke a command or open a dialog. I see that one can add controls to the rebar, guess i should read up on that. Btw, i'm just started using MFC, so i don't know all that is possible and not.
|
|
|
|
|
Does anyone know how to supress autorun programically?
I am using a C++ MFC Dialog based app in Visual Studio .Net 2003. I have tried the following code from MSDN but it doesn't work.
<code>
UINT g_uQueryCancelAutoPlay = 0;
BOOL DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
...
default:
if (!g_uQueryCancelAutoPlay)
{
g_uQueryCancelAutoPlay = RegisterWindowMessage(TEXT("QueryCancelAutoPlay"));
}
if (uMsg == g_uQueryCancelAutoPlay)
{
SetWindowLong(hDlg, DWL_MSGRESULT, TRUE);
return 1;
}
}
}
</code>
It seems that the registered message QueryCancelAutoPlay is never being recieved by
<code>
if (uMsg == g_uQueryCancelAutoPlay)
{
SetWindowLong(hDlg, DWL_MSGRESULT, TRUE);
return 1;
}
</code>
Any solutions ?
|
|
|
|
|
Is your application in the foreground? Otherwise, you must implement the COM interface.
From the MSDN 'Autoplay in Windows XP: Automatically Detect and React to New Devices on a System':
If the application wants to cancel Autoplay only when it's in the foreground, the application can listen to the QueryCancelAutoplay message. To cancel Autoplay, whether or not it's in the foreground, an application must implement the IQueryCancelAutoplay COM interface. The application then registers a component implementing this interface in the Running Object Table (ROT). The component will be called whenever an event generates an Autoplay action.
The QueryCancelAutoplay message only comes to the application in tthe foreground.
|
|
|
|
|
Okay, thanks I got it working.
How do you implement the COM interface version you mention?
Thanks
|
|
|
|
|
I have only done the message processing manner like you have, and I remember that my application had to be in the foreground (it was anyway, as part of a setup program).
The MSDN article I referenced had some links, perhaps to source code. Maybe it has an example of the COM interacce. I did not look.
|
|
|
|
|
Thanks,
It did have source code but for some reason the com part doesn't work.
It just gives the message not listening on a cd insert.
The article says:
To cancel Autoplay, whether or not it's in the foreground, an application must implement the IQueryCancelAutoplay COM interface. The application then registers a component implementing this interface in the Running Object Table (ROT). The component will be called whenever an event generates an Autoplay action.
So, in their example I clicked the appropriate box and it just says its not listening.
Thanks for your input.
|
|
|
|
|
I figured it out. You have to add a registry entry to get the com method to work.
|
|
|
|
|
is it possible to dynamically add image and text (using functions such as InsertMenuItem() ) to menu on Win98?
(not owner-draw)
if yes, How?
thx
|
|
|
|
|
I doubt it - that's what owner draw is for.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
SetMenuItemBitmaps() can be used to add a bitmap to the menu. But for anything fancy you have to use owner-draw.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi Arends,
thx, i will test the function soon.
|
|
|
|
|
Hello Include!
if you want to do it by using api ways
use SetMenuItemInfo();
if you like i will post sample Menu Code using SetMenuItemInfo()api
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I need to deliver myself a voice message over TAPI.
I know this can be done on P2K quite easily but I need to do it on a win98 machine, I also am not sure if my Modem is UNIMODEM/V
- HP E-USB UM9100.
Has any one got snippets of code on how to rec=direct a wav file or SAPI voice to a phone call. I've written the TAPI stuff and its OK so is the SAPI stuff but having probelms redirecting to modem instead of sound card. SAPI5 doesnt seem to like win98 but I'm hoping that its surely possible even if with just wav files.
Thanks W1sd0m
|
|
|
|
|
I need to write a proprietary UDP protocol.
How do I access the lower level drivers either in windows(preferable) or Unix.
I do not want to mess around with the IP packets and H/W initialization, but I do want to create my own UDP headers and trafic rules.
Does anyone have a code example?
|
|
|
|
|
Does opening the socket as SOCK_RAW rather than SOCK_DGRAM do what you want?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello!
I have a dialog-based main window. In this dialog there is a list control. By using the context menu, the user can open another dialog (think of properties of an entry).
Now the problem: when calling dlg.DoModal(), the main window quickly flickers a bit. It's not much, but annoying anyway.
Any chance to remove this flicker?
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
how do you transmit the datas to the child dialog ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
There isn't any. It's called directly from the main menu like this:
CMyMainDialog::OnAbout()
{
CAboutDlg dlg;
dlg.DoModal();
}
I'm doing some things in functions like PreTranslateMessage, OnInitPopupMenu, etc. but nothing of these should do anything... Is there anything you may not do in those functions? I'm just using simple functions, that don't modify the GUI directly, like getting the item count of a list control, etc.
Thanks for your answer and best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Perhaps you have a heavyweight OnEraseBackground() (in your parent dialog) that's getting called each time the child modal dialog is displayed?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I haven't overridden that function... Should I?
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|