|
Thanks I just had to do that . Having done this I'd like to know why this is essential !
|
|
|
|
|
act_x wrote:
Having done this I'd like to know why this is essential
think of it this way: a static member variable (different from a static member function) exists outside the lifetime of any single instance of the class it's declared in. therefore you need to give it a place to live outside the class. by adding that single line to the cpp, you've given it a place to live. the line in the header only tells the compiler "this variable will be of this type, i'll allocate space for it somewhere else".
another way to think of statics is that they're basically global variables that can only be addressed in the context of the class they're declared in: cFoo::myVariable.
-c
|
|
|
|
|
Hello,
I have an application that show multiples forms. They show ok on the task bar with but when there is not more space on the taskbar WinXP group them together and them the name that shows on the taskbar is CMYApp instead of the application title. I don’t have a problem with the grouping but I will like to show the title of my application not CMyApp.
Any ideas?
|
|
|
|
|
What is the title of your application as it should be displayed?
|
|
|
|
|
|
So when there are but a few windows in the taskbar, you see "Payroll Reports" but when there are multiple windows in the taskbar, you see "CMyApp" instead. Is that correct?
|
|
|
|
|
|
Can you provide a few screen shots that exhibit the problem? I've never heard of such a thing.
|
|
|
|
|
Hello,
I have an application that starts with a CListView on the list view the user can click on items and then another frame will show but this time with a CFormView. The user can have more than one CFormView open at any time. Since the user can have more than one CFormView open I don't want them to show on the task bar.
Any help on show to do this. I found an example but it disables the main view and I need that view active.
|
|
|
|
|
hi, how acn i set the dialog font by code om my cdialog class
Please reply,
Thanks,
Bye
miquid
|
|
|
|
|
SetFont(), or modify the template in the .RC file.
|
|
|
|
|
I have a CFormView Project.
I'm trying to call a function which is located in LeftMenu.cpp which is my implementation file
(CLeftMenu::CLeftMenu()
: CFormView(CLeftMenu::IDD)), from AnonWasher.cpp which Defines the class behaviors for the application.(CAnonWasherApp)
This is the function that I'm trying to call:
void CLeftMenu::GetCheckedItems()
{
char *checkedItems=NULL;
if( m_hWnd != NULL )
{
CMainFrame *main = (CMainFrame*)m_hWnd;
checkedItems=main->GetCheckedArray();
}
}
When I call GetCheckedItems from AnonWasher, I get undeclared Identifier error.
I don't know how I could do this.
|
|
|
|
|
You are failing to #include a .H file. Which line is the compiler complaining about?
|
|
|
|
|
I have all the .h files. Could there be any other problems?
Thanks.
|
|
|
|
|
Having them and #including them are two different things.
|
|
|
|
|
Yes, I have all the #include .h files both my classes.
|
|
|
|
|
Ok, what about my other question regarding the compiler error?
|
|
|
|
|
It was complaining about GetCheckedItems();
|
|
|
|
|
At the top of anonwasher.cpp, do you have #include "leftmenu.h"?
|
|
|
|
|
Yes, I do have the #include "leftmenu.h" at top of anonwasher.cpp.
Maybe I need a pointer to that class.
|
|
|
|
|
Yes, your CAnonWasherApp class will need a CLeftMenu object in order to access the GetCheckedItems() method. Whether it is a pointer or not is up to you and the project's design.
|
|
|
|
|
I know this isn't really the place to be asking but since a lot of you probably do programming as a job or something i guess a lot of you own a handheld/PDA. I'm thinking of buying one of the nifty little things myself since i am going to uni to study informatica. What i really like about them is that they basically are full machines for which you can program with only one crucial difference from a full grown PC: You can't choose what OS u install on it (allthough that might change, but not anytime soon i guess). I did a lot of reading on the different OS's but i can't seem to make up my mind. Currently, i'm considering Pocket PC, Palm OS and Symbian. But they all seem to have some downsides. Like i thought about maybe waiting untill smart phones reached the market but it seems Microsoft is charging a lot for the SDK. I think they should provide this free as it is part of the functionality of the product that u can write your own programs for it. Of course the big advantage would be that it is Windows-like and it is probably most compatible with the real Windows versions so programming would go without much hassle. Programming for the Palm OS seems to be quite easy too but for Symbian it seems to be a bit more difficult. I don't really have an idea of this because i don't own a device yet. But i would just like to ask for some opinions on what u people would advise through personal experience.
Thanks
P.S.: if u don't think i should be asking here just tell me to get lost lol
Kuniva
--------------------------------------------
|
|
|
|
|
Ok, my SDI project has a linked list implemented.
This list works, now my problem is for saving it and the loading it.
The list only saves 2 CPoint variables.
The problem is that when i have the list in the View class i dont know how to carry it to the Doc Class.
Fernando Jose Martinez Mendoza
Bucaramanga - Colombia
|
|
|
|
|
You can get a pointer to the document class using the GetDocument() member function of the CView class (it returns a CDocument*).
Using this pointer you can manipulate the member variables of the CDocument class, execute its member functions, etc...
If you have allocated an array/linked-list in the CView class, I would simply pass a pointer to it to the CDocument class, so you don't have to copy/transmit everything. If it's a member structure, it should be public.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
"If you have allocated an array/linked-list in the CView class, I would simply
pass a pointer to it to the CDocument class, so you don't have to copy/transmit
everything. If it's a member structure, it should be public."
Correct, the linked list is part of the CView class, but how do i pass the pointer, i mean i have these classes:
CList
CView
CDoc
CList is part of CView (and its public)
What must be written in the Serialize function of CDoc?.
Fernando Jose Martinez Mendoza
Bucaramanga - Colombia
|
|
|
|