|
Hi,
In MDI application, if you have a button in toolbar with ID
"ID_WINDOW_TITLE_VERT" or "ID_WINDOW_TITLE_HORZ", you can re-order
child windows by click this button. you don't need do anything just
assign the ID to to your button. does anyone know what are messages
asscoicate those two IDs? because I want to create a MDI application,
allow user open multi-windows at one time and all child windows
automatically ordered horizantally or vertically.
Thank you in advance.
|
|
|
|
|
|
Where can I find an article (maybe some source code?) about file compression?
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
|
How can I create a dialog/window without taskbar icon (or how to hide it)?
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
|
|
This is regarding a class called CArchive provided with MFC.
There are some overloaded operators "<<" and ">>" for inseration and
extraction in class CArchive.
One of them is:
friend CArchive& operator <<( CArchive& ar, const CObject* pOb );
The question is why the above operator is friend function???
The inseration and extration operators for the CObject class have been
defined as global friend functions whereas the same extraction and inseration
operators for basic data types such as int, float etc have been defined in
the CArchive class itself.
Why such a design? The CArchive class does not access any private or
protected memeber variables of the CObject class. Hence the query.
The source code is written as:
friend CArchive& operator<<(CArchive& ar, const CObject* pObj)
{
ar.WriteObject(pOb);
return ar;
}
and
CArchive::WriteObject()
{
/// .....lots of code but no private variable of CObject accessed
((CObject*)pOb)->Serialize(*this);
}
The is no accessing of private variables of CObject in any place.
Then why the << operator is a friend function??
I will be greatly obliged anyone could answer my query.
Prateek Kaul
Centre for Development of Advanced Computing (C-DAC),
Pune,India
|
|
|
|
|
Hi.
I was wondering if there any any sources and information etc for people programming for industrial systems. By this, I mean accessing IO (Digital/Analog) and connecting to PLCs ...
I know there are many manufacturers sites but I have found nothing that really does justice to programming in industrial based environments (like Labview etc)
|
|
|
|
|
Hi. I have a backround thread function that I need to call many times to do calculations. I was wondering if it is OK for me to call AfxBEginThread time after time without knowing if the first call to it has finished? The calculations may take a while and I could need another thread to do another calculation using the sanme function. I made a test program and it does not seem to work.
If the above does not work, can someone suggest something that does work so that I could definitely have more than one thread going using the same thread function.
Thanks
|
|
|
|
|
If you have a calculation function which you want to start as a worker thread, you may start it as many times as you want to. But if they all access a common shared variable, you might get into trouble. Might have to try one of the thread sync mechanisms
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
My app needs 5 MB memory( ) on Windows 2000 Profi. Iam using ONLY owner-draw control and database access. Ist normal ??. How make faster app ??
|
|
|
|
|
5 MB is normal I'd say.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
If can, tell me how please.
|
|
|
|
|
(1) Construct the CToolBar
(2) Create a toolbar resource
(3) Call Create() [pass the resource id]
(4) You prolly want to create it on a dialog. If so resize the dialog accordingly
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I try to create a toolbar in a dialog like this, but it not works.
BOOL CTempDlg::OnInitDialog()
{
...
...
m_toolbar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_NOALIGN))
m_toolbar.LoadToolBar(IDR_TOOLBAR1))
return TRUE; // return TRUE unless you set the focus to a control
}
Something wrong in my codes? In fact, I want to create a toolbar just in a CWnd, can I? "(4) You prolly want to create it on a dialog. If so resize the dialog accordingly", How to resize the dialog?
Thank u for your answer.
|
|
|
|
|
Hi there,
I'm working on webbrowser kind of application. I have a problem in open in new window part. I want to open the new link in the new frame of my mdi application. that part is done but i face the problem with popup windows. for that i need the exact dimention(height+width) of the popup window which is set in the script.
is there any way to get the exact size of the popup window?? i can get the height and widht usign get_Height and get_Width function of iwebbrowser2 interface but it doesnt give me the exact dimention all the times. in lot of popup windows it gives the wrong size.
if anybody knows the soln. pls help me out.
thanx in advance,
Paras Shah
|
|
|
|
|
First, does everyone use the wizards to start off a project. They seem a little annoying and create alot of code that is hard to follow.
And second, is there a simple little hello world program out there that uses MFCs
Cheers
|
|
|
|
|
Hope this helps...
Nish
#include "stdafx.h"
#include <afx.h>
#include <afxwin.h>
#include <afxext.h>
#include <afxdtctl.h>
CWinApp theApp;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int nRetCode = 0;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
AfxMessageBox("somethin screwed up :-(");
nRetCode = 1;
}
else
{
AfxMessageBox("Cool, we are runnin on MFC");
}
return nRetCode;
}
|
|
|
|
|
Personally, I like to put all of those afx headers in my stdafx.h file. But that's just me being me.
|
|
|
|
|
yeah,
But I put them like that so he finds it easier to understand.
In this case stdafx.h contains only one line
#pragma once
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hey
I guess you mus have seen that there are some smilies in the other post. donno how to disable them
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Start with a dialog based app, there is a lot less to follow. Make the OnPain function in the dialog look like this:
if (IsIconic())
{
CPaintDC dc(this);
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this);
dc.TextOut(10, 10, "Hello World");
CDialog::OnPaint();
}
I'm not sure if you need the call to the base class, so I left it in, although removing it appears to do no harm. There's your hello world, and the simplest MFC app you'll get outside of using MFC in a console app.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I don't know about everyone, but I always use wizards to begin my projects. They save a lot of time and get me going on the functionality right away. Like yourself, in the beginning I found it a bit hard to follow the generated code, but it was only a matter of time before I became familiar with it.
As far as a little Hello World program, again use the AppWizard to create a "Win32 Console Application". Then tell it you want to support MFC. Presto! See? I told wizards are great.
Regards,
Alvaro
|
|
|
|
|
first i'd like to ask if anyone here is a self taught vc6 programmer. as in no schools just books and stuff like that.
i'm finding that the prices for tuition at any school for a programming course is way out of my budget. i live canada so keep that in mind. next question:
gamedev says to start with a simple tetris like game to understand how a game is put together. i have a book that explains a breakout game and my logic tells me that programming a game like that would be easier then tetris. maybe i'm wrong. anyhoo could someone point me to some source files or code for a tetris like game so i could compare code and possibly understand.
i have to take the self taught book method.
|
|
|
|