|
I am using the listview control from mscomctl.ocx in an MFC dialog.
When I right click on an item in the control, I find that the parent window(the dialog box)receives TWO WM_CONTEXTMENU messages, instead of one. When I click on an empty are of the control where there is no item yet, only one WM_CONTEXT message is generated.
What is the reason for this? Anyway to fix this?
thanks
Man Learns from History that he never learns from History
|
|
|
|
|
How to put more than one Toolbar in a single document MFC application?
How active it? http://paginas.terra.com.br/informatica/souza.bruno/toolbar.jpg
Thanks.
sdfs
|
|
|
|
|
Try to search for
CFrameWnd::DockControlBar( CControlBar * pBar, UINT nDockBarID = 0, LPCRECT lpRect = NULL );
usage.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
hi:
my application have five module,and i switch them with dialog like propertysheet.there is a setup modul that set system parameter.now,i want to know whether the data in setup-module dialog have been modified when i switch to another module automaticly(because i want to ask user whether to save the modification when data are modified,or else not).I dont want to set duty-mark for every control and only check whether the dialog-data have been modified(if i can).could u give me some suggestion.
thank u!
best regards!
Paul
|
|
|
|
|
The article at http://www.codeproject.com/cpp/checksum.asp[^] gives a decent overview of using checksums to see if a dialog (property page) has been modified. I use a modified version of it in one of my apps. I use a CRC32 checksum instead of the one provided in the article.
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 need to use some CEdit member functions on an edit box. but how do i access these? i guess i need a pointer to the edit box control, but how do i obtain it? i tried CWnd::GetDlgItem() but it returns a pointer to a CWnd object so i can't access CEdit member functions such as LineScroll(). i would appreciate ANY help.
|
|
|
|
|
If the control ID you pass to CWnd::GetDlgItem() references an edit control, then you can just cast the return value to a pointer to a CEdit . This works with any other type of control also.
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"
|
|
|
|
|
Thanks man. Never thought of that.
|
|
|
|
|
|
cadejohx wrote:
i guess i need a pointer to the edit box control, but how do i obtain it? i tried CWnd::GetDlgItem() but it returns a pointer to a CWnd object...
Save yourself some aggravation and use a CEdit member variable instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I want to change the default font in the dialog,for example:Arail.what should I do?
|
|
|
|
|
You can change it in your dialog resource properties.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
i see some program when login dialog end and follow a image that is fit for the application program content coming out for a while,but i dont know how to realize it,please give me some instruction ?thx all
|
|
|
|
|
I think what you are looking for is a splash screen. Try searching splash screen in codeproject. It is by the way not difficult to write your own.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
in my dialog there is a net address i want to realize hyperlinker when clicking it,if i dont write class specially for it,is there a more simpler way to solve it?
|
|
|
|
|
|
such as :extern CDatabase db;
CString sql1,sql2;
....
sql1=" ....";
db.ExecuteSQL(sql);
.....
sql2="...";
db.ExecuteSQL(sql);
....
|
|
|
|
|
You can call as many ExecuteSQL statements as you like given that the sql is a valid sql statement.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hello All, I have client and server programs. They used NamedPipe to communicate.
Here little bit about what each program does.
Server:
- has 2 buttons, print and stop
- Once the print button get pressed, create the thread and call the thread function.
here the thread function,
<br />
UINT PrintingThreadFunction(LPVOID lParam)<br />
{ <br />
CServerDlg *s = ((CServerDlg *)lParam);<br />
s->m_smain.OpenNewPipe(); <br />
while(!stopprinting)<br />
{ <br />
s->m_smain.ClientPrinting();
if(stopprinting == (int)YES)<br />
{<br />
s->m_smain.CloseThePipe(); <br />
break;<br />
}<br />
} <br />
stopprinting = (int)NO;
return (0);<br />
}<br />
The ClientPrinting() calls ConnectNamedPipe() which waits for the client to connect and then once the client connect to the pipe, it returns.
Client:
Client gets the file name from database and print it out. Then send the file name to Server using the same pipe.
Server has no problem Client's getting connected and sending a printed file name for 9 times. But at 10th time, Server get error message at ConnectNamePipe() which is
Unhandled exception at 0x0043e4cb in Server.exe: 0xC0000005: Access violation reading location 0x000000e4.
How can I eliminate this error?
I am thinking of using PostMessage(). But how the program also listen to the user click on Stop button?
Is stopping what the programs is doing for 10 seconds so the user can click on the quit button will help?
Thank you
|
|
|
|
|
I am thinking of using PostMessage(). But how the program also listen to the user click on Stop button?
Not sure of what the "stopprinting" is but would suggest to use event instead like this
<br />
if(WaitForSingleObject(<br />
yourStopEventHandle,<br />
INFINITE<br />
)== WAIT_OBJECT_0)<br />
{<br />
}<br />
check the event tutorial avail.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Having trouble getting this to work.
Need to control backlight level of LCD display.
Followed instructions for IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS and not getting any errors, but not getting any 'levels' back either.
Has anyone else tried using this API yet?
|
|
|
|
|
Hi !
I have to variables of type long. now i need to exponent the first with the second and then modulus a third long. how can i realize this ???
please Help
MFG
RedDragon2k
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
long value = pow(long1, long2) % long3;
you need to include <math.h>
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thx. But when i compile it i get the following error :
'%': Illegal, left operand has type 'double'
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
MSDN says: The modulus operator (%) has a stricter requirement in that its operands must be of integral type.
just cast the pow() function to a (long)
modified 12-Sep-18 21:01pm.
|
|
|
|