|
I'll check it out. Thanks, Bob.
|
|
|
|
|
You're welcome
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I am building an application used for tenant billing. I have to find the number of days in each billing period. This is inputed by the user.
ok with that set up the gas company changes rates every month. However, we do not conduct out meter readings and rent billing on the first of every month. Ineed to find a way to use the pastbilling date to find out the remaining days in the month to use for the past gas rates. I also need to use this months billing date to find out how many days have elapsed in the current month.
If i could find out how to get the number of days in the specified month i could compare it to the bill date.
I'm pretty much trying to figure out how to use datetime or another function to show the total number of days in the given month. Thanks in advance
|
|
|
|
|
Lagwagon56 wrote:
If i could find out how to get the number of days in the specified month
There are only 13 cases (February has 2 cases due to leap years), so just make lookup table.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Yeah, that would work, was just wondering if there was a built in way with datetime. Thanks for the reply. That was easy enough, i was thinking to hard... Thanks again
|
|
|
|
|
Hello,
I get this error when my app is starting app
I have many dialog windows in a tab that loads and
I have tryed many things but I dont get it to word.
Is there a smart person that now what I can do to make this go away?
Here is the error I get;
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
|
|
|
|
|
Larsson wrote:
Is there a smart person that now what I can do to make this go away?
Here is the error I get;
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
In what function is that line of code? What file?
Make the debugger stop at that line when the assertion fails, and check the call stack to see what is being done that caused the assertion. Just as a wild guess, I suspect you are trying to access some control in a dialog before the dialog has been initialized (like trying to initialize a control in the dialog's constructor rather than in OnInitDialog).
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
No this is the first thing I do!
m_FunkDlg = new CFunkDlg;
m_FunkDlg->Create(CFunkDlg::IDD, &m_tabctrl);
m_tabctrl.AddTab(m_FunkDlg, "Set function", 2);
So I dont now what can hapend!
|
|
|
|
|
You are calling (either directly or indirectly) a method on a CWnd object or derived class. The implementation of that method expects to either be attached to some window (IsWindow(m_hWnd) ) or to be a COM object wrapper (m_pCtrlSite!=NULL ). The assertion is failing because at the time of that call, neither of those conditions is true.
Again, run it under the debugger. When you get the assertion message, click "Retry" or "Break" (I don't remember the exact button caption) so as to stop the debugger at the line where the assertion was written. Take note of what function the assertion is in. Take note of the call stack and see where the call to that function is coming from, back to some of your code. That should give you some hint of what is wrong. If you are unsure, post again, but provide some more information.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I am using C/C++, Visual Studio 6.0
I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class.
Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up.
Any help on creating an OnInitDialog(0 function would be greatly appreciated
Many thanks,
Robert
|
|
|
|
|
Robert Palma Jr. wrote:
Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up.
Any help on creating an OnInitDialog(0 function would be greatly appreciated
How about copying and adapting what you have in the other dialogs?
This is what you need:
1. Declare OnInitDialog as a member of your dialog class. Add it in the dialog header file (the .h file). It's something like this:
virtual BOOL OnInitDialog();
2. Provide an implementation for YourDialog::OnInitDialog(). Add it to your dialog implementation file (the .cpp file). Something like this:
BOOL YourDialog::OnInitDialog()
{
CDialog::OnInitDialog();
return TRUE;
}
That should be enough.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Many thanks Jose
|
|
|
|
|
More comfortably, use Class wizard and then select the class you created then add windows message WM_INITDIALOG. This will add the OnInitDialog() function in your class.
Work hard and a bit of luck is KEY to SUCCESS.
|
|
|
|
|
Many thanks Neelesh
|
|
|
|
|
Hallo,
my problem is that I have to read some data (that i generate by rand())and display it in the dialog with a gradient dots or circle(like if the value is low -white and high -red medium-gradient mixed color).
I made a group box and drawn a white rectangle back ground. But i dont know how to repeatedly put ellipses or dots in that space(with gradient).
I hope u people understand my query.
Please help me in this regard.
mfg,
kingsly.
|
|
|
|
|
If you use GDI+, you can create a gradient brush. Otherwise, SetPixel will do - just change the color gradually. A conversion to HLS will allow you to make the color brighter in a more logical way.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all,
how can I add data to each MS Chart series during runtime?
Thanks in advance,
Marc Soleda
p.d: what happens with MS Chart?? I can't find documentation...
|
|
|
|
|
Hi everybody
I copied this example from a book on game MFC and it`s give me an error in the liking phase
Linking...
test.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
i know is probably something tedious
tks
B
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow)
{
// call message box api with NULL for parent window handle
MessageBox(NULL, "THERE CAN BE ONLY ONE!!!","MY FIRST WINDOWS PROGRAM",MB_OK | MB_ICONEXCLAMATION);
// exit program
return(0);
}
|
|
|
|
|
The error means the compiler can't find the actual code for the function MessageBox. If you do a quick search for MessageBox on www.msdn.com you will see that to use this function you need:
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
So you included Windows.h somewhere (otherwise you'd get a compile error) and in Project ->Settings -> Link you write in User32.lib.
Try that, I think it should work.
|
|
|
|
|
Hi ,
I have made a multithreaded application , Problem is that I want to know how many threads are right now in my application. As user can create as many threads as he wants, on every user request it creates a new instance of mythreadclass , which is inherited from CWinThread . And how to delete these threads when application finishes .
Thanks
ZINC !
HELLO
|
|
|
|
|
The CreateToolhelp32Snapshot function takes a snapshot of the specified processes in the system, as well as the heaps, modules, and threads used by these processes.
TH32CS_SNAPTHREAD - Includes all threads in the system in the snapshot. To enumerate the threads, see Thread32First . To identify the threads that belong to a specific process, compare its process identifier to the th32OwnerProcessID member of the THREADENTRY32 structure when enumerating the threads.
Use GetCurrentProcessId to get the process id for your program.
|
|
|
|
|
I am learning to use Visual Studio to write C++ programs. The last exercise I did from the book resulted in the message "error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'". What am I doing wrong?
Help!!!
|
|
|
|
|
It's hard to guess from the info you provide. Post a code snippet and someone will probably be able to tell you what's wrong in it.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
This was an exercise to learn to create an application window. Here is the code, a very short program.
// EX13_01.CPP
// An elementary MFC program
#include <afxwin.h> // For the class library
// Application class definition
class COurApp:public CWinApp
{
public:
virtual BOOL InitInstance();
};
//Window class definition
class COurWnd:public CFrameWnd
{
public:
// Class constructor
COurWnd()
{
Create(o, "Our Dumb MFC Application");
}
};
// Function to create an instance of the main window
BOOL COurApp::InitInstance(void)
{
// Construct a window object in the free store
m_pMainWnd = new COurWnd;
m_pMainWnd->ShowWindow(m_nCmdShow); // .. and display it
return TRUE;
}
// Application object definition at global scope
COurApp AnApplication; // Define an application object
|
|
|
|
|
Anonymous wrote:
This was an exercise to learn to create an application window. Here is the code, a very short program.
But this isn't the file in which you were getting a compilation error, is it? You said the error was "error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'" and I can't see HwndMSWheel anywhere in the code you posted...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|