|
mcsherry wrote: the OnNcHitTest only seems to be called when I've released the left mouse button, so during my drag it doesn't get called
That's because the system enters a modal message loop for the duration of
the drag.
You may want to take a look at the WM_MOVING message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi thanks for your reply, I've got the solution now, all I had to do was re-read the article I linked to in my orignal post and implement the OnLButtonDown, OnLButtonUp and OnMouseMove methods instead of the other one and do my region check in the OnMouseMove method.
Andy
|
|
|
|
|
mcsherry wrote: OnLButtonDown, OnLButtonUp and OnMouseMove methods instead of the other one and do my region check in the OnMouseMove method
Cool
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, i have SDI app and CDialog based window, i need to scroll client area if something in window is larger than window itself. I overwrite DoDataExchange() function and add :
SetWindowPos(&wndTop, 0, 0, 800, 500, SWP_SHOWWINDOW);<br />
if(x==2){<br />
ShowScrollBar(SB_BOTH);<br />
SetScrollRange( SB_HORZ, 10, 5000);<br />
SetScrollRange( SB_VERT, 10, 5000);<br />
}<br />
But i can't scroll client area.
In previous app i use CFormView derrived window and overwrite OnUpdate() function using this code :
<br />
void CResize1View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) <br />
{<br />
if(((m_iLiczbaBut+1)*50)> 400){<br />
SetScrollSizes(MM_TEXT, CSize(780, (m_iLiczbaBut+2)*50));<br />
}<br />
else{<br />
SetScrollSizes(MM_TEXT, CSize(780, 500));<br />
}<br />
<br />
}
It work corectly in CFormView, but this time i need the same in CDialog but i don't know how to do this. Please help.
|
|
|
|
|
Hi zarraza,
It is possible (if I recall correctly). I believe I found a sample floating around the web a few years back. The details escape me. Sorry.
Jeff
|
|
|
|
|
I seem to be pulling my hair out. Maybe because it's easier than I think and nobody seems to need help with it, but I am trying to get 2 pieces of data out of my bridge using SNMP and display them on a window.
Problem is, I can find no libraries or code projects that seem to address this in any detail. Is it that difficult?
I am an old C programmer than is getting back into prgramming and I like vc++ and am just learning it, so maybe its just me : /
Seems like there could be a function where you send it the MIB octet and get your number back:
unsigned long in GetSNMP(octect *sOctet);
Thanks
-Jay
|
|
|
|
|
Rhymhoont wrote: I like vc++ and am just learning it, so maybe its just me
So you are developing this for Windows? If so you want to look at the WMI API. There is a SNMP provider available and the API provides the Read/Write operations you seem to be asking about. According to the documentation the provider is not available on 95/98 OS.
http://www.google.com/search?hl=en&q=MSDN+WMI+%22SNMP+Provider%22&btnG=Search[^]
|
|
|
|
|
Yes it will be a Win32 app.
I'll take a look at that. Thank you.
So far I am just reading my MRTG log files for the data but, for obvious reasons, want the app itself probe the bridges for data.
I was concidering making a console based app that probes and uploads the data into SQL, and then the Win app reads it and reacts from there. This could be done with two win apps as well, with one running as a service. But in any case, I must be able to get the SNMP data. ; )
Thanks again
|
|
|
|
|
hai all,
i will narrate an example, there by convey my doubt.
in my edit box, the fifth character cannot be an alphabet.
so if the user types 1a34 and D,
i have to delete D from the string in the editchange event and replace the string 1a34 there, such that, the user can type a valid fifth character.
here the problem iam getting is, if i do like this, the cursor is placed at the starting of the string.
now is there any technique, suchthat, i can set the cursor at a required position?
thanks for the opinions.
|
|
|
|
|
You can use the EM_SETSEL message (CEdit::SetSel()) to position
the caret in the control.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
chandu004 wrote: in my edit box, the fifth character cannot be an alphabet.
It sounds like you need a masked edit control. See here and here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: It sounds like you need a masked edit control
Or maybe a Caped Crusader
|
|
|
|
|
Thank you very very much for your reply.
it seems that, this may be certainly useful for me.
i shall do some exercise on that and come back to you.
|
|
|
|
|
I want to know how i can realize this convertation?Can you guide me on this?
Thank you!
|
|
|
|
|
|
Thank you very much!
Can you guide me more on this? Because i did not touch the web you provide before, so i want to know more about that.
If you are not convenient,thank you all the same.
|
|
|
|
|
It seems you found your answer.;)
|
|
|
|
|
Yes.I think i am near to solve my problem.But now i haven't solve it yet.I am now trying my best.
Thank you for your help!
|
|
|
|
|
Very good I hope you find answer early.
|
|
|
|
|
Today i have time to look through the web you provide carefully.You provide a tool to realize the converation.But i want to do it through the programme.
Thank you all the same!
|
|
|
|
|
Hi,
I know that the most obvious answer is "check it out" but...
If I code a dll with some functions and, in a part of the main programm, I use it with
MyDll::MyFunction ();
if the DLL is not present when it is supposed to be... obviously the function won't be called, but will the programm give an assertion? or just try the line and go on as nothing?
I have already coded the functions in my program, that should be in the dll. The functions work, but I have no experience with dll and I would like to know the best way to use the functions only when the Dll is there, but having no problems when it is not there.
I have thought to check an easy
CFile f;
if (f.Open ("MyPathToDll\\MyDll.dll", CFile::modeRead))
{
f.Close ();
MyDll::MyFunction ();
}
else
MessageBox ("This function is only reachable if the \"XXX.dll\" is present on \"MyPathToDll\", "Info", MB_OK);
Is it "good"? Which methode is the apropiated one?
-- modified at 3:09 Tuesday 30th October, 2007
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
If your EXE is linked to the DLL dynamically, then the OS will load the DLL for you when needed. If it can't find it then your application will throw an exception and stop. It will not continue without any error. Mainly because there is code missing.
If you use LoadLibrary to load the DLL and GetProcAddress, then you can code your application such that it can continue without the DLL.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Nelek wrote: MyDll::MyFunction ();
What is this MyDll ?? Is it a class ?
You have two options to load your dll: either implicitely (you link to a static library supplied wioth the dll that contains informations about how to load the dll), or explicitely (you load the dll yourself using LoadLibrary and then using GetProcAddress).
When you load implicitely, if your dll is not present, the program will generate a message box saying that the dll is not present before any of your code is executed, meaning that you have no control at all to 'fix' the problem (the program will exit directly afterwards).
When you load explicitely, the LoadLibrary function will return NULL if the dll was not loaded successfully (if it was not present for example). In that case, you have full control about what you would like to do if the dll is not present. But, beware, with this method you cannot import classes, just functions (of course, you can import functions that return a pointer to a class ).
|
|
|
|
|
Actually, "MyDll" was the name of the dll. I saw it in an example (I don't remember where).
The problem with this is that in this way, (Coding my read / write functions) in two different DLLs as my boss wants, is being a bit confusing to me. All my code is already working in the application but he wants it separated (for security and money). My problem is... "read", should be ALWAYS present (we deliver it with the programm), but "write" will be sold. And both tasks uses code from a third party dll that will be delivered with my programm in demo version (but functional for what is needed).
So I have to code my functions in a dll, and these functions will use a third party dll as well and to know which specifical function has to be called I should read some values from the registry of local computer. I have difficulties to find the best way/solution to do this (I am a bit newbie with DLLs).
So...
1 sure thing: Use LoadLibrary and if not NULL then call my functions, else give my message or do nothing.
The third party is statically linked (I have a *.lib and *.h and there is an error if the files are not present). May I use the methodes of this one inside my dll as I now use them (as part of my classes because of the *.h)?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: Actually, "MyDll" was the name of the dll. I saw it in an example (I don't remember where).
That's the first time I see something like that . They probably declared a class with the same name as the dll.
Anyway, I suggest that you take some time to learn how dll's work. Getting answers on a forum is nice when you want to learn something quite concrete. You learn something so like dlls just by asking questions on a forum. Nothing is better than reading articles in that case. Take a look here[^], there are quite some good articles.
|
|
|
|