|
When you call UpdateData at the top, it pulls down the values into the variables. It's often a good idea to use <= if the value is decrementing rather than ==. There is no reason why, if you call UpdateData properly, you cannot do comparisons on this variable, in the same way you are passing it to a formatting function. It's probably time for you to do some tracing and see what is going on.
If you type TRACE("%d %s\n\r", m_timer(whatever it's called), m_StrTimer); and debug, you will get an output that shows you the values you are dealing with. That should give you a good idea why the values are failing to compare, both as a string and an integer.
Also, if you made the time a float, it will never *equal* 55, it will simply be less than 56 Other than that, without having the source here, I'm not sure what is going on.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Thanks for all your help!;)
Rob Jones
|
|
|
|
|
The m_strTimer2 String all ways seems to equal 0.. any ideas?
Rob Jones
|
|
|
|
|
I have a section of code that loads winspool.drv (at least I think that's what it's called). Due to what is going on at the time, this results in a bothersome performance hit. Is there a way to load this driver in earlier?
Thanks.
Paul Ebert
|
|
|
|
|
How do you stop a button from becoming 'default' (the thick black line around it) when it is clicked on?
|
|
|
|
|
you can modify the style of button by removing the BS_DEFPUSHBUTTON style
DWORD style=btn.GetButtonStyle()
style&=~BS_DEFPUSHBUTTON;
btn.SetButtonStyle(style);
|
|
|
|
|
I would like to know how can we handle messages from a child control, for example if a build a custom control that inside I create two edit control how I handle messages from both edit independently?
If I add an ON_EN_UPDATE or ON_EN_CHANGE handler it's ok for one edit but not for two.
Thanks for any help.
|
|
|
|
|
Using ON_EN_UPDATE is fine for two. They both have unique ID's so the messages can be mapped to unique functions.
Michael A Barnhart
mabtech@swbell.net
|
|
|
|
|
I have an MFC MDI application that works fine. I'm trying to add another window, outside of the main MDI window. When I create the child view for this 2nd window, a new blank view appears in the main MDI window, leaving the 2nd window frame blank. The frame, and view class are different for the 2nd window. I've tried tracing through the code and I can't figure out how the main window takes my new child window. There's something built into MFC that is causing this. What am I missing, how can I work around it? Naturally, I can create the window and ignore the frame/document/view architecture, but I'd rather not do that. If the following looks a bit strange, I'm following the example of an MFC wizard generated app without document and view support (the document isn't needed). I'm using this approach to try and reduce the ties to frame/document/view and make this work. Tried it the standard way and it didn't go either.
{
CMDIFrameWnd* pFrame2 = new CCalendarFrame;
// create secondary MDI frame window
if (!pFrame2->LoadFrame(IDR_CALENDARTYPE)) return;
// create a new MDI child window
pFrame2->CreateNewChild(
RUNTIME_CLASS(CCalChildFrm), IDR_CALENDARTYPE, NULL, NULL);
// The main window has been initialized, so show and update it.
pFrame2->ShowWindow(SW_SHOWNORMAL);
pFrame2->UpdateWindow();
}
Thanks!
|
|
|
|
|
Hi,
I have a (context menu) shell extension registered to both exefiles and dll files under W2K SP1. I've also entered the required info in the HKLM\Software\Micrsoft\Windows\CurrentVersion\Shell Extensions\Approved key.
The problem is that the extension works fine for all exe files but does not even load with dll files. I checked to make sure there is an entry under HKCR\dllfile\shellex\contextmenuhandlers. What's weird is that when I use regmon I see what's going on, I notice that explorer makes no attempt to even look at that key.
The code is based on the one found at
http://www.codeproject.com/shell/shellextguide2.asp
Any ideas??
Thanks,
Jignesh
|
|
|
|
|
|
Yes it does... I just tested this on another machine running W2K (SP1) and the extension works correctly for both (exe and dll).
I really am confused!
Thanks,
Jignesh
|
|
|
|
|
Hello,
One of the interesting things the WebBrowser (WB) control may be used for is to view a document through document automation object.
At some moment I need to free all of the COM Servers created by WB without destroying the WB object,
passing “about:blank” frees WB view, but does not liberate Automation Servers.
1)Is there a way to force WB to free opened Servers? Is it possible to get to the list of run Servers?
When a document (file) does not have an Automation Server,
it’s run somewhat through the ShellExecute, and if so,
having a ShellExecute hook does not notify the operation,
there must be some other run method ?
2)Is there a way to get at least Window handle of the opened application?
Any ideas will be highly appreciated.
Thanks in advance, Alexandre
Software developer
|
|
|
|
|
Hi.
I have a View in which user can draw vectors. Each vector can be selected,( highlighted).
I also have a modeless dialog which has a ListBox each line represents a vector in the
View.
I need to do: when I select a line in the ListBox which is in Dialog my program will also
highlight an appropriate vector.
In a nut shell:
I don't know how to send to a View a message that line in the list box was highlighted,
so it will highlight the appropriate vectors.
thanks ahead.
bye.
|
|
|
|
|
To get the view from anywhere
CFrameWnd *pFrameWnd = (CFrameWnd *)AfxGetMainWnd();
ASSERT (pFrameWnd != NULL && pFrameWnd->IsKindOf(RUNTIME_CLASS(CMDIFrameWnd))); // or CFrameWnd if SDI
pFrameWnd = ((CMDIFrameWnd *)pFrameWnd)->GetActiveFrame(); // or CFrameWnd if SDI
CMyView * pView = (CMyView*)pFrameWnd->GetActiveView();
CMyDoc * pDoc = (CMyDoc*)pFrameWnd->GetActiveDocument();
Then it's a case of writing a function that takes the info and updates the display, and calling it. In fact, the above code is through all the dialog boxes in my paint program for exactly the same sort of thing you are describing.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I wanted to know how software like GetRight and Gozzila can do to intercept the http or ftp connections in internet explorer or netscape right when the user click on it?
Crocmort
|
|
|
|
|
For I.E I think they are using an IEHelper Object
When an instance of Internet Explorer is started, it looks in the registry for CLSIDs stored under the following key:
HKLM\SOFTWARE\Microsoft\Windows \CurrentVersion\Explorer\Browser Helper Objects
If this key exists and there are CLSIDs listed under it, Internet Explorer will use CoCreateInstance() to try to create an instance of each object listed as a subkey under this key. Note that the CLSID of the object you create must be listed as a subkey and not a named value.
There are some requirements when creating a Browser Helper Object
1 The application that you create must be an in-proc server (that is, DLL).
2 This DLL must implement IObjectWithSite.
3 The IObjectWithSite::SetSite() method must be implemented
Also It is possible to connect to a running instance of Internet Explorer version 4.0 or later using the SHDocVw.ShellWindows collection.
Regards
Alfadhly
<marquee>
It is Illogical to define an inventor by his invention
|
|
|
|
|
I am using the CBitmapDC class to assemble bitmap files into a larger one to print in OnPrint.
Print preview shows the picture ok, but the page is blank (not much of a preview if you ask me). I understand that this is due to CBitmap being a DDB, and I need to convert it to a DIB before printing.
This has me very confused with all the different sample code and classes. It appears to me that I AM using a DIB when I load the BMP (according to docs, BMPs are in DIB format). Somehow, a CBitmap is not the same thing?
Any help getting a CBitmap to print on the printerDC (hDC, whatever) would be beneficial to my sanity.
Rick
|
|
|
|
|
a CBitmap holds a DDB. the DIB that makes up the BMP is converted to DDB when you call LoadBitmap (probably by an internal call to SetDIBits).
one thing to check: does your printer support BitBlt? if not, you'll probably have to use StretchDIBits. see GetDeviceCaps to check your printer's capabilities.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
A DIB is a device independant bitmap. The thing that holds it in this form is a DIBSection. A DDB is a CBitmap - device dependant, the device being whatever DC the CBitmap is compatible with. I use a DIBSection wrapper ( Chris just updated his on the site ) and stretchblt to perform our printing. BitBlt is essentially worthless, as the average print DC is about 6000 x 4000 for an A4 page ;0)The print preview is working because the image is compatible with the DC you are drawing to ( the screen ). So it seems your printing code is in order, you just need to load the image as a DIBSection.
If you load the bitmap using LoadImage, you can ask it to return a DIBSection, it's one of the flags. A DIBSection is a DIB that can be selected into DC's, drawn on, etc.
I apologise for the early morning ramble nature of this post, I was here until midnight last night ( finishing off our printing code ).
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hey all. This is a simple question.
I have an array I want to iterate. Its in a for loop, and each item of a 3-Dimensional array needs to be assigned a string from an input file. Unfortunately, I keep getting errors when trying to put a string in an array index. I use this line:
inFile.get(ID[i][0], 7, '|');
ID is the array and i is the for loop index. Here's the error:
error C2664: 'class istream &__thiscall istream::get(char *,int,char)' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
I've looked up the error and read everything from arrays to pointers to indexing to mountain goats and can't find the right way to do this. I'd appreciate any help. Thanks.
-Tony
|
|
|
|
|
The error says you're passing a char where a char* is expected. So something's amiss with the expression "ID[i][0]". It looks like your declaration or usage of the ID array is wrong. It's a 2D array of chars, not 3D, since 2 dereferences result in a char.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hi,
I have been told that I can create a windows 2000/nt service which will allow my to communicate with the user via dialog boxes.
How can I get the driver to make the service display a dialog and how does the driver retrieve what the user enters?
thanks
|
|
|
|
|
You *can* do that if you check the "Allow service to interact with desktop" in the services settings...
But I would not recomend that, services is not made to be GUI apps. Why not make a GUI-thing that talks with the server, using Named Pipes, Sockets or something else...
How can I get the driver to make the service display a dialog
What driver?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi!
I would like to have a small strip on the left in my SDI app. The strip should go all the way from the titlebar down to the window limits. How can I make the menus and toolbars move with respect to this strip, preferably implemented as a CView-derived object. Anyone who knows an example or something?
|
|
|
|