|
thank u,
please give me anye example or any code that's y i can easily understood,
vasu
|
|
|
|
|
I think you need to calculate (width and height) from windows and then you want to set location from window
but i see in first your message "if we move the dialog to end of the screen then the child must move to left this is my project" you can use GetWindoRect(rect);ScreenToClient(rect); and then use from rect for location child window
whitesky
|
|
|
|
|
i done it partially.
because once i compare this co-ordinates then it is moving towards left.after that if we move with mouse cursor then it will not moving to left.no action is there.
so please help me.
vasu.
|
|
|
|
|
your window is child so it depend to main dialog so when you want to change location to out main dialog you cant(my guess)
whitesky
|
|
|
|
|
For the logic, you have to work it out yourself. Basically you may wish to check out these functions.
GetSystemMetrics[^] - To get the width and height of your desktop.
GetWindowRect[^] - To get the location and size of your dialog.
SetWindowPos[^] - Set the location for your dialog.
CWnd::OnMoving[^] - The framework calls this member function while a user is moving a CWnd object.
|
|
|
|
|
Hello, I receive a string from registry which looks like this "(1;2;3;4;5;6;7)" it saves the order of the columns of my listview object
Now I want to put it into an LPINT but when I use SetColumnOrderArray it causes an exception:
LPINT lp_OrderArray = (LPINT) malloc(iColumns*sizeof(int));<br />
<br />
for( i;i < iColumns-1; i++)<br />
{<br />
strRegPos = strColOrder[p]; <br />
int nNumField = _stscanf(strRegPos, _T("%i"), &iPos);<br />
<br />
if (nNumField != EOF) <br />
{ <br />
lp_OrderArray[i] = iPos; <br />
p = p + 2;
}<br />
}
I am not the best developer, but maybe someone here could help me
regards
|
|
|
|
|
One thing. the exception is not occured by LPINT
Checker2003 wrote: strRegPos = strColOrder[p];
what is the value of p? I clearly doubt this. on each iteration you are incrementing p by 2 it will cause array bound exception. you are not checking it whether it is in array size or not
suppose you have 10 elements.
if the index reach 5th (or 6th) element, I think you program will crash unless there are more elements ni steColOrder.
One more thing, in your loop, make sure that the i is initialize properly.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Thank you for your fast reply sarath,
My Array has always the same size, because my Listview control hast always 7 Columns.
My tags are initialized in this way:
int iColumns = 8;
int i = 0;
int iPos = 0;
int p = 0;
thank you for your efforts
|
|
|
|
|
Shouldn't it be
iColumns = 7;
int p = 1;
for(i=0; i < iColumns; i++)
?
I don't see where the exception is coming from though. What is the exception and which line does it occur?
|
|
|
|
|
In an MSDN sample, I saw a code snippet
HWND hwnd;
hwnd = CreateWindowEx(
);
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
Why should we call UpdateWindow,after showing window? Don't the ShowWindow function refreshes the window?
Here that code!!![^]
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
This function update window with send WM_PAINT
whitesky
|
|
|
|
|
ShowWindow(hwnd, SW_SHOW);
This wont send a paint message?
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
ok ok I understood.
ShowWindow sends paint message only if required right?
this one makes sure that the window redraws when initialized right?
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
When you use CreateWindow it send a WM_CREATE message and if you use
WM_VISIBLE in createwindow then it sends all messages required
whitesky
|
|
|
|
|
whats this MAXDWORD?
How do I determine the values for COMMTIMEOUTS?
|
|
|
|
|
|
Is setting the ReadIntervalTimeout in COMMTIMEOUTS to MAXDWORD with zeros for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members correct? Can this setting of the SetCommTimeOuts be the problem for receiving the same packet everytime in my application.
This is with reference to my previous question posted an hr ago.
Can you help me with this please?
my previous question is :
I have established serial communication with RABBIT3000 (an 8 bit microcontroller).
The packet from the microcontroller is sent to the PC only on the PC demanding it. The demand is sent through one of the variables in the packet sent from PC.
When the PC receives packet from the microcontroller, it receives the correct packet for the first time. During my second request and further,
the Pc keeps receiving the same packet that it received first.
The packet from the microcontroller is updated on some conditions so that its different values in the packet memebers each time it is sent to teh PC on demand.
but when I try sending a different packet (microcontroller updates the packet structure members) to the PC, it still receives only the same packet that it received first and not the updated one.
I receive the packet using Readfile and store the values in a circular buffer.
On the microcontrollers end, the changed values is what is sent in the packet. I have debugged on the microcontroller end and it is fine.
Why is the PC receiving the same packet ?
What could be the possibility? any suggestions?
-- modified at 2:50 Thursday 6th July, 2006
|
|
|
|
|
Hi,
I have created a project using cview and i have created a propertysheet with two property pages.I have two edit boxes in property page.How can I get the data from tha database.(i have already connected to database)
Please help me.
tejaswini
|
|
|
|
|
can't you use CRecordset?
See the sample from MSDN[^]
on iterating either you can update to the list box, edit box or a string array ( depends on your application). Anyway this is the method to get the records and its field value. it is not related to property page.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
-- modified at 3:00 Thursday 6th July, 2006
|
|
|
|
|
While creating my project(say Sample) using MFCappwizard i connected to a datasourse and instead of CRecordView I used CView.The Appwizard created a SampleSet class which is derived from CRecordSet.
My question is how can I map my control in the property page to database field.If u don't mind can u show a sample code.
thanks in advance.
tejaswini
|
|
|
|
|
I haven't a readymade right now
But the best aproach is to set the values manually. if you associate a text box, with a feild the changes you made will reflect in the data base. so the best practice is to update the values whenever required. Just search in google or CP you will get alot of resources.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
ok thank u i am searching in google
|
|
|
|
|
hi all
plz tell me.
i use this function to change the color of button
and i set text on it as click
but how can ichange the font of this click text
as i try to change but not successful. so tell me how can i set font with color
void CBtncolorDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
CRect Rect(lpDrawItemStruct->rcItem);
dc.Attach(lpDrawItemStruct->hDC);
dc.SetBkMode(0);
dc.FillRect(Rect,&CBrush(RGB(0,100,0)));
dc.SetTextColor(RGB(255,0,0));
dc.DrawText("Click",Rect,DT_CENTER|DT_SINGLELINE);
dc.Detach();
}
Ashish Dogra
MCA
Noida
|
|
|
|
|
use CreateFont()
and then SelectObject()
Regards
Abhi Lahare
|
|
|
|
|
i try these but if u can give example thats good
Ashish Dogra
MCA
Noida
|
|
|
|