|
yes, as you can see in .cpp file, I had
#include <windows.h>
#include "resource.h"
|
|
|
|
|
check the Ignore HTML tags in this message (good for code snippets) check box
|
|
|
|
|
sure you include but i cant see header file in previous your thread i saw only #include:) anyway these erros are only a thing a include
|
|
|
|
|
Hello everybody,
I've figured out that windows supplies an smart way to draw cutom elements via DrawFrameControl.
When drawing a radio button or a checkbox the question is where to place the text exactly. Of course it is no problem to figure out the settings for the standard settings (MS Sans Serif 8), but I wonder the windows internal logic for other fonts and sizes. I've used a lot of time to consider all values of GetTextMetrics, but I was not success full.
Has anybody found a rule where the text is placed exactly depending on font and font size?
|
|
|
|
|
now whats your problem?
|
|
|
|
|
Maybe the easisiest ways is to use some code to show my problem on drawing the radio button.
PaintRadioButton(CDC* pDC, const CRect& rcPos, const CFont& font, const CString& strText)<br />
{<br />
DWORD dwBackground = GetSysColor(COLOR_BTNFACE);<br />
CBrush brushBk(dwBackground);<br />
pDC->FillRect(rcRadioButton, &brushBk);<br />
<br />
CRect rcCircle;<br />
CalcCircleRect(rcPos, rcCirlce);<br />
pDC->DrawFrameControl(rcCircle, DFC_BUTTON, DFCS_BUTTONRADIO);<br />
<br />
CalcTextRect(rcPos, rcText, font, strText);<br />
pDC->DrawText(strText, rcText, DT_LEFT|DT_VCENTER|DT_SINGLELINE);<br />
<br />
}
CalcCircleRect(const CRect& rcPos, CRect& rcCirlce) is easy to implement, just center the box vertically and make an offset of 1 in the horicontal position. The size could be received through GetSystemMetrics(SM_CXMENUCHECK);
CalcTextRect(const CRect& rcPos, CRect& rcTextPos, cont CFont& font, const CString& strText) Is the thing what is missing. Do you know some magic formula how to calculate the exact position for the text depending on font, font size and text content so it looks exactly like the radio button controls?
|
|
|
|
|
Hello everyone,
Yahoo is using a technology called sign-in seal to protect password stolen. Check,
[url]http://mail.yahoo.com[/url]
[url]http://help.yahoo.com/l/us/yahoo/edit/privacy/edit-39.html[/url]
Does any one know what it is and whether there are any documents/SDK supporting that feature? I have Googled, but only can find advertisements ...
thanks in advance,
George
|
|
|
|
|
Hi All,
Can someone suggest a good site to study about IOCTL's From start.
I also have another doubt. Are IOCTL's predefined by VC++ or user defined.
I need a clear understanding of this. Plz Someone help me.
Thanks and Regards in Advance
Kenny
|
|
|
|
|
I would suggest Googling for device driver development under Win32.
I also believe that you can define your own IOCTLs in your own driver.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi all,
Can Someone tell me How to set the color for button control, both at design time and runtime?
Thanks and Regards in Advance
Kenny
|
|
|
|
|
Derive a class from CButon
Class ButonEx: public CButton
{
------
------
}
override the DrawItem(....)
void ButonEx::DrawItem( LPDRAWITEMSTRUCT lpDIS_i )
{
CDC DCItem;
DCItem.Attach( lpDIS_i->hDC );
// Use this DCItem to select different objects ...also set text color and all
}
Rinu Raj
|
|
|
|
|
After derived CButton insert WM_DRAWITEM and see snippet code(you can see a lot of examples about CButton on codeproject)
<br />
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
CDC dc;<br />
dc.Attach(lpDrawItemStruct->hDC);<br />
<br />
UINT state = lpDrawItemStruct->itemState; <br />
<br />
dc->FillRect(lpDrawItemStruct->rcItem<br />
,&CBrush(RGB(255,255,255)));<br />
dc->SetTextColor(RGB(0,0,0));<br />
<br />
CString str;<br />
GetWindowText(str);<br />
dc->DrawText(str,rect,DT_CENTER|DT_SINGLELINE);<br />
...<br />
...<br />
}<br />
|
|
|
|
|
Gday everyone,
I'd like to display recent received messages in the buffer 'msg_cat' when user types in 'display', but it always displays 'No recent messages' after I concatenated messages into 'msg_cat'. I use global buffer 'msg_cat'. Is there something wrong of the way I use 'msg_cat'? Or the affect of using fork function in main?
I spent so much time on time, but I really don't know how to fix this problem.
It really depends on you guys experts here. Please help me out if you're interested in this.
I'd appreciate it.
char msg_cat[1000];
void displayMulticastedMessage(int condition){
char *msg;
int stop = -1;
if (condition == 2){
if (strcmp(msg_cat, "") != 0){
printf("msg_cat: %s", msg_cat);
strcpy(msg_cat, "");
}
else{
printf("No recent messages\n");
}
}
while(stop < 0){
msg = (char *)recvfromDST (&read_EP, sockMulti);
strcat(msg_cat, msg);
strcat(msg_cat, "\n");
if (msg != NULL){
printf("----- Waiting for Multicasted message ----- \n");
printf("\nReceived multicast message ==> %s \n", msg);
}
else{
stop = 0;
}
}
}
void receiveUserMessage(int sock){
int stop = -1;
char *msg;
while (stop < 0){
printf("Type message or 'display' to display recent multicasted messages or 'end' to quit \n");
scanf ("%s", KB_buff);
if (strncmp(KB_buff, "display", 7) == 0){
int display = 2;
displayMulticastedMessage(display);
}
else{
int stop = sentMessage(KB_buff,sock);
}
printf("\n");
}
}
int main(){
if (pid == 0)
{
receiveUserMessage(MC_socket);
}
else
{
if (pid < 0)
{
perror("fork");
exit(1);
}
else
{
int user = -1;
displayMulticastedMessage(user);
}
}
}
eric
|
|
|
|
|
Hi,
I am recording a .wav file using the headphones.The file gets saved but i get a noise(clicking sound) which is consistent along the the recorded voice.The noise(Clicking sound) starts when the recorded file is open and remains until the file is fully read.
Can any1 tell me how to go about in removing this noise(clicking sound) from the .wav file which is created.
I am coding using C in the VC++ environment.
Thanks...
Riz
|
|
|
|
|
There is no need to repost. If you didn't get an answer the first time, then it is doubtful that anybody here is able to help you. Perhaps you could try searching google for an audio forum where the members would have more knowledge about your topic.
|
|
|
|
|
It could be that your buffer size for recording is not completely filled before you save (example - you allocate 1024 samples per buffer, you capture 1023 samples in each buffer, but you save 1024 samples per buffer into the file), or there is a gap between recorded buffers (example - your sampling rate is 22 kHz, your buffers each have 1000 samples, but you only capture 20 buffers per second.)
Have a look at the wav file you have saved using a wave editor (something which can show you the actual samples in the wav file) and see if the value regularly drops to zero, or if it regularly jumps. Usually these jumps will occur at the rate determined by your buffer length.
Alternatively, it could be caused by your sound card drivers. I had significant problems with audio capture using the default WinXP drivers (some onboard VIA sound I think - I don't remember details) - update your audio drivers and try again.
|
|
|
|
|
how can I add one date with a number of days to have another date.
For example: 09/18/2006 + 30 days
|
|
|
|
|
use CTime and CTimeSpan
nave
|
|
|
|
|
|
how can i speed my database and fill in my CListCTtrl ?
because i need all the data in my CListCtrl i can t use a virtual list ok !
it is simple i need all the data in my Clistctrl at once !
for now i fill 60 000 records in my CListCtrl in 1 min. and i need more speed because i want to fill more data and i will have more time to load and i don t want this i need more speed !
- for my database
- for my CListCtrl
Database = VisualFoxPro 6.0 .
for now this is my code :
void CNcontabile::FillList()
{
CDatabase_Plan* pPlan = new CDatabase_Plan();
if (!pPlan->Open())
return;
if (pPlan->IsOpen())
{
pPlan->SetRowsetSize(25);
while (!pPlan->IsEOF() )
{
int nRowsFetched = pPlan->GetRowsFetched();
m_list.InsertItem(nRowsFetched, pPlan->m_name);
m_list.SetItemText(nRowsFetched, 1, pPlan->m_city);
pPlan->Move(SQL_FETCH_NEXT);
pPlan->MoveNext();
}
}
//m_list.UnlockWindowUpdate();
m_list.Invalidate();
m_list.UpdateWindow();
pPlan->Close();
delete pPlan;
}
if you have an ideea on how can i get more speed please tell me !
i will wait your answer !
Thank you !
Bravoone
|
|
|
|
|
Hi Flaviu_2006,
You have 60,000 records in your database but i dont think you need to all records at a time you said you cant use of virtual list so i think its a good idea you show each 250 or 500 records at each the moment and also i search and i see you can see a lot of explains on the internet for speed up your database did you seach about it
|
|
|
|
|
how can i speed my database ? i have search for 1 week and i find ->nothing !
Bravoone
|
|
|
|
|
I guess you have a lot of ideas you must try to test theirs,did you try it?
|
|
|
|
|
Flaviu_2006 wrote: because i need all the data in my CListCtrl...
Why? I don't recall ever having the need to operate on such information en masse.
Flaviu_2006 wrote: ...i can t use a virtual list ok !
Why? Do you simply not know how, or do you know for certain that it cannot be used?
Flaviu_2006 wrote: if you have an ideea on how can i get more speed...
Where's the bottleneck currently?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I have a dialog box application (VS2005) that use ActiveX Microsoft Control 6.0 (SP6) Control. On my computer it work well, but when I want start this application on a other computer it happend nothing.
I am sur that it come from this active X because I have try to delete the activeX from my project then the application start also on the other computer. I have try to use static Dll configuration but with the same result.
What can I do to fix this problem ?
Thank you !
AutreChien
|
|
|
|