This Visual C++ is rather strange to me and I like to know about pointers... I´ve been working with Visual C++ only a two months and now this hole thing is just banging the head in the wall... So how these pointers are used? Meaning that where you construct the pointers and when you use them?
There were before a question, where somebody disclaim a working with directories etc. And there is pointer
pListoBox-> How you generate this kind of pointer in the code? Here is code which I copy / pasted earlier discussion (This code is written Carlos Antollini):
I think you can go read "A Beginner's Guide to Pointers"
which written by Andrew Peace. You can find this article in this site, it is quite helpful.
Hope this can help you...
I use several dialogs in my project that are hosted in a splitter pane. The dialogs are created with new and create. They show up normal. Then I like to put them in a list or assign it to a general member. Something like this:
In some class:
CWindow * m_pWindow = NULL;
In another class:
CLocProp *pdlgProp = new CLocProp;
// here pdlgProp is send with sendmessage as a LPARAM (pointer is casted)
// in the class with the messagehandler:
m_pWindow = (CWindow*) lParam;
delete m_pWindow; // Debug assetion that this pointer is not valid
In the good old MFC days this was not a problem. With all the template stuff it gets difficult to hold a grip of this Windows stuff. Is it save to cast it to a CWindow*? If not, how should this be done? What if I want to put dialogs of a different type in a list. Then I need a common base class (CWindow).
Also, if I don't send the dialog through the lParam parameter, An assign it to CWindow* directly after its creation and then delete it, I also get the assertion.
Do you get "Out Of Memory" when you open the project file? Maybe you are just running too many apps at the same time...?
Try to shut down VC and delete all auto-generated files in the project dir(after backing them up, of course;) ): dsw, clw, aps, ncb, opt, plg etc. Also delete all temporary files in the Release & Debug directories. Then open the dsp and recompile. This usually helps when VC starts acting strange...
"Aagh!! I'm a victim of a Random Act of Management!"
I'm a little confused, maybe someone can point me in the right direction. I have never done bitmaps in win32 apps before, and no I don't mean I've never put a bitmap in a dialog, or toolbar, I mean displaying on the actual app. I need help because I have a project due in a week or so, and need to display a certain bitmap in the app. Yes, I took training, but you tend to forget what you don't need over the years, and I need to know what header file to insert into the main program source file. I REALLY NEED HELP ON THIS ONE.
"The world doesn't care about your self esteem. The world expects you to get something done BEFORE you feel good about yourself." ~ Bill Gates
I want to learn how to create a toolbar which docks on the desktop, similar to the LiveTask bar used with Creative Soundblaster products. I want to be able to autohide, and add other menus / controls to it. The thing i have in mind is also similar to the office startup toolbar or even the windows start menu bar that pops up at the bottom of your screen.
Whats it called and where can i find some sample code / further reading ?
I have a regular DLL using MFC and within this DLL is a worker thread. While this thread is running, it is trying to update a dialog box (owned by the DLL) with some information on the thread's progress. Everything works OK except that the WPARAM and LPARAM values I pass to the dialog are not getting through, and are always zero. Is there some special reason for this?
I am creating these four radio buttons dynamically.
The behavior is so random and confusing. At some point I got some text, and then I can't get it anymore. I have been told by friends at this forum that maybe the width is not enough, one time that fixed the problem but not anymore!!!!!!!
Here is the code:
if (OneGrpPosition != NULL)
pConfig->m_OneRadioBtn = (CRadioBtn *) (((CGrpBox*)pConfig->m_OneGrpBox)->m_GrpRadioBtn).GetNext(OneGrpPosition);
int len= ctrlRect.right - ctrlRect.left;
ctrlRect.right = ctrlRect.left +len+ 60;
if (ctrlRect.right >= 542)
::MessageBox(0, "Running out of screen width to display radio button", "Warning", MB_OK);
Yes, I see all my four radio buttons are being created. The first one is different from the other three, because I need to have them in a group. Meaning if I click on of them the other three are unselected.
I do see the four of them being created. But no text next to them. I am thinking of just creating the first one to see if the text displays there.
It is a weird one. I really am looking forward to solve this one!!
I've begun to learn VC (MFC) few days ago.
i want to make something using the "ExtractIcon()" function.
the first paramter of this function (as written in MSDN) is a handle
to instance of the application.
How the hell do i get this handle? what should i send him as this first