|
Hi,
How can I create the controls CComboBox and CIpAddressCtrl without edges.
Removes a WS_BORDER style has not effect.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Have you tried removing the WS_EX_CLIENTEDGE extended style. You may have to call RedrawWindow with the RDW_FRAME flag to force the change.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you for quickly answer.
I tried create two classes FlatIpAddressCtrl and FlatComboBox .
In the PreCreateWindow method add next line
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
But I still see a edge.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Are you using these controls on a dialog, property sheet, or form view. If so, then apply the change in the PreSubclassWindow() function. If you put a breakpoint in PreCreateWindow() you will find the function is not called.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I tried add to the PreSubcalssWindow method
ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
But it has not effect too
Best regards,
Eugene Pustovoyt
|
|
|
|
|
ModifyStyleEx(WS_EX_CLIENTEDGE, 0, SWP_FRAMECHANGED) or else look in the combobox section here on CP, someone must have written a flat combobox at one time????
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi..
I have this code:
<br />
CMemoryState msOld, msNew, msDif;<br />
msOld.Checkpoint();<br />
<br />
for(int n=0;n<100;n++)<br />
pRoot->Add(10.0,false);<br />
<br />
delete pRoot;<br />
<br />
msOld.DumpAllObjectsSince();<br />
msNew.Checkpoint();<br />
msDif.Difference( msOld, msNew );<br />
msDif.DumpStatistics();<br />
the resulting memory dump:
1980 bytes in 99 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 1732 bytes.
Total allocations: 2000 bytes.
after i made some change to the destructore of pRoot and re-compile i get :
0 bytes in 0 Free Blocks.
-20 bytes in -1 Normal Blocks.
0 bytes in 0 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 1732 bytes.
Total allocations: 2000 bytes.
I don't exactly understand this!!
1st Q : I think I had a memory leak in the first time .. but did I solve it ?
2nd Q : Can you kindly explain what does this memory dump say ?
|
|
|
|
|
FROM SEARCH OF MSDN:
Foundation Class Debug Library Detects Memory Leaks
ID: Q99022
The negative numbers indicate that memory is allocated before the Checkpoint() call...
-----------------------------------------------
CMemoryState::Difference
BOOL Difference(...)
Return Value : Nonzero if the two memory states are different; otherwise 0.
-----------------------------------------------
Visual C++/MFC Frequently Asked Questions
Scot Wingo
Stingray Software
How do I use CMemoryState?
....
It looks like you solved it, but you may want to read the above and possibly read the articles on memory leak detection at codeproject.
I use Bounds Checker for all my validation and compliance testing. Most of the companies, that offer memory checking software, offer a fully functional time limited demo, so that you can shop and compare.
INTP
|
|
|
|
|
Hi Guys , I'm building a class that will help me reduce the code I need to write to get an OGL window up and running , But I've some issue , when I start filling up the Window Class structure , I come to the WNDPROC ,I want to pass the address of a method <member function=""> in the main class , but I get an (error C2440: '=' : cannot convert from 'long (__stdcall OGLWindow::*)(struct HWND__ *,unsigned int,unsigned int,long)' to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)) ,I wonder if there's some way I can estblish this kind of converstion , or else I'll just have to write the WndProc function seperate from the class , I hope I'm making sense here , thanks in advance for any help
|
|
|
|
|
You can't put it in a class.
All non-static class functions have a hidden "this" argument, so the function signature won't match with the WNDPROC one.
|
|
|
|
|
See the article:
Use member functions for C-style callbacks and threads - a general solution
INTP
|
|
|
|
|
Hi, I'm writing an mp3 player using DirectShow. I want my player to be able to load some sort of playlist.
To do this, I need a way to specify a search directory, like for instance
c:\mp3\
the mp3 dir would serve like a root directory, storing every mp3 file i got in albume directories.
like for instance:
c:\mp3\albume1
c:\mp3\albume2
c:\mp3\albume3
my application needs to search for directories in the mp3 directory and make a list like the one above.
But I don't know what functions could be used to make this serach possible.
Also, I need a way to search every albume directory for mp3 files.
Could anyone guide me to which functions might do what I need?
thanks alot!!
|
|
|
|
|
FindFirstFile/FindNextFile
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hello,
You should use the CFileFind class to do the searching! Use the FindFile() method to start the search and use FindNextFile to retreive data.
exemple:
CFileFind ff;
CList<CString, CString&> dirlist;
dirlist.AddTail(_T("YourMp3Directory"));
do
{
if(ff.FindFile(dirlist.RemoveTail()))
{
while(ff.FindNextFile())
{
if(ff.IsDirectory())
{
if(!ff.IsDots())
dirlist.AddTail(ff.GetFilePath());
}
else
{
}
}
}
}while(dirlist.GetCount() > 0);
hope this helps
|
|
|
|
|
could anyone help me about this ?
for example : my program needs to get the MS WORD's horizontal scrollbar handle and control it.my program needs to scroll the document view on its own in this case.
i had tried these functions include : GetScrollInfo / GetScrollBarInfo / PostMessage but can't get the correct handle.....
tks for ur help !!
have a nice day !!
yoyo
|
|
|
|
|
There are three issues here:
Issue #1: How to get the scrollbar HWND
Using a tool like HPS HwndSpy, you can examine the hierarchy of windows that Word uses. In the case of Word 2000 (Office XP), if you open Word with an empty document, you will see this hierarchy:
"Document1 - Microsoft Word" class OpusApp
"" class _WwF
"Document1" class _WwB
"" class ScrollBar
"" class ScrollBar
(The window titles are in quotes, followed by the window class name).
As you can see, there are two scrollbars, one vertical and one horizontal. It seems like the horizontal scrollbar is always second. So, to find the HWND of the horizontal scrollbar programmatically, simply traverse the window hierarchy for Word, until you come to class _WwB, and then grab the second ScrollBar.
Issue #2: It may not work like you expect
Some programs react violently when you try to send them messages. It may work, or it may not work, or it may cause Word to crash. So before you invest a lot of effort into this, you should first verify that it will work as you expect.
Issue #3: Different versions may be - well, different
You should verify that this technique will work on all the versions of Word that you are interested in. Different versions may have different window hierarchies, and may also react differently when you try to control the scrollbar.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
hello,HPSI, tks for ur answer.
i use while loop with "GetWindow(hChild, GW_CHILD)" and ""GetWindow(hChild_1, GW_HWNDNEXT)" to grap the handle but how can i make MS Word's horizontal scrollbar functional ?
should i use PostMessage or SendMessage ? which handle to input ? parent window's handel (form "OpusApp") ? or parent window's child window's handle (_WwB or _WwG or _WwC) ? or the scrollbar's handle ??
tks for ur help !!
have a nice day !!
yoyo
|
|
|
|
|
hey i wanna know which is the best source online to learn vc++.i'm very interested in c++ and now want to extend my skills.can anyone suggest a good free website or link or a good book?
thanx in advance.....
#include"universe.h"
int main()
{
char *galaxy;
while(1)
{
cout<
|
|
|
|
|
|
hey hillmann thanx for your link.but i asked for vc++.you gave a c++ link.so try to give me a good visual c++ one.
and thanx for your complement on that program......
|
|
|
|
|
You need to learn C++ before you can use VC++
|
|
|
|
|
ah, the way you phrased this: "i'm very interested in c++ and now want to extend my skills" made it sound like you wanted to know C++ too.
|
|
|
|
|
How do I delete the history in a ChtmlView? Also, how do I found out what drives are active (i.e. A:, D:, …)? I need to make a program that have an icon representing the drives and the user is able to open the drives.
Thank you
|
|
|
|
|
pdunn wrote:
Also, how do I found out what drives are active (i.e. A:, D:, …)?
_getdrives();
pdunn wrote:
I need to make a program that have an icon representing the drives and the user is able to open the drives.
Maybe you should use the DriveListBox control
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Does anyone know how to write a program to burn a DVD, using some API or COM interface?
Also, on a related note, where can I find information on the format of the .VOB and .IFO files that make up a DVD?
Sorry if I am just missing something obvious. I have been known to do that some times.
|
|
|
|