|
Thank You,
It seems to compile now,
but what I dont get, is that I have some sample
code from a manual I downn loaded
and it works with out the afxtempl.h
if you have an answers that would be great
anyway thanks once again
cheers
Simon
|
|
|
|
|
wow CTypedPtrList without afxtempl.h
is should be included in some other header files , did u check ?
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Yes I've checked,
but knowing me it something I've overseen
anyway I dont think this website is into advertising
but If you really want to know then I will be happy
to disclose
i'm just happy that i'm in the right ball park
|
|
|
|
|
hi.
i write a program that is dialogbased.
i have 2 dialogbased form in my program and every of this 2 form want to access to another form
first dialog can access the data from another form but when i define one variable from another dialog error happen.
can u help me?
|
|
|
|
|
keyvan_jaferzade wrote: ...error happen.
Is it the red error?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
the error is
c:\documents and settings\kone\desktop\fractal\decompress_dialog.h(20) : error C2146: syntax error : missing ';' before identifier 'com'
c:\documents and settings\kone\desktop\fractal\decompress_dialog.h(20) : error C2501: 'CCompressor_Dialog' : missing storage-class or type specifiers
|
|
|
|
|
keyvan_jaferzade wrote: c:\documents and settings\kone\desktop\fractal\decompress_dialog.h(20) : error C2146: syntax error : missing ';' before identifier 'com'
What is to the left of com ?
keyvan_jaferzade wrote: c:\documents and settings\kone\desktop\fractal\decompress_dialog.h(20) : error C2501: 'CCompressor_Dialog' : missing storage-class or type specifiers
Have you included the file where CCompressor_Dialog is declared?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
i included that file but yet there is error
i use VC++6.
i hear if i use newer version this problem can solve
this means that i can include first class into second
and second class into once without error in compiling
can i upgrade my code into newer version of vc++ without any loose?
|
|
|
|
|
This is my code for first Dialog
#if !defined(AFX_DIALOG1_H__F50AB9B4_5FA3_4068_843C_01A10ED22766__INCLUDED_)
#define AFX_DIALOG1_H__F50AB9B4_5FA3_4068_843C_01A10ED22766__INCLUDED_
#include "dialog2.h" // Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// dialog1.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// dialog1 dialog
class dialog1 : public CDialog
{
// Construction
public:
dialog2 d2;
dialog1(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(dialog1)
enum { IDD = IDD_DIALOG1 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(dialog1)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(dialog1)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOG1_H__F50AB9B4_5FA3_4068_843C_01A10ED22766__INCLUDED_)
//**************************************************************************
And second dialog Code is
#if !defined(AFX_DIALOG2_H__B49F8072_EB87_4558_8CE9_E83A7852E553__INCLUDED_)
#define AFX_DIALOG2_H__B49F8072_EB87_4558_8CE9_E83A7852E553__INCLUDED_
#include "dialog1.h" // Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// dialog2.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// dialog2 dialog
class dialog2 : public CDialog
{
// Construction
public:
dialog1 d1;
dialog2(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(dialog2)
enum { IDD = IDD_DIALOG2 };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(dialog2)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(dialog2)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOG2_H__B49F8072_EB87_4558_8CE9_E83A7852E553__INCLUDED_)
|
|
|
|
|
Do you want to have access of one dialog at two dialog and vice versa?
|
|
|
|
|
first class want to access to second
and second want to access to first just this is my problem
|
|
|
|
|
Sounds like a circular reference problem.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello all,
Please tell me is it possible to send the WM_KEYDOWN message to the program without pressing any key in the keyboard. I want to call a method which has been written in the keydown event without pressing any key for the first time only. Please help me.
Many thanks in advance.
|
|
|
|
|
Yes you can send a WM_KEYDOWN message but it doesn't make a lot of sense. Why don't you instead move that specific code into a separate function that you call from within your key down handler and that you can call directly instead of sending the WM_KEYDOWN message.
|
|
|
|
|
You can use the well named (for a change) SendInput funcion. Or rearrange your question to give an answer of "SendMesssage (WM_KEYDOWN,...".
But as Cedric said, this is a TERRIBLE idea if you have any sort of access to the software involved. Otherwise there are lots of errors for you to make. If you don't send a matching WM_KEYUP for example, there could be all sorts of "fun" !
Iain.
|
|
|
|
|
|
If in a Visual C++ 2008 I have an image which i set up by BITMAPFILEHEADER and BITMAPINFO and BITMAPINFOHEADER, how can I enclose it in a device-context so that graphics functions can draw lines and write text on it, as if it was a screen?
Currently the MSDN Library http://msdn.microsoft.com/en-us/library/default.aspx is 404 or not answering queries, else I would have looked in it. When is there the least load on the MSDN Library?
|
|
|
|
|
Look for the Cbitmap and CDC classes, where you can make an output.
Greetings from Germany
|
|
|
|
|
Do you mean something like this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Cannot understand why is heavily attacked by the trolls.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
To DavidCrow: thanks, but in my case the image that I want to write to is already in memory as BITMAPINFO etc bit patterns (without an HBITMAP hande), and does not need to be read from a file.
|
|
|
|
|
Load it in (or create it) as a DIBsection instead -
then you'll have an HBITMAP to use like David's code shows.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That is, please, I want somehow to set up in RAM memory an image object which I can write text to by TextOut() etc via a Device Context (HDC) and also directly by reading and writing its internal data layout.
|
|
|
|
|
Unless you render the text pixels yourself directly to the
bitmap bits in memory (or use a library that does it for you),
you're going to need to obtain an HBITMAP for the bitmap.
With GDI, a DIBSection works great, and pretty much matches your
current data perfectly.
With GDI+, which has better text capabilities, a Bitmap object is easy
to create from Windows DIB (bmp) data. GDI+ can do this stuff with only
a few lines of code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|