|
Overide
WM_NCLBUTTONDOWN()<br />
<br />
void OnNcLButtonDown( UINT nHitTest, CPoint point )<br />
{<br />
if( nHitTest == HTMINBUTTON )<br />
{<br />
AfxMessageBox( "MinButton" );<br />
}<br />
if( nHitTest == HTMAXBUTTON )<br />
{<br />
AfxMessageBox( "MaxButton" );<br />
}<br />
CDialog::OnNcLButtonDown( nHitTest, point );<br />
}
|
|
|
|
|
CWnd::GetTextExtent() or CWnd::GetOutputTextExtent() does not return the correct width of the text in asian languages OS on Windows 2K. The same works as expected on Windows XP.
I have seen this with GetWindowText() also. Does anyone know or seen this issue. What is the reliable way to correct this.
Best Regards, Madhu.
|
|
|
|
|
Did u tried the DrawText() funtion instead of GetTextExtent()?
nave
|
|
|
|
|
Hi,
I would like to know how to navigate from one tab page to another, as stupid as this sounds I'm struggling my butt off
Lets say you have this code:
// Adds the TabControl to the form.
this->Controls->Add( this->tabControl1 );
// Adds the tab pages to the TabControl.
tabControl1->Controls->Add( this->tabPage1 );
tabControl1->Controls->Add( this->tabPage2 );
tabControl1->Controls->Add( this->tabPage3 );
Just to move from tabPage1 to tabPage2, if anyone can help, plz do
Thanx
Programm3r
Regards
Programm3r
|
|
|
|
|
Never mind I got it
Regards
Programm3r
|
|
|
|
|
What is the difference between CoIntializeEx() and CoCreateInstanceEx()?
I am using CoInitializeEx() in my client program. It connected with server when it is in local machine.When the server in Remote machine,i gave me error in CoCreateInstanceEx():Failed to node:Ip address of the remote machine
Anu
|
|
|
|
|
Anu_Bala wrote:difference between CoIntializeEx() and CoCreateInstanceEx()
First of all they aren't similar
CoInitializeEx()
Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.
CoCreateInstanceEx()
Creates an instance of a specific class on a specific machine.
Anu_Bala wrote:gave me
error
What parameter's are you passing to CoCreateInstanceEx()?
|
|
|
|
|
I dont know how to get the clsid in the server code to give in this CoCreateInstanceEx() function.
I gave clsid to register the server in my server code.
Please can u give any sample code of this function.
Anu
|
|
|
|
|
COAUTHIDENTITY authorization;
authorization.User = L"MyUserName";
authorization.UserLength = wcslen(L"MyUserName");
authorization.Domain = L"MyDomain";
authorization.DomainLength = wcslen(L"MyDomain");
authorization.Password = L"UserPassword";
authorization.PasswordLength = wcslen(L"UserPassword");
authorization.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
COAUTHINFO authinfo;
authinfo.dwAuthnSvc = RPC_C_AUTHN_GSS_KERBEROS;
authinfo.dwAuthzSvc = RPC_C_AUTHZ_NONE;
authinfo.pwszServerPrincName = L"PutDomainName\\Machine Name Here";
authinfo.dwAuthnLevel = RPC_C_AUTHN_LEVEL_CONNECT;
authinfo.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE;
authinfo.pAuthIdentityData = &authorization;
authinfo.dwCapabilities = EOAC_NONE;
COSERVERINFO MyServerInfo;
MyServerInfo.dwReserved1 = 0;
MyServerInfo.pwszName = L"RemoteServer";
MyServerInfo.pAuthInfo = &authinfo;
MyServerInfo.dwReserved2 = 0;
MULTI_QI qi;
qi.pIID = &IID_IUnknown;
qi.pItf = NULL;
qi.hr = 0;
HRESULT hr = CoCreateInstanceEx(GUID_NULL, NULL,
CLSCTX_REMOTE_SERVER, &MyServerInfo, 1, &qi);
I hope this will help or provide you with some guidelines.
|
|
|
|
|
Hi, Does anyone know how i can store the address of a particular node ie. "startPointer". This variable will store the address of a node so that that i can call out to the node when i need it in any of my functions. My code will have no problem if I declare the startPointer variable globally. But the problem now is that based on my assignment req, I'm not allowed to declare any variables global other than the specified ones.
struct data
{
double xstart, xend, ystart, yend; //get xstart,xend,ystart,yend values
int child, iter, width, height; //get iteration value
data* next; //pointer to next node
};data* startPointer;
...
...
main(){...
Is there any way that I could get around this?
Thanks
|
|
|
|
|
data* startPointer = new data;
unsigned long v = reinterpret_cast<unsigned long>(startPointer);
|
|
|
|
|
Hi there,
There's a question about DirectSound. I wanna capture sound and play captured sound at the same time with the smallest latency. So I've got two buffers - sound and capture. I created N notification points in capture buffer and I'm trying to copy data from one buffer to another... But these buffers are owned by different devices. As everybody knows, there're not two equal frequency generators... so one buffer's always slower/faster than another. There're a lot of algorithms to manage this problems, they're called Sample Rate Convertors. They remove/add some samples from/to buffer, so difference between capturing and playing sound is getting to zero. But first of all I somehow should detect how many samples algorithm must add/remove... That makes a big problem for me.... How can I do it?
Thanks for suggestions.
Regards,
UVSoft.
|
|
|
|
|
Hi ,
How to rute a call from class Mainframe to InPlaceFrame in an Active Document Server Application ? Or how we can call a function mapped in InPlaceFrame from class MainFrame ?
Thnx in Advance
|
|
|
|
|
Hi ,
How to rute a call from class Mainframe to InPlaceFrame in an Active Document Server Application ?
Thnx in Advance
|
|
|
|
|
Hi all,
How do i make my dialog box stationary, that means in permanent position(not movable by an user)?
Can anyone please help me in this regards?
Thanks.
Regards,
Ram
|
|
|
|
|
You can catch the moved event and move it back. I don't believe you can lock it otherwise.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Do this...
CMenu* pSysMenu = GetSystemMenu(FALSE);
pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
|
|
|
|
|
If the title bar is not needed remove it from ur dialog.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Trap WM_NCHITTEST, and make sure you never return HT_CAPTION, and trap WM_SYSCOMMAND, disallowing SC_MOVE.
Steve S
Developer for hire
|
|
|
|
|
I have an MFC app that we use Microsoft Visual C++ 6.0 to compile.
I need to get information from a secure website into my app using 2 way SSL. I have tried using MFC's CHtmlView to obtain this information, and was successful; however, my users have all different types of web browsers. For example I have a user that has installed their X.509 certificate into Netscape, but not in Internet Explorer.
I need to somehow make a 2 way SSL connection from my app that uses the default web browser's certificate (which is password protected) and then obtain the body text of the webpage.
I was thinking about maybe trying to use ShellExecute and then obtain the windows handle (the first parameter) and somehow capture the body of the webpage. But I have not seen any examples on the web for this.
Ideally, I would like to not display the default browser, but just use the default browsers certificate store to communicate via 2 way SSL. All I need is to obtain one line of text from this secure webpage (generated from a servlet running on weblogic 8.1)
Thank you for any responses.
Stuart
|
|
|
|
|
I am using Visual C++ 6.0 MFC. I have a tab control with dialog resources as tab pages. If I click on OK or CANCEL buttons the CWnd::SendMessage(WM_COMMAND, wParam, lParam) returns a value of 1 and everything is good. If I click on any other button control (whose resource value is stored in wParam) the CWnd::SendMessage(WM_COMMAND, wParam, lParam) returns a value of 0. Does anyone know what's going on inside the SendMessage() function? Why does the function not recognize the control ID?
Thanks
Buck Brown
|
|
|
|
|
Did you see MSDN.
From the MSDN:
"The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message."
Syntax
<br />
LRESULT SendMessage(HWND hWnd,<br />
UINT Msg,<br />
WPARAM wParam,<br />
LPARAM lParam);<br />
|
|
|
|
|
Thanks to everyone at CodeProject for providing a fantastic resource for programmers.
I am using several comboboxes to navigate through a flat file database of my own construction. Three of these comboboxes are almost identical in structure and function.
When I select a record from the drop down list from two of the combo boxes (all are set in dropdown mode with identical checkboxes), the record is displayed, and the statements:
pComboBox1or2->SetFocus;
pComboBox1or2->SetEditSel(0,-1);
pComboBox1or2->Clear();
clears the edit box of comboboxes 1 and 2 exactly as expected.
However, when I use the same exact lines for combo box 3
pComboBox3->SetFocus;
pComboBox3->SetEditSel(0,-1);
pComboBox3->Clear();
in the same exact point in almost identical code for combobox 3, the edit box of the combobox refuses to clear.
Interestingly, calling the combobox3 lines from the combobox 1 or two functions clears the combobox3 edit box - however this is not adequate as I need to clear the edit box after selecting a record.
While trying to figure this problem out, I placed a 500 iteration loop around the statements for combobox1or2, and noted a flashing edit field - which ended with a blank edit field. When I tried the same thing with the troublesome combobox3, the edit field did not flash (although it took about the same amount of time for the process to finish), and the edit box did not clear.
I have tried everyhting I can think of to make the code for the various boxes as similar as possible, and find it very strange that two of the three comboboxes work as expected, while the third does not.
Any suggestions?
Thanks in advance for your assistance.
-- modified at 18:33 Wednesday 26th July, 2006
|
|
|
|
|
your problem is that combox1 and 2 are ok in a same way but combo3 its not same,Right?
|
|
|
|
|
Correct.
All three boxes are almost completely identical in every way - except their behavior. Combo 1 and 2 behave linearly (as expected) every time I try, but combo 3 does not behave linearly much at all, especially with respect to the key behavior of leaving the edit box blank after the record selection is complete.
Completely disabling the edit box, for example painting over it to hide the functinoing edit box underneath might be acceptable. I tried using the Drop List box, as a menas of achieving a secondary goal of preventing user input, but this makes the functioning bozes also fail to clear their edit boxes after record selection.
It is as if combo 3 is not completely switching out of Drop List mode when I change the selector in the resource editor (visual ++ 6.0) except that combo 3 allows changing the edit box text in drop down mode while combo 2 does not allow edit of edit box (in drop list mode).
A good work around would be a means to permanently hide the edit box so it didnot matter if it was not cleared and this would have the added feature of preventing user confusion/text entry in the edit box.
Thanks for your reply.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
|
|
|
|