|
I have been using MSComm for a while now, and I don't use the .SetPortOpen(FALSE), just let the destructor close it when the application exits. This works fine when I exit the app then sue Hyperterminal etc..
Elaine
The tigress is here
|
|
|
|
|
i recomment not to use mscomm32.ocx,it sometimes does not work well in windows 2k and windows xp,you can use class CSerialPort that can be download from internet
|
|
|
|
|
Hi all,
Is there any way to enum all DCs in a domain, using ADSI or DS API on a win2000 box ???I have already done this sometime ago using NetServerEnum (NETAPI).
- I´ve found DsGetDcOpen/DsGetDcNext but they require Windows XP or later...
- I´ve tried the "Role Property" for IADSComputer Class, but the WinNT and LDAP providers doesn´t suport it...
Thanks in advance
|
|
|
|
|
Question:
Is it possible to hide and to inactivate a button on a dialogbox if a certain condition has occured?
|
|
|
|
|
ShowWindow(SW_HIDE)
EnableWindow(FALSE)
|
|
|
|
|
get access to the button (or other control) inside the dialog (this is the this in the code !)
if its allready exists as a member var, everythings fine ...
myBnt.EnableWindow( FALSE );
myBnt.ShowWindow( SW_HIDE );
if not get its CWnd-Pointer via the controls resource id :
CWnd* pBnt = this->GetDlgItem( IDC_BUTTON1 );
if(pBnt != NULL) pBnt->EnableWindow( FALSE );
if(pBnt != NULL) pBnt->ShowWindow( SW_HIDE );
|
|
|
|
|
Thanks a lot!
Meanwhile I found that it also seems to work with:
myB.ShowWindow(SW_HIDE); and
myB.ShowWindow(SW_SHOWNORMAL);
Is there a difference between myB.ShowWindow(SW_SHOWNORMAL); and
myB.EnableWindow( FALSE );
Another question:
In my application I do not have any 'OK' or 'Cancel' buttons. But if I press the enter button on my keybord the application terminates... and I don't know why.
|
|
|
|
|
Vassili wrote:
Is there a difference between myB.ShowWindow(SW_SHOWNORMAL); and
myB.EnableWindow( FALSE );
Yes.
Vassili wrote:
In my application I do not have any 'OK' or 'Cancel' buttons. But if I press the enter button on my keybord the application terminates... and I don't know why.
Even though you don't have an OnOK() or OnCancel() handler, the defaults are still being called. They, in turn, call EndDialog().
|
|
|
|
|
Vassili wrote:
Is there a difference between myB.ShowWindow(SW_SHOWNORMAL); and
myB.EnableWindow( FALSE );
Yes. ShowWindow will only hide the button, but it will still be there and active, the only thing is you can'T see it. If for some reason, it gets displayed again (Some lost message ..) the user can use it.
EnableWindow really disables the button functionnality.
If you use these functions on a "usual" button (CButton), ShowWindow(SW_HIDE) will make it disappear whereas EnableWindow(False) will make it unclickable and will grey its caption. I think this make clearer the difference between hiding a control and disabling it.
Vassili wrote:
n my application I do not have any 'OK' or 'Cancel' buttons. But if I press the enter button on my keybord the application terminates... and I don't know why.
From Mike Dunn's FAQ : http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_dlgclosekeys[^]
~RaGE();
|
|
|
|
|
the other question ... the ok and cancel button which are not there but working via keystrokes ...
If you want to do nothing in your dialog, just override the default handlers of these keys :
class CMyDialog::CDialog
{
.
.
virtual void OnOK( ) { /* do nothing*/ };
virtual void OnCancel( ) { /* do nothing*/ };
}
for details look at the msdn descriptions of these cdialog members, for example OnOk :
CDialog::OnOK
virtual void OnOK( );
Remarks
Called when the user clicks the OK button (the button with an ID of IDOK).
Override this member function to perform the OK button action. If the dialog box includes automatic data validation and exchange, the default implementation of this member function validates the dialog-box data and updates the appropriate variables in your application.
If you implement the OK button in a modeless dialog box, you must override the OnOK member function and call DestroyWindow from within it. Don’t call the base-class member function, because it calls EndDialog, which makes the dialog box invisible but does not destroy it.
|
|
|
|
|
Hello,
In a MFC program,I want to change windows themes.I have tried to call ShellExcute() to install a theme, but it does not work automatically.The display window appeared,I need to press "apply" button to finish the install process. In StyleXP,a product of TGT soft,the display window did not appear when install a theme. Anyone who knows the anwser is warmly wellcomed to reply.
Thanks
Jia Wei
|
|
|
|
|
I am using CTreeView with LPSTR_TEXTCALLBACK for all my item texts...
In OnGetdispinfo, I either write
a) When I have a safe LPCTSTR
pTVDispInfo->item.pszText = (LPTSTR)(LPCTSTR) pMyObject->GetName();
b) Or if need to build a string dynamically, I write something like this
m_strItem = pMyObject->BuildString();
pTVDispInfo->item.pszText = (LPTSTR)(LPCTSTR) m_strItem;
where m_strItem is a CString member of my CTreeView
It works perfectly but not in Unicode... for some of the child items instead of having my "BuiltString", I get 9999999...
Any idea?
|
|
|
|
|
Please do not ask why but
<br />
m_strItem = (LPCTSTR) pMyObject->BuildString();<br />
did the trick...
pMyObject->BuildString() returned a CString... I wish somebody could enlighten me there!
|
|
|
|
|
Anyone know how to draw a rectangle box onto a video source?
|
|
|
|
|
Can you explain in more detail ?
Is this a captured image, real time capture etc. DirectShow is MSs DirectX video SDK, maybe there is information in there ?
Elaine
The tigress is here
|
|
|
|
|
I think the video source is from DirectShow.. using AmCap.... is there a filter function i can use to overlay my rectangle box onto it?
thanks
|
|
|
|
|
I haven't used filters myself (just getting into DirectShow) but probably best to make a descendant of the existing filer and add the rectangle before the data is passed on.
Elaione
The tigress is here
|
|
|
|
|
Hi, i am dealing witha code that uses OLE-Automation to communicate between two different applications.I have added some code to client and it bagan throwing exceptions at server while calling InvokeHelper() for one of interface functions..I have no clue why it throws the exception.I WANT TO DEBUG THROUGH THE SERVER TO UNDERSTAND WHERE THE PROBLEM IS.CAN ANYBODY HELP ME REGARDING THIS.
THANKS AND REGARDS.
|
|
|
|
|
|
There is not enough information, so I will have to guess.
You have exe client that uses outproc(exe) COM server.
Both client and server have to be build with detailed PDB files.
PDB files should be located in the same directory as exe.
1. Start your client in the debug mode
2. Start second instance of VC.
a. In VC6 use menu Build->Start Debug->Attach to Process
aa. In VC7 use menu Tools->Debug Processes
b. find your COM server process in the list click OK.
c. open your source code and set breakpoints
|
|
|
|
|
Hi Alex,
Thanks for help.
I tried as you have told,Run the client in debug mode than run the server.and then went to vc++ build ->Start Debug ->Attach to process.But i didn't see any processes listed their.I don't know what is wrong?
Please help.
|
|
|
|
|
Hello,
I've a workspace with several projects and I switch between them quite a bit since some of the projects are test cases for the main project. I was wondering if anybody knows if there is an Add-In available which docks a Combobox on a toolbar allowing the user to Set the Active Project Configuration. I'd find it very useful.
Otherwise I'd have a go at writing it myself, although it would be my first add-in. I'm aware that there is a CP article on a library which provides a better interface to the VC6 object model than that which MS provides and I might need it for enumerating the projects in the Workspace. I think the combo box in a toolbar might be the scary part.
Thanks,
John
|
|
|
|
|
Hello again,
I've just realised that I can customise Visual Studio 6 to add the Select Project Configuration combo to a toolbar by dragging the combo which appears in Tools-Customize-Commands-Build.
But I'd still like to select amongst all the projects in the workspace.
Cheers,
John
|
|
|
|
|
Enable "Buid" toobar. It has "Set Active Project" and "Set Active Configuration". You can drag them to other toolbar, if you need it.
Pavel
Sonork 100.15206
|
|
|
|
|