|
or u could just
compare the two (the denominator and the numerator) .....find out which one is the greatest......and find all the factorz of the greatest number.....then divide these factorz with the other number(which happenz to be the smaller one).....the greatest factor for whch u get no reminder will be ur GCD.....
Happy Programmin.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
When I need to call my function
<br />
<br />
CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext*<br />
pContext)<br />
<br />
I need to give parameter CCreateContext* pContext. How can I do it?
Thanks in advance, bilas.
|
|
|
|
|
Without knowing what CreateSplitters does with a CCreateContext struct!
CCreateContext context;
CreateSplitters(nRows, nCols, nActRow, nActCol, &context);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Is there any difference between private: and private:\ in c++/vc++?
rajesh
|
|
|
|
|
Do you mean private:\ as in
<code>
class CClass
{
private:\
public:\
};
</code>
then the \ is used as a continuation character. Usually used to continue the current line, if it gets too long.
I Dream of Absolute Zero
|
|
|
|
|
Rajesh_K_Sharma wrote:
Is there any difference between private: and private:\ in c++/vc++?
'vc++' is a compiler to compile 'c++' codes.
suhredayan There is no spoon.
|
|
|
|
|
Hi,
how can i change the arrow cursor to hand cursor when the mouse is on the button?
i tried this:
HCURSOR m_hCursorHand;
m_hCursorHand = AfxGetApp()->LoadCursor(IDC_HandCursor);
m_ExitButton.SetCursor(m_hCursorHand);
and this:
m_TestButton.SetCursor(::LoadCursor(NULL,"IDC_CURSOR1"));
but its not working.
Thanks,
Eli
|
|
|
|
|
the prob is that when u set the cursor to an another type.....and when u move the Onmousemove getz called and the previous cursor getz put it.....u can sove this by overriding the OnSetCursor function
all mouse messages that are recieved call the in the end the OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) function.....make sure that in this function you specify the code that in this function(it is better).....
if(m_DragOn==FALSE)
{
hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
}
else
{
hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );
SetCursor( hIcon );
}
Like for example declare the variable say m_DragOn and keep setting/clearing this variable in places where u want the handcursor(assume handcursor is IDC_CURSOR2 and is set when m_DragOn is TRUE)
hope that helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
hi, anyone got any idea how to convert a bitmap to a jpeg without using an already made libary? (please explain it, because i dont know visual c++ very well)
Thanks
|
|
|
|
|
Without an already made library? Hmm, good luck trying to implement the JPEG compression code yourself...
Why not using the free CxImage library? I've used it several times and did everything perfectly. http://www.codeproject.com/bitmap/cximage.asp[^]
|
|
|
|
|
thanks for the reply, the problem is that im a complete muppet and can never get libary's to work. anyone care to explain how too? (And yes im know it may seem usless but i aint been use visual c++ for very long)
Thanks
|
|
|
|
|
I want to add an new item to the New option of the right click pop-up menu on the desktop?
I do I do that?
|
|
|
|
|
I am using an OCX ActiveX control which was written in VB within my MFC project.
After successfully inserting the OCX into my project, I can use the few methods declared within it and can use them successfully.
My problem is : I don't see the Event , that OCX is able to raise.The function just doesn't appear in the interface class the wizard created, to help me use the OCX.
How can I intercept the raised Event ?
Rubi
|
|
|
|
|
I currently trying to create mouse input using the SendInput method. I've currently got it so that I can change the mouse location however my program will in future take the new co-ordinates from a seperate program, does anyone know if there are any system methods to convert the users input (say in DP) to the 'display surface map'(i.e. 65535,65535)) used by the SendInput method?
Just in case I haven't explain clearly I paste what it says in MSDN about this:
"If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner. "
The full article on MSDN is at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputfunctions/mouse_event.asp[^]
|
|
|
|
|
Hello hello,
So...I am working on a ActiveX control, where when the user clicks the mouse and lets go of the mouse with the cursor over a specific area in the control, a CEdit control is made visible at the position of the ActiveX control. The user can enter a number into the CEdit control, and then when clucking outside the CEdit control, that value entered gets stored in a variable and the CEdit control becomes invinsible.
The problem comes when trying to click on that area of the ActiveX control again. the CEdit control will apear but can no longer enter any values. I cannot get that vertical line in the CEdit box that allows me to type in characters/numbers.
If I run it in debugging mode, with breakpoints at the point where the CEdit is to be shown, and where the CEdit is to be hidden, then it works pefrectly as many times as I like. I can keep clicking on that area of the control, showing the CEdit, entering a number, clicking elsehwere and hiding the CEdit, and so on and so forth.
It turns out that the reason why it works when debugging and not when not debugging is that when I have breakpoints in parts of the code, the focus leaves my control in the ActiveX control container, and goes to the VS window to show me the break point. Then when I press F5 and return back to the ActiveX container then it all works again.
Similarly, when I run the control out of debug mode, clicking on other windows or applications solves it and makes the control work.
so a sequence like this works:
1)click on the area over which the CEdit should appear,
2)CEdit appears
3)Enter a value
4)click outside the CEdit
5)CEdit disapears
6) >>click on other window/application/desktop etc<<
7)click back on ActiveX container
8) Go to step 1.
Without step 6, I canot get step 2 to happen more than once.
We thought it maybe a matter of focus. So, the code was changed so that when the CEdit control appears it also gets the focus, and when the user clicks elsewhere and the CEdit hides, that the parent control gets the focus.
I have put the code below...anybody who has actually read so far into this post might as well have a look at it. thanks!
<br />
LRESULT CKnob::OnLButtonUp(UINT , WPARAM , LPARAM lParam, BOOL& )<br />
{<br />
m_bMouseDown = false;<br />
<br />
RECT tempRect;<br />
GetClientRect(&tempRect);<br />
int nLeft = (tempRect.right - tempRect.left) / 2 - KNOBSIZE / 2;<br />
int nTop = (tempRect.bottom - tempRect.top) / 2 + KNOBSIZE / 2;<br />
if((LOWORD(lParam) >= nLeft) && (LOWORD(lParam) <= nLeft + KNOBSIZE) <br />
&& (HIWORD(lParam) >= nTop) && (HIWORD(lParam) <= nTop + TEXTAREA))<br />
{<br />
m_bShowCEdit = true;<br />
CString tempString;<br />
tempString.Format("%ld", m_nPosition);<br />
m_editValue.SetWindowText(tempString);<br />
int a = m_editValue.ShowWindow(SW_SHOW);<br />
m_editValue.SetFocus();<br />
}<br />
else<br />
{<br />
if(m_bShowCEdit == true)
{<br />
CString strTemp;<br />
m_editValue.GetWindowText(strTemp);<br />
m_nPosition = _ttoi(strTemp);<br />
int b = m_nPosition = max(m_nMin, min(m_nPosition, m_nMax));<br />
m_editValue.ShowWindow(SW_HIDE);
this->SetFocus();<br />
}<br />
m_bShowCEdit = false;
}<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
I have 2 printers installed, i need to switch from one to another without user interface. how to set the printinfo properties programatically?
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
|
1 : Get the handle to devmode and devnames structures by calling the OpenPrinter and GetPrinter API calls and populate PRINTER_INFO_2 strucure.
Copy these handles to printInfo.m_pPD->m_pd.hDevMode and printInfo.m_pPD->m_pd.hDevNames
2 : Call SelectPrinter() API with the handles.
Make sure to reset to the original printer properties.
|
|
|
|
|
how to disable close button of CPropertySheet?
the button is the one at top-right conner (on caption bar) of the sheet for closing the sheet by clicking it.
thx
includeh10
|
|
|
|
|
Can anyone please tell what causes "Class Does Not Exist." (error code 1411)? How can i resolve the issue?
Regards
Tariq
|
|
|
|
|
did you #include head file which contains the class?
includeh10
|
|
|
|
|
A wild guess from your unclear question. The com dll you are using may be old.
suhredayan There is no spoon.
|
|
|
|
|
I was wondering, how do you capture a run on a C++ program?
Jonathan
|
|
|
|
|
What is a "run?"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
run
|
|
|
|