|
Derive it from (subclass)CMyEdit and override the WM_CHAR.
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
CString type = "abcdefghijklmnopqrstuvwxyz";
I only need "defg" in this CString...
How Can I copy it into another CString??
|
|
|
|
|
mimimimilaw wrote: I only need "defg" in this CString...
How Can I copy it into another CString??
Use Find and Mid methods of the CString
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
THX
|
|
|
|
|
CString ::Right(), CString::Left() may help
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See here like this
<br />
CString type;<br />
CString str2;<br />
type= "abcdefghijklmnopqrstuvwxyz";<br />
<br />
str2=type.Mid(type.Find(_T("defg"),0),4);<br />
MessageBox(str2);<br />
<br />
whitesky
|
|
|
|
|
Here you are finding for defg and then copying it .
if you know that defg is present then why to copy it .
wont this do:-
CString type(_T("defg"));<br />
CString str2 (_T("abcdefghijklmnopqrstuvwxyz"));<br />
int iFind = str2.Find (type);<br />
if (iFind !=-1)<br />
MessageBox(type);
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
it was one help for how to use (only)
whitesky
|
|
|
|
|
Hi,
My boss has told me to develop a program which will connect to client's website. On the site there are links to excel, mdb databases, few images.
So program should be make the task automated. It will take the link of the web page, visit the all links available in there and download to a particular folder. When it finishes, it should flash a message that download complete.
Is there any such program exists on CP? Can someone tell me few guidelines .
Thanks
row
|
|
|
|
|
ROWALI wrote: visit the all links available in there and download to a particular folder. When it finishes, it should flash a message that download complete.
See the URLDownloadToFile(...) API
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
See:
CInternetSession, HINTERNET ,InternetReadFile, InternetOpenUrl
Cheers
"Peace of mind through Technology"
|
|
|
|
|
|
How to enlarge/set the memory for a MFC project in VC6 platform?
In my MDI project, I set several dialogs , and some controls(such as check box)
after I add variable for each MFC control, successed in compiler no matter debug or release mode, then execute it and error occurs.
if delete some variable of the MFC controls, it might be ok.
I debuged the project, the error message "memory is not enough" is occurs in system function
LRESULT AFXAPI AfxCallWndProc(CWnd* pWnd, HWND hWnd, UINT nMsg,
WPARAM wParam = 0, LPARAM lParam = 0)
|
|
|
|
|
Well you can enable /LARGEADDRESSAWARE option by setting this under Project Properties --> Configuration Properties --> Linker --> System --> Enabl Large Aaddress. For this to work , you have to set /3GB option in the boot.ini file as well in an xp/2003 OS.
This option will enable your application to use 3gb of memory insted of the default 2GB.
cheers...milton kb.
|
|
|
|
|
it was impossible that my project would use over 10KB memory......
if I delete the debug folder, and rebuild the project, it seems ok,
if I continue to add some class or variable for MFC controls, the error occurs again.
some times the error is "Assert" some times is other.....
|
|
|
|
|
It seems like insifficiant disk space. may be ie why it works when u delete the debug folder it is working. make some more free space in the disk and give more room for virtual memory and paging on the harddisk.
cheers...milton kb.
|
|
|
|
|
How to enlarge/set the memory for a MFC project in VC6 platform?
In my MDI project, I set several dialogs , and some controls(such as check box)
after I add variable for each MFC control, successed in compiler no matter debug or release mode, then execute it and error occurs.
if delete some variable of the MFC controls, it might be ok.
I debuged the project, the error message "memory is not enough" is occurs in system function
LRESULT AFXAPI AfxCallWndProc(CWnd* pWnd, HWND hWnd, UINT nMsg,
WPARAM wParam = 0, LPARAM lParam = 0)
admire
|
|
|
|
|
is there a way to change the background color of these? and i have a slider that is created after the dialog is opened that needs to be changed to.
|
|
|
|
|
Use this if it suits your needs:
In the WM_CTLCOLOR :
HBRUSH hBR=CreateSolidBrush (RGB(255,0,0));
if(pWnd->GetDlgCtrlID ()== IDC_SLIDER1)
return hBR;
if(pWnd->GetDlgCtrlID ()== IDC_SCROLLBAR1)
return hBR;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
that worked very well but i guess i messed up the scrollbar is part of a listctrl not just a scrollbar. and 1 of my sliders is created after i push a button and i dont know how to change its color.
if (m_Video == NULL)
{
m_Video = MCIWndCreate(this->GetSafeHwnd(),
AfxGetInstanceHandle(),
WS_CHILD | WS_VISIBLE | MCIWNDF_NOMENU,temp1);
}
that makes the slider.
-- modified at 22:51 Tuesday 20th June, 2006
|
|
|
|
|
The ScrollBar are derived from CScrollBar,So u can subclass it at runtime and return the brush in the WM_CTLCOLOR.I have never tried just an sugesstion .
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
locoone wrote: is there a way to change the background color of these? and i have a slider that is created after the dialog is opened that needs to be changed to.
HBRUSH CtestMFCDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor== CTLCOLOR_SCROLLBAR)
{
hbr=CreateSolidBrush(RGB(0,100,0));
}
return hbr;
} The above code changes the Back color of all the scroll bar controls of the Dialog box.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Any one have the Coding convention guidelines for VC++?
Give me one, please.
Thanks
|
|
|
|
|
Here's one of mine:
Never use C-style casts in a C++ program; use the new C++ casting operators such as static_cast instead. Using C style casts, such as "(CWnd*) ", is reckless, vague and dangerous.
Steve
|
|
|
|
|
Here's some code I developed recently which justifies my previous post and shows one of the ways C-style casts can go wrong. See if you can spot the problem. Hopefully this will educate the people who voted good advice down - the new style casting operators were not invented for fun but to solve real problems. As I said, this is just one example - the C-style cast, while it looks simple, is actually very subtle.
--------------------------------
// CastProblems.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Classes.h"
#include "Actions.h"
int main(int argc, char* argv[])
{
Derived d;
GetBase2(&d)->Who();
return 0;
}
// Actions.h
//
#ifndef __ACTIONS_H__
#define __ACTIONS_H__
class Base1;
class Base2;
class Derived;
const Base2* GetBase2(const Derived *pDerived);
#endif // !__ACTIONS_H__
// Actions.cpp
//
#include "StdAfx.h"
#include "Actions.h"
//#include "Classes.h"
const Base2* GetBase2(const Derived *pDerived)
{
return (const Base2*)pDerived;
// return static_cast<const Base2*>(pDerived);
}
// Classes.h
//
#ifndef __CLASSES_H__
#define __CLASSES_H__
#include <iostream>
class RootBase
{
public:
void Who() const
{
using namespace std;
cout << "Base" << m_Num << endl;
}
protected:
RootBase(int num) : m_Num(num) {}
int m_Num;
};
class Base1 : public RootBase
{
public:
Base1() : RootBase(1) {}
};
class Base2 : public RootBase
{
public:
Base2() : RootBase(2) {}
};
class Derived : public Base1, public Base2
{
public:
};
#endif // !__CLASSES_H__
--------------------------------
As it stands this program will output "Base1" but we wanted "Base2". Needless to say if you use the following version of "Action.cpp" which uses "static_cast" the runtime error becomes a compiler error and your compiler complains instead of your customers.
--------------------------------
// Actions.cpp
//
#include "StdAfx.h"
#include "Actions.h"
//#include "Classes.h"
const Base2* GetBase2(const Derived *pDerived)
{
// return (const Base2*)pDerived;
return static_cast<const Base2*>(pDerived);
}
Steve
|
|
|
|