|
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
|
|
|
|
|
How to close a process which was created by CreateProcess() function properly?
let me explain a little bit:
i use DOS window to run jdb.exe, then the jdb.exe runs a java application (by command line).
as this:
DOS---->>jdb.exe------->>another program (java app).
when i close DOS window, both jdb.exe and java application are closed also.
so i say: DOS closes process of jdb.exe properly.
now i create a C++ program to replace DOS as this:
MyCppProgram------->>jdb.exe-------->>another program.
After calling ::TerminateProcess(), the process of jdb.exe is closed (by checking its handle), BUT, the java application is NOT closed.
my question: why DOS can close both but MyCppProgram only closes one (jdb.exe)?
i think i have not done properly for closing process of jdb.exe.
any suggestion?
thx
includeh10
|
|
|
|
|
|
which message is sent before WM_DESTROY when CProperSheet shuts down?
please note: as my test, WM_CLOSE is not sent.
i need a message similar to WM_CLOSE in which i can clean some tasks.
thx
includeh10
|
|
|
|
|
try handling SC_CLOSE from OnSysCommand.
Note: there can be a better solution for this.
suhredayan There is no spoon.
|
|
|
|
|
hi all
i am working on a display stuff...i basically want all the display modes present in the registry to be enabled in rightclik/properties/setting...
Is there any thing to be changed in the registry...bcoz this stuff can be done in win2k by enabling the pruning mode key in the regisry.........
thnx in advance
udaykumar
|
|
|
|
|
HI,
There is Problem in Printing a Page with HP laser jet. Using VC++
The message says something like "Header not Printed".
A printer that is an ink jet does print out the entire model. But HP laserjet 5MP does not.
Reply me plz . Its an urgent.
thanx
Regards.
|
|
|
|
|
I made a COM dll and it registers on my computer and works allright, but i can't register it on another machine. When i write regsvr32 mycom.dll it says that loadlibrary("...") can't load module, or something like this. I had this problem before, and someone advised me to check my dll with dependency walker, and find out wich dll it requires. But i didn't solve this problem, a copied all the dlls with my dll, and tried to register them , but my dll still didn't want to register itself!!! And by the way, i lost my dependency walker, where can i find it?. Does anybody know other way to solve this problem???
|
|
|
|
|
HI mr Rassul!
you will find your new dependency walker here[^]
could you tell me from where, Are you using regsvr32 , from CMD line or through coding . have you checked the path for your mycom.dll is correct ,i.e.
c:\>regsvr32 c:\cp\mycom.dll
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks for dependency walker, i used the regsvr32 from command line, and i found the problem. My dll need ActiveSync installed on the computer.
|
|
|
|
|
Hi Alok I answered to a thread but now I saw this thread do you know why?
|
|
|
|