|
|
Hi
CImage image;
image.Load (_T(read.tif"));
//x1 = 8108, y1 =68 , x2 = 8116,y2 = 82
CRect rect(x1,y1,x2,y2);
CDC *pDC=CDC::FromHandle(image.GetDC());
pDC->Draw3dRect(rect,RGB(255, 0, 0), RGB(0, 255, 0));
image.Save(_T("D:/2009ga.jpg"));
when i try to draw the rectangle in image ...
showing error msg like Expression : m_hDC == 0..but not drwing the rectangle in image..why
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
modified on Tuesday, September 15, 2009 4:49 AM
|
|
|
|
|
Why don't you have a look at the SimpleImage [^] sample code?
Alternatively: why don't you use a debugger?
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
[My articles]
|
|
|
|
|
thanks ..i hope it ll help me ...
how to debugger in Visual studio ..already i am working in C# .net ....i think its same procedure ...?
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
The following code snippet (inside the OnPaint handler) works on my system:
CPaintDC dc(this);
CImage img;
img.Load(_T("foo.jpg"));
CDC * pdc = CDC::FromHandle( img.GetDC() );
CRect rc(0,0,100,100);
pdc->Draw3dRect(&rc, RGB(0,255,0), RGB(255,0,0));
dc.BitBlt(0,0, 400, 400, pdc, 0, 0, SRCCOPY);
img.ReleaseDC();
(Consider it as it si, just a silly example: for instance reloading the image at every OnPaint call is foolish).
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
[My articles]
|
|
|
|
|
I want to dynamically create the controls on dialog box.
this dialog box may contain multiple list controls, check boxes, radio buttons, drop down boxes etc.
number of each controls depend on the some condition.
so can we do this if yes, how do i do this?
how do i handle the events related to the controls?
sunnyram
|
|
|
|
|
sunnyram wrote: so can we do this if yes, how do i do this?
Yes, of course. You've to use, for instance, CreateWindowEx [^] function.
sunnyram wrote: how do i handle the events related to the controls?
MSDN has a lot of examples about, see, for instance, the Using Buttons [^] topic.
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
[My articles]
|
|
|
|
|
Thanks, i will try suggested thing.
sunnyram
|
|
|
|
|
If it's only a handful, why not create them all at design time, and then show/hide them accordingly (ie, some condition)? Much, much easier than creating them at runtime.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
As it is a requirement we can not do this.
sunnyram
|
|
|
|
|
My program crashes on a client's pc (with XP) on this 3 lines (on any other pc it correcly runs):
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->SetForegroundWindow();
m_pMainWnd->UpdateWindow();
They are default instruction in the initialization function (InitInstance ) of a MFC program.
My antivirus (COMODO) tells a warning on UpdateWindow because when run trys to install a global hook on "atioglxx.dll" (It looks a dll from my ATI video board). If I do not permit this the program stops, else runs perfectly.
I'm quite sure that some setting of the antivirus of the client is locking this function! Or that his video-board isn't so compatible with this function.
Why this hook? Is it important? can I avoid this to let the program run on every pc?
Any other solution?
Of course there is the easy way (but not the real solution) to tell to the user to disable the antivirus (I think it is Norton)
Thanks
Russell
|
|
|
|
|
Russell' wrote: Is it important? can I avoid this to let the program run on every pc?
Have you tried?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All
I am try to get values from Mysql database.I am using pRecordset class for get data from Mysql.But it's generate error while the data type is Decimal.
strContent = (char *) (_bstr_t) pRecordset->Fields->GetItem((_bstr_t)"Price")->Value;
Table is
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10),
G DOUBLE(100,10), H DECIMAL(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5323423424.00004343434300000);
|
|
|
|
|
Error is
IDispatch error #3105
Plz help me
|
|
|
|
|
Have you tried:
A)
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10), G DOUBLE(100,10), H DOUBLE(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5323423424.00004343434300000);
B)
create table test(A TINYINT(100), B SMALLINT(100), C MEDIUMINT(100), D INT(100), E BIGINT(100), F FLOAT(100,10), G DOUBLE(100,10), H DECIMAL(65,20));
insert into test(A,B,C,D,E,F,G,H)values(65,645,365,31311,87655498,46546547.650909090,475735375734573.0000,5.5);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi Experts,
When I declare a Object of the class, How it store into memory i.e which memory segment it used?
|
|
|
|
|
MPTP wrote: which memory segment it used?
I presume you are trying to distinguish whether it is stored on the heap or the stack. If you create an object via new() then it goes to the heap. If it is a local variable it goes on the stack.
|
|
|
|
|
MPTP wrote: memory segment
Do you want to know if an instance of a class is stack or heap allocated?
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
[My articles]
|
|
|
|
|
If you have created the object like. Myclass m;
the object is stored on the stack
if you have done-- Myclass* m = new Myclass();
the memory is allocated from the heap.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
the runtime takes care which memory is used. Every time a object is created some memory will be used. You can get the information about that getting the address of of the object.
In C++ you 3 ways to create objects
Sample code:
void sampleFunc()
{
Object obj1;//Stacke with automatic destruction
Object *addrObj = &obj1;//getting the address of memory
//do not
//delete addrObj;//Bug
Object *pObj = new Object();//Heap and manuell destrucion needed!!!
delete pObj;// to avoid memory leak;
}
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
As replied by the others here, whether stack or heap is used is not dependent on a class.
For memory allocation, a class is nothing but a chunk of a particular size.
In fact it is the same for a structure, class, fundamental types, arrays etc.
Dynamic allocation (new, malloc etc.) allocate memory on the heap.
Function arguments and local variables use a stack.
A separate stack exists for each thread.
Initialized global variables are created in a separate section in the the executable.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hello friend,
plz tell what is the syntax error in belows access query.pdpstate is the name of table
INSERT INTO pdpstate(setid,power,input,aspect,ontimer,offtimer,multiscreen,
volume,mute,balance,treble,bass,brightness,contrast,tint,red,green,blue,frequency,phase,
hposition,vposition,displayflag,ontimehour,ontimemin,ontimeampm,ontimeonoff,ontimevolume,
offtimehour,offtimemin,offtimeampm,offtimeonoff,failcount,sharpness,color,rgb_contrast,
rgb_brightness,pip_onoff,pip_aspect,pip_source,ontimesource,service5v,service12v_main,
service12v_audio,servicelamp_time1,servicelamp_time2,servicelamp_time3,servicelamp_status,
rgb_sharpness,rgb_colortemp,shiftonoff,h_dot,v_line,shifttime,wiper,allwhite,videowall,
timedisplay,eq100hz,eq300hz,eq1khz,eq3khz,eq10khz,bbe,max_hour,max_min,max_ampm,max_value,
min_hour,min_min,min_ampm,min_value,autolamp,scroll_period,scroll_time,colortone,comport,
vwallmode,scroll_type,tv_select,wall_div,wall_sno,rgb_colortone,lamp_error,temperature,
br_sensor,no_sync,current_temp,fan_error,tv_ mode,major_ch1,major_ch2,sel_minor,
minor_ch1,minor_ch2)VALUES('0','1','30','16','1','1','10','80','0','50','10','60','20','0','30',
'26','88','29','40','20','1','1','0','2','9','0','1','5','10','7','0','0','0','76','0','20','20',
'1','0','20','33','1','1','1','1','1','1','1','2','2','1','1','1','1','1','1','1','1','1','10','1',
'1','1','1','63','255','1','100','63','255','1','255','70','1','1','2','1','1','6','1','36','3','1',
'0','0','0','1','44','0','20','4','50','20','10','5')
regards
jitu
|
|
|
|
|
You're kidding, right? Anyways, this[^] section might be more suited for these kinds of questions...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Beware: you're just one step away from Liquid Nitrogen.
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
[My articles]
|
|
|
|
|
Start with this:
INSERT INTO pdpstate(setid)VALUES('0')
If that works, add another field/value pair. Continue until syntax error appears.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|