|
hi whanks for the reply,
since i'm new to vc++, can u tell me the syntax of setFont()
|
|
|
|
|
Click on the "?" button in your VC++ toolbar, go to the "index" tab in the help and write CListBox, then choose class members, look for SetFont () and click on it. You will have the info there
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
It was for SetFont and for CreateFont!
|
|
|
|
|
you are a very bad guy ;P
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Are you also new (or allergic) to documentation (MSDN,...)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Are you also new (or allergic) to documentation (MSDN,...)?
Online help or local help?
|
|
|
|
|
|
Deepu Antony wrote: can u tell me the syntax of setFont()
Haven't u heared of MSDN?
Create a CFont object as member variable of the class. say m_font.
After that..
m_font.CreatePointFont( 200, "Arial" );<br />
m_ListBox..SetFont( &m_font, TRUE );
|
|
|
|
|
See CFontListBox[^] of course I didnt see it uses of SetFont for listbox or no but I think if you are new to vc++ its helpful for you.
|
|
|
|
|
Deepu Antony wrote: ...can u tell me the syntax of setFont()
If you are using MFC, see here. Otherwise, see 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
|
|
|
|
|
Hi! Everyone!
Now I'm developing an application which will play a .wmv file. I do it using mciSendCommand. But a mistake will happen sometimes. The description of it is: "the alias had been used by other program, plz use the unique alias."
This mistake can't happen everytime. The application was executed only once. So it isn't make by two program executing at same time. I hope someone can tell me the reason and how to resolve it. Thx!
The code is as below:
<br />
MCI_DGV_OPEN_PARMS mciOpen;<br />
MCI_DGV_STATUS_PARMS mciStatus;<br />
UINT uDeviceID;<br />
HWND hwndVideo;<br />
RECT video_rect;<br />
ZeroMemory(&mciOpen,sizeof(MCI_DGV_OPEN_PARMS));<br />
mciStatus.dwItem=MCI_DGV_STATUS_HWND;<br />
mciOpen.lpstrAlias=_T("thevideo");<br />
mciOpen.lpstrElementName=(LPWSTR)m_szVideoName.GetString();<br />
mciOpen.hWndParent=this->m_hWnd;<br />
mciOpen.dwCallback=(DWORD)this->m_hWnd;<br />
mciOpen.dwStyle=WS_CHILD;<br />
DWORD ret = mciSendCommand(0,MCI_OPEN,MCI_OPEN_ALIAS|MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS,(DWORD)&mciOpen);<br />
if(ret != 0)<br />
{<br />
CString dbg_str;<br />
wchar_t str[100];<br />
CMajoyComLog::WriteDefaultLog(L"Can't open this file:"+m_szVideoName);<br />
mciGetErrorString(ret,str,100);<br />
dbg_str.Format(_T("Error occured:%s"),str);<br />
CMajoyComLog::WriteDefaultLog(dbg_str);<br />
MessageBox(m_szVideoName + _T("Can not open Media File"));<br />
return 0;<br />
}<br />
else<br />
{<br />
uDeviceID=mciOpen.wDeviceID;<br />
mciSendCommand(uDeviceID,MCI_STATUS,MCI_STATUS_ITEM,(DWORD)&mciStatus);<br />
hwndVideo=(HWND)mciStatus.dwReturn;<br />
::GetClientRect(hwndVideo,&video_rect);<br />
ShowWindow(SW_SHOW);<br />
UpdateWindow();<br />
}<br />
mciSendString(_T("play thevideo"), 0, 0, 0);<br />
GetParent()->PostMessageW(WM_VIDEO_START);<br />
SetTimer(1,1000,NULL);<br />
<br />
m_szVideoName.ReleaseBuffer();<br />
|
|
|
|
|
Hello All,
i worked on a application which is SDI using mfc with VS 2005.
when i start this application it takes arround 20.5MB memory.
if i minimize it once than it shows only 1.7MB memory which is actual.
so please tell me what have to do so without minimze the application it should take only 1.7 MB memory.
please share your knowledge with me.
thanks
Bankey
|
|
|
|
|
Minimizing does not normally reduce memory footprint substantially so your program must be responding to being minimized by running some special function.
You need to look for what happens on minimize to find where the extra memory is used and if it's all needed. Also make sure your memory usage figures take into account all types of memory, ordinary ram heap, virtual memory, non-paged pool.
Memory usage is application specific so I can't advise you any further without a detailed understanding of what your app is doing.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
bankey1010 wrote: so please tell me what have to do so without minimze the application it should take only 1.7 MB memory.
This will make a good read: http://support.microsoft.com/kb/293215[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
|
Hello,
Can any body suggest the Performance Profiler For Visual C ++ 6.0 . Is there any Open source Performance Profiler Available ?
|
|
|
|
|
You could try and pick up and old version of NuMega Dev Partner C++, probably some on Ebay. I seem to remember that had profiling that worked OK. It needed huge amounts of RAM at the time though, perhaps even 512MB for descent performance
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
If you can afford it, use VTune from Intel. It works fantastically well.
We use it for performance analysis and to locate perforance bottlenecks.
You don't have to build your program particularly differently for it to work, either.
|
|
|
|
|
hi,
i have a viewer program that will only turn pages when it's in focus.
i've created a capture program to capture the output from this viewer program.
the capture program will be the top most window.
To capture pages from the viewer, I need to capture the viewer's window
and copy the content over to the capture program.
How can i signal to the viewer program that it has focus (so that it turn the pages and
the capture program can capture the new page)?
I was thinking of using FindWindow to find handle to the viewer program.
The I'll use BitBlt to copy the bitmap from the viewer to the capture program.
But, to turn the page, I need to let the viewer know that it's in focus.
thank you.
br,
calvin
|
|
|
|
|
you can handle WM_ACTIVATE message. WPARAM of WM_ACTIVATE message specifies you whether the window is activated or deactivated.
- Malli...!
|
|
|
|
|
hi i am doing c programming
i am trying to do struct pointer but i cant seems to get it to work:
struct person<br />
{<br />
int a;<br />
}<br />
<br />
int main()<br />
{<br />
struct person* start;<br />
<br />
start = malloc(sizeof(struct person));
func(start);<br />
<br />
<br />
return 0;<br />
}<br />
<br />
void func(struct person* inc)<br />
{<br />
struct person* newnode;<br />
newnode = malloc(sizeof(struct person));
inc = newnode;<br />
}<br />
|
|
|
|
|
Pointers, as other argument types, are passed by value.
BTW you're code is messy, What are you trying to do?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
sry about the messy code.
basically i am trying to do link list.
-i create a pointer to be the head_node in my main
-i pass by pointer the address of the head_node to the function
-in the function i create a new_node
-then i TRYED to set the new node address to the head_node via the passed in pointer
however it cant seems to work..
so does anyone got any idea how to pass in by reference???? thx
|
|
|
|
|
If you have to implement a linked list, then your structure must have pointer member at least(to address the next element or the end of the list).
Here you can find some info [^], there are a lot of good articles about here at CP (see, for instance The Basics of Linked Lists and Binary Trees).
I suggest some background about pointers too (have a look to a good C programming book).
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
neodeaths wrote: inc = newnode;
This should probably be:
inc->a = newnode->a;
"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
|
|
|
|