|
Hi Friends,
I am struck up with catching verticall scrollbar on ClistControl.
I have dialog box. which contains Listcontrol. but i am trying to catch wm_vscroll event on scrolling vertically. since this message belongs to window. event is not triggedred.
I am new to vc++6.0. Please reply to this post.
I am stuggling on his.
Please send me the reply to purushothambc@orange.co.uk or bcpurshi@rediffmail.com
Your help is appreciated.
Thank in advance
Purushotham
|
|
|
|
|
Hi, gurus:
Does anyone know how to change the screen size layout programmatically?
This is the case:
I am changing the screen resolution programmatically for specific action from 800x600 to 1280x1024. Because the ratios are different for these resolutions the screen layouts are different. In the second case the screen layout compressed from the sides. I need to expand the layout from the sides for the size of monitor.
Any suggestions?
Thanks in advance
|
|
|
|
|
I'm currently writing some basic MFC Apps to make sure I really "know what I'm doing", but I'm having a hard time understanding how to use the debugger for event driven programs.
Could someone suggest a solid tutorial or article that would be helpful?
- Thanks a lot.
|
|
|
|
|
Well.... that's a pretty big subject. I do not know of any tutorials or articles dealing with that.
Any specific information that you need?
Artificial intelligence is no match for natural
stupidity.
|
|
|
|
|
Does any one know of a good starting point for learning more about WMI (Windows Management Instrumentation) ?
Specifically, I have found that this seems to be the perferred way of monitoring signal strength of wireless adapaters on winXP... and I would like to find an introduction WMI. I have found .net examples but I don't like .net .
thanks Tom.
ps.. it all started with this question:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=951615&df=100&tid=951615#xx951615xx
|
|
|
|
|
Check the following link -
WMI[^]
Also I found some good stuff about WMI in "Programming the Microsoft Windows Driver Model" book by Walter Oney few months back.
Hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I was using the picture box control and i loaded a bitmap to it from the resource using the properties dialog box, i wanted to manipulate the image from the code and i wanted to create a member variable so i changed the ID from IDC_STATIC to another and the only member variable for control and value is CString nothing as i Assumed of CBitmap or another.
Well my ? is can i use this control to modify the contents of the bitmap at run time if so how do i do it?
isn't there any class in which my picture box can map in to like HBITMAP,CBitmap or another ?
Thanks
|
|
|
|
|
Hi,;)
Yes, Certainly you can change the bitmap at run time during the MOUSEMOVE or on LBUTTONDOWN. Let's take the example of MOUSEMOVE
void CMouseDlg::OnMouseMove(UINT nFlags, CPoint point)
{
m_Image.GetWindowRect(&rect);
ClientToScreen(&point);
if(rect.PtInRect(point))
{
m_Image.SetBitmap(m_Bitmap1);
}
else
{
m_Image.SetBitmap(m_Bitmap2);
}
CDialog::OnMouseMove(nFlags, point);
}
Here m_Image is the control type variable of Image control created using Class Wizard and rect is CRect object.
// m_Image.GetWindowRect(&rect);
Extract the image control co-ordinates in a rect object.
// ClientToScreen(&point);
ClientToScreen is used to convert the client coordinates of a given point or rectangle on the display to screen coordinates.
Next step is to check whether these points fall under the area where our image is place on the screen using PtInRect. If yes, then change the bitmap to whatever.
m_Bitmap1 and m_Bitmap2 are twom CBitmap type objects defined in the header file.
That's it...you r on ur way to change the bitmaps at runtime
Vikram Kashyap
"You will never fail until you stop trying"
|
|
|
|
|
I have a function which returns a char* and I am trying to avoid a memory leak.
So far it is in this format:
char* MyFunction(char *szBuffer)
{
char *szTmpBuffer = new char[strlen(szBuffer) + 1];
...function body...
return szTmpBuffer;
}
And it is called somewhat like this:
char *szBuffer = MyFunction(szString);
but if after I use szBuffer I try to delete it:
delete [] szBuffer;
I get a Debug Assertion failed...so the question is, what is the proper way to call new within a function then delete the pointer outside of the function w/o causing errors and avoiding memory leaks?
|
|
|
|
|
You code is fine. I tried it and no assertion was fired. What line/file does the assertion message indicate?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The handling of szTmpBuffer you show is OK. Most likely, you're overwriting the allocated space. What does the debug assertion message look like? Something about damaged blocks?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Exactly:
DAMAGE: after normal block (#3604) at (memory address)
|
|
|
|
|
Yep, I was overwriting...thanks for pointing out my stupid mistakes
|
|
|
|
|
I needed some help with resizing the size of the Static box after I have changed the font size. I want to dynamically change the size of the box so that it perfectly fits the text inside it. I wanna do this because I want the box border to fit the text inside.
i've tried :
CDC* pDC = pOrderText->GetDC();
CString text;
pOrderText->GetWindowText(text);
CSize stringSize = pDC->GetTextExtent(text);
pOrderText->SetWindowPos(NULL, 0, 0, stringSize.cx *1.45, stringSize.cy *1.45, SWP_NOMOVE|SWP_NOZORDER|SWP_NOREPOSITION);
buts the conversion is not working well. Need help asap!
A
|
|
|
|
|
Try getting the ratio of the windowsize/textsize before you change the font. Or, maybe you can use DrawText() with a flag of DT_CALCRECT to get the size of the rectangle needed by your control, then use the rect's width and height properties to set the width and height for your call to SetWindowPos()
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
I tried this as well. But it still does not reflect the change in the font when it draws the text. Any other suggestion.?
Right now I am doing the hardcoded windowsize/textsize , but its not perfect in all the scenarios.
ali
|
|
|
|
|
I think I might have misunderstood you. Is the font size not changing at all, or is the font size changing and the window size not changing?
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
the font size is changing but the window size is not changing accordingly.
ali
|
|
|
|
|
|
Hello All,
I'm new to coding in VC++ .NET, but have some experience writing applications in C# .NET.
I'm in the process of writing an app for which most of the code is in C++.
My question is this:
1. Can I use the Designer in my VC++ project (modifying the file Form1.h) to create the GUI?
OR
2. Do I need to follow the method suggested in the following LINK and design the GUI in a C# file and then tie it to the C++ code?
Which approach is preferable?
Thanks!
|
|
|
|
|
Is there a possibility to supress the
Loaded 'xyz.dll', no matching symbolic information found.
debugger output in VC6 (or in general=? I have a lot of deferred loading, and it'x getting in the way of my boostrap traces.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist Fold With Us! || Agile Programming | doxygen
|
|
|
|
|
I've never found a way to suppress this. It's damn annoying!
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Is there a possibility to supress the
Loaded 'xyz.dll', no matching symbolic information found.
debugger output in VC6? I have a lot of deferred loading, and it'x getting in the way of my boostrap traces.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist Fold With Us! || Agile Programming | doxygen
|
|
|
|
|
Hi,
I am currently working on a SDI project with CFormView as the base class. From the menu (IDR_MAINFRAME) the user can open different dialog boxes. In one of the dialog boxes I have a listbox. When the user selects an item from the listbox and click the ok button to confirm the choice and close the dialog box, I need to update a variable (int) in the CFormView derived class and also update the view, like Invalidate() method.
I have not been able to find the ansver on the web. Any code snippet or links would be highly appreciated.
Thanks in advance!
|
|
|
|
|
It's really not that difficult. If I understand what you are trying to do, it's as easy as:
int formview = dialog.listbox.getcursel();
Artificial intelligence is no match for natural
stupidity.
|
|
|
|