|
Hi!
So, I guess it is Custom draw for me then! Do you know of any sites which show how do this? I looked on this forum and couldn't find any. I have never done this, so I don't even know how to start to draw the icon.
Thanks for all your help,
NC
|
|
|
|
|
|
Thanks, I'll try that.
NC
|
|
|
|
|
hi there
i need some help on figuring out how to make one of my Bitmap resources the background of my dialog window. I am really stuck! Can somebody please help me on figuring out how to do this.
I really dont wanna use someone elses class that they created i just want to know how to do it. Please if you have any instructions on how to do this i would greatly appreciate it.
Thanks again!
|
|
|
|
|
|
hi there
i need some help on figuring out how to make one of Bitmap resources the background of my dialog window. I am really stuck! Can somebody please help me on figuring out how to do this.
Thanks again!
|
|
|
|
|
As a starting point, you can check the demo application of the CButtonST class. One of its pages has a bitmapped background.
Bye!
SoftechSoftware
Davide Calabro'
davide_calabro@yahoo.com
http://www.softechsoftware.it
|
|
|
|
|
This is a problem I've had before, but I just can't seem to figure it
out:
I have a dialog (CDlgIEAddText) that modifys properties of a class
(CIELayerText), and I have created a member variable in (CIELayerText)
of type (CDlgIEAddText*) .
I have included the DlgIEAddText.h header file, but the compiler keeps
saying "ielayertext.h(26) : error C2501: 'CDlgIEAddText' : missing
storage-class or type specifiers"
Does anyone know why I can't declare this pointer even though I have
included the header file??
Thanks!
Here's the CIELayerText.h file and error the compiler generates:
*** HEADER FILE ***
// IELayerText.h: interface for the CIELayerText class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCL
UDED_)
#define
AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DlgIEAddText.h"
#include "IELayerObject.h"
class CIELayerText : public CIELayerObject
{
public:
void Properties(CWnd* pWnd);
void ContextMenu(CPoint point, CWnd* pWnd);
void Render(CDC* pDC);
BOOL Create(CString csText, CRect* pRect, LOGFONT* logfontFont,
COLORREF colorFG, COLORREF colorBG, DWORD dwAlign);
CIELayerText();
virtual ~CIELayerText();
private:
CDlgIEAddText *m_pDlg; // *** I can't declare this pointer, why not?
DWORD m_dwAlign;
CString m_csText;
LOGFONT m_logfontFont;
};
#endif //
!defined(AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCL
UDED_)
|
|
|
|
|
I have no idea why #including file doesnt't work - maybe preprocessor symbol used to ensure that .h file is included only once is duplicated. But... you don't have to #include anything if you just want a pointer. Use forward declaration instead:
class CDlgIEAddText;
class CIELayerText
{
CDlgIEAddText *m_pDlg;
};
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
if DlgIEAddText.h is included in a precompiled header (stdafx.h) you can get this kind of error. It happens because the .h file is not recompiled until you do a rebuild all.
Hope that helps
|
|
|
|
|
Is there a way to add some sort of a box for displaying text on the toolbar? I'm drawing a graphics program using openGL and I want to display the degrees of rotation on the toolbar as the object is rotated.
|
|
|
|
|
|
I have about 4 books on VC++.. and i've looked through all of the articles i can find here on CP.. and i still have problems understanding..
1) Is it possible to split the main window and put 2 different property pages (or views, dialogs, etc.) in each view when a button is pressed, and not just during OnCreateClient().. every single example i have seen splits the main window during OnCreateClient()..
2) Is it possible to create a CWnd derived class that displays full screen, and is split in two with 2 different dialogs in it (one in each half).
could someone please let me know what the best way to go about this is? im basicly trying to have a split screen with a dialog (or property sheet) on the left, and a form on the right which updates based on what is typed in the dialog on the left. Any help would be much appreciated.
-dz
|
|
|
|
|
(1) - yes, it's possible. Are you using static or dynamic splitter?
(2) - yes, it's possible. KB article Q164162 has information about going full-screen in MFC. Once you have full-screen option implemented, you can use splitter.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
1) I'm using neither as I can't figure out how to create the splitter outside of OnCreateClient(). OnCreateClient takes a pointer of CCreateContext* pContext, and I don't know how to create this type. I have tried creating my own CCreateContext and set all of its member variables to NULL, but this causes nothing but assertion errors.
I basicly have a function CSplitTestApp::OnFileTest() which gets called when you click a button on the toolbar, at that point i want either the main window to split, or a new window to popup split in half with a dialog in each view. The Create function of CSplitterWnd also takes a pointer to the parent window (CWnd*), which i dont' know how to do since it is being called from CSplitTestApp which is derived from CWinApp, not CWnd.
I have tried to create a class that has CSplitterWnd as its base class, but again I can't call the Create, or CreateStatic because I cant create the CCreateContext, and I cant get a pointer to the MainFrame from the CSplitTestApp.
Basicly I don't know how to even get started it seems, but i've been pushing this off for too long in this project and I have to be able to have a split view somehowwhen the user clicks a button from the file menu.
2) I found the article just now, im off to lunch, hopefully that will help some.
thanks for your responce, i hope im not too newbie for ya!
-dz
|
|
|
|
|
First of all, it can be done. I have done this - switching between 'normal' view and two splittered views. Unfortunately, I'm not allowed to post code snippets from this app - business, you know
Splitter creation will be identical. You'll be just doing this not in OnCreateClient but later.
Good starting point in learning how to switching view at runtime would be C++ QA column by Paul DiLascia published Feb'96 issue of MSJ. The article may be included in MSDN on your hard disk. If it's not there, go to msdn.microsoft.com
This article doesn't deal with splitters - however, it very clearly shows how to switch views. You should just go one step at the time and surely you'll be OK.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I've got a window now which pops up and puts the forms in them, now the question is how do i send data between the two different views since the views were created by using RUNTIME_CLASS(CFormView)... any suggestions?
-dz
|
|
|
|
|
Override OnUpdate function in the views. Use command routing. After command routing is implemented, pass some unique parameter to the document UpdateAllViews function, which you will use in the OnUpdate function.
Hope this helps,
Deian
|
|
|
|
|
Hi!
I´m trying to create a simple ftp client but I´m having problems creating an instance of the CInternetSession class.
I´ve downloaded an example ftp client that works but I just can´t get my own to work.
Do I have to link the CInternetSession class in a certain way?
I´m using VC++ 6 SP5.
/Jii
|
|
|
|
|
Here is some code i wrote:
void CTransmitView::TransmitReports(CString ftpserver, CString user, CString pass)
{
CInternetSession mySession;
CFtpConnection* pFtpConn = mySession.GetFtpConnection(ftpserver, user, pass);
if (pFtpConn)
{
pFtpConn->SetCurrentDirectory("\\uploads\\");
pFtpConn->PutFile("test.txt", "test.txt");
pFtpConn->Close();
}
----
there is no exception handling in there.. you should add some for CInternetException and some other stuff prolly..
-dz
|
|
|
|
|
You are using a Direct Connection or a Proxy?
You are trying to connect using any Port?
Show any of your code...
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I'm looking to create a modeless dialog in a dialog based mfc application.
This has to be done by the main dialog on a signal received from a working thread.
I've tried sending an user message and by directly calling a method of the main dialog class; the result was runtime error on release configuration, so i need a better way to communicate between the worker and the main dialog.
I'm waiting for a clue.
rechi
|
|
|
|
|
Could you post some code to see how you've implemented the thing? In principle, sending a message from a worker thread to a dialog to perform some UI operation is OK, so I guess there's hope your approach will work
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
There is nothing special in the code; in fact is really classical:
(in the thread)
((CDialog *)GetOutput())->SendMessage(WM_VIRTUAL_WANTCHAT);
(in the dialog message map)
ON_MESSAGE(WM_VIRTUAL_WANTCHAT, OnVirtualWantChat)
(the method)
void CClientxDlg::OnVirtualWantChat()
{
CChatDlg *dlg=new CChatDlg();
dlg->Create(IDD_DIALOG_CHAT, this);
if (dlg)
dlg->ShowWindow(SW_SHOW);
}
rechi
|
|
|
|
|
- What does
GetOutput exactly do?
- Is the
CClientxDlg blocked in any way as in your previous questions from yesterday?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|