|
I'm not exactly sure what you are asking, but it sounds like you need to run your program trhrough all of the possible combinations, and then note the memory consumption via Task Manager right before you shut it down. That might give you a good-enough answer to the question, "In the worst case, how much memory does my program require to run?"
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Respected all
Regards!
I am a begginers n VC++.i have a problem.
" I have a number of images(bitmaps) that are stored on disk,I want to read all the images once and store all the images in a temprary storage area when my program runing instead of reading one by one image,I think "CImageList " will solve my prolem but not because this store all the images of same size and i have images of different sizes.
so plz help me that how i handle this problem
david
|
|
|
|
|
You can use CBitmap to load the bitmaps, but create the CBitmap objects dynamically.
And you can have a class variable like:
CPtrArray m_ptrBitmapArray;
CBitmap* b;
Do the following for all bitmaps.
b = new CBitmap;
b->LoadBitmap(...);
Then add the bitmap to the array.
m_ptrBitmapArray.Add(b);
You can again access them like:
CBitmap* b;
b = (CBitmap*)m_ptrBitmapArray.GetAt(0);
this is this.
|
|
|
|
|
Use a simple linked list of image data.
- Parhar
|
|
|
|
|
How can I get a Color of Control. The only information do I have is the handle of that control. How Can I Get and Set is Color. I tried out:
CDC* pDC = wndCtrl.GetDC();
pDC->SetBkColor(...);
I hope it wud worked but it didnt ... Any help on both ( getting and setting ) color of a control with above mentioned requirement.
Best Regards
|
|
|
|
|
class CStrEdit : public CEdit
{
protected:
COLORREF m_crTextColor;
COLORREF m_crBkColor;
CBrush m_brush;
...
...
...
};
...
...
...
...
CStrEdit::CStrEdit()
{
m_crBkColor = ::GetSysColor(COLOR_WINDOW);
m_crTextColor = ::GetSysColor(COLOR_WINDOWTEXT);
}
CStrEdit::~CStrEdit()
{ m_brush.DeleteObject(); }
BEGIN_MESSAGE_MAP(CStrEdit, CEdit)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_CREATE()
END_MESSAGE_MAP()
// CStrEdit message handlers
HBRUSH CStrEdit::CtlColor(CDC* pDC, UINT nCtlColor)
{
if (m_brush.m_hObject) {
pDC->SetBkColor(m_crBkColor);
pDC->SetTextColor(m_crTextColor);
return (HBRUSH) m_brush.m_hObject;
} else
return NULL;
}
void CStrEdit::SetBkColor(COLORREF crColor)
{
m_crBkColor = crColor;
if (m_brush.m_hObject)
m_brush.DeleteObject();
m_brush.CreateSolidBrush(crColor);
}
void CStrEdit::SetTextColor(COLORREF crColor)
{ m_crTextColor = crColor; }
int CStrEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CEdit::OnCreate(lpCreateStruct) == -1)
return -1;
SetBkColor(m_crBkColor);
SetTextColor(m_crTextColor);
return 0;
}
Got the solution? Then rate this.
Nice talking to you.
|
|
|
|
|
Well I am doing it. Actually I am deriving a class from CFileDialog but I simply cant catch the WM_CTLCOLOR or WM_CTLCOLOR_REFLECT message whereas when I derive the class from CDialog then I am able to handle the message WM_CTLCOLOR or WM_CTLCOLOR_REFLECT. any help on it.
Regards
|
|
|
|
|
Ibraheem Khan wrote:
Set is Color. I tried out:
you have to Handle WM_CTLCOLOR message in your application
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Well I am doing it. Actually I am deriving a class from CFileDialog but I simply cant catch the message whereas when I derive the class from CDialog then I am able to handle the same message u mentioned. any help on it.
|
|
|
|
|
Hello,
I want code to creating DSN dynamically.
|
|
|
|
|
parims wrote:
I want code to creating DSN dynamically.
great ! that's all you want ? humm, let me see what i have in my bag... oh, here is this :-
void main(void) {
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i don't know where is that poor dick who vote down anonymously, but 2 things for you, sucker :
1- that was a joke !! can't you see the icon ?
2- the original question wasn't that clear to give a much precise answer ! moreover, people asking that way (I WANT, I WANT) don't generally get much pertinent responses...
now, give me a 1 if you cannot say your name b*tch
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Just use SQLConfigDataSource() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello, everyone!
I want to develop a network printer monitor, which will run on a network printer server. It should trap every print job sent to it, then send notification about authorization to the client PC which sent this job, and receive and check password messsage, then determine to continue print job or deny it. At last it logs the print job in a local access db.
Perhaps, I should develop a client app which gets authorization information as soon as user start a print job, attaches them to the print job, and sends to network printer.
Any ideas about how to do? Thanks in advance.
Dave
|
|
|
|
|
Hello.,
I developed an application which stores some data.
Next I create a setup file .
The SetUp file (If I installed in my Machine) works fine in my System, But It can not works fine in other machines.
=>Because I hard coded the DSN name as 'MyDSNName'
and Database Table as 'MyDataBase'
--
I wrote code like this.-=-->
-------------
CString sql,sDate;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = "c:\\mydatabase.mdb";
CDatabase db;
sDsn.Format("ODBC;DRIVER={%s};DSN='MyDsnName';DBQ=%s",sDriver,sFile);
db.Open(NULL,false,false,sDsn);
CRecordset recset( &db);
------------
>>I want flexible code ,which works fine for all machines.,
Praveen
|
|
|
|
|
no need for dsn here
specify the path of the database where you are going to install the program
and it will work fine , may be you can specify the path where your exe file is there
|
|
|
|
|
As I told you yesterday you have to look this article[^]
There you'd fine that you can connect to the DB without using a DSN name:
<br />
strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"<br />
"Dbq=c:\\DatabasePath\\dbaccess.mdb;Uid=; Pwd=;");<br />
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 2:28 Tuesday 6th September, 2005
|
|
|
|
|
Duplicating/Triplicating your thread won't solve it ...
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
See this link about DSN-less connections. Google for others.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
In my application .,
I am hard coded i.e., I created DSN,Database name and Table name as 'MyDSNName','MyDBName' and 'MyTable' respectively.
If I build a SetUp file for this appli., This application works only in my System .But it is not worked in other system.
So I want Flexible code ,which generates the default Databse and Table to the end user.,
(Then It will works in all Machines)
I hardcoded the code like this.,
--------------------->
CString sql,sDate;
CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)";
CString sDsn;
CString sFile = "c:\\mydabase.mdb";
CDatabase db;
sDsn.Format("ODBC;DRIVER={%s};DSN='MyDsnName';DBQ=%s",sDriver,sFile);
db.Open(NULL,false,false,sDsn);
CRecordset recset( &db);
Praveen Chowdam Kumar
|
|
|
|
|
|
#include < iostream.h >
#include < string.h >
class string
{
char *p;
int len;
public:
string(){ len =0; p=0; }
string(const char*s)
{
len = strlen(s);
p = new char[len+1];
strcpy(p,s);
}
string(const string &s)
{
len = s.len ;
p = new char[len+1];
strcpy(p,s.p);
}
~string() { delete p; }
friend string operator+(const string &s,const string &t);
friend void show(const string s);
};
string operator+(const string &s,const string &t)
{
string temp;
temp.len =s.len +t.len ;
temp.p = new char[temp.len +1];
strcpy(temp.p ,s.p);
strcat(temp.p ,t.p);
return temp;
}
void show(const string s)
{ cout << s.p; }
// if i wrote code like this. working fine.
int main()
{
string s1 = "new", s2 = "new1", s3 = "new2";
string t1(s1),t2(s2),t3(s1+s3);
cout<<"\n t1 = ";
show(t1);
cout<<"\n t2 = ";
show(t2);
cout<<"\n";
cout<<"\n t3 = ";
show(t3);
cout<<"\n \n= ";
return 0;
}
// if i wrote code like this. Not working.
// Getting Runtime error.
int main()
{
string s1 = "new", s2 = "new1", s3 = "new2";
string t1,t2,t3;
t1=s1;
t2=s2;
t3=s1+s3;
cout<<"\n t1 = ";
show(t1);
cout<<"\n t2 = ";
show(t2);
cout<<"\n";
cout<<"\n t3 = ";
show(t3);
cout<<"\n \n= ";
return 0;
}
Nice talking to you.
|
|
|
|
|
define one assignment operator, will be similar to copy constructor. it get called at line t3=s1+s3
|
|
|
|
|
You haven't overloaded the = operator, needed for the second version. This is a simple implementation:
string operator=(const string &s)<br />
{<br />
delete p;<br />
p = new char[strlen(s.p) + 1];<br />
strcpy(p, s.p);<br />
return *this;<br />
}
I also recommend to rename your class to myString or something like that.
|
|
|
|
|
Thanks for both of you for replying.
Nice talking to you.
-- modified at 3:05 Tuesday 6th September, 2005
|
|
|
|