|
SelectClipRgn(..) didn't help........
|
|
|
|
|
After Setting Owner Draw Style, You have to use [CButton::DrawItem]to draw button.
Or take a look at button wrapper classes here at CP
[Link]
http://www.codeproject.com/buttonctrl/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I don't want to owner draw the button. I just need to change the shape of it. Any other solution?
|
|
|
|
|
I Belive I have to make one for you. Wait for hour,I will send you demo application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Behzad Ebrahimi wrote:
Do NOT conflit refrence and value!
In MSDN --> void GetClientRect( LPRECT lpRect ) const;
So use m_SearchBtn->GetClientRect(&the_rect);
HRGN region_handle = CreateEllipticRgnIndirect(&the_rect);
CRect has an operator that returns an LPRECT or LPCRECT, so his code was perfectly valid.
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 Ryan. You are right.
I always use refrence tag to take my code more readable.
|
|
|
|
|
I write the folowing code which is taking RAM and Hard disk capacity from user by using structures and than saving it to a new file after the user complete entring data it is displaying data entered by the user by opening that file. Problm is that i want to ask the user to choose an option (y/n): If user enter y then your program again get the next record of computer specification i.e RAM capacity and hard disk capacity and store the information in file. And when the user enter n it will stop getting information and display the data of the file. For this i use do while construct but it is not working properly it is getting data but displays only last entry. plz tell me wat should i do.
the code is:
#include <conio.h>
#include <iostream.h>
#include <fstream.h>
struct computerspec
{
int ram;
int hdisk;
}compuspec;
void main()
{
char ch;
do
{
//prompt the user to enter RAM capacity
cout<<"Enter the RAM capacity"<<endl;
cin>>compuspec.ram;
cout<<endl;
prompt="" the="" user="" to="" enter="" hard="" disk="" capacity
cout<<"enter="" capacity"<<endl;
cin="">>compuspec.hdisk;
cout<
|
|
|
|
|
The problem in your code is that u are writing the file after the do while loop, and therefore if u write the file after the do-while construct it would write the last values. Write the values to the file in the do-while loop. After every time you obtain the values from the user write it to the file and then ask for the y/n thing.
I mean just before this
cout<
|
|
|
|
|
How can I convert a int to a char??
|
|
|
|
|
|
How? can you show me an exemple?
|
|
|
|
|
Larsson wrote:
How can I convert a int to a char??
Do u inquring about char *
[itoa]
if char:simple casting will help!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
[code]
int nNum=10;<br />
char szNum[5];<br />
<br />
itoa(nNum,szNum,10);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
TCHAR szBuffer[16];
INT iValue = 5;
::wsprintf (szBuffer, TEXT("%d"), iValue);
|
|
|
|
|
char szNum[30];
int i = 1234;
itoa(i,szNum,10);
// szNum now = "1234"
|
|
|
|
|
The type safe and portable way
Convert any type for which an ostream << operator is defined.
template<class T>
std::string to_string(const T &t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
Use std::string::c_str() to retrieve char*
|
|
|
|
|
I have several projects in vs6 which I'm trying to convert to vs7. In vs6 I have html context sensitive helps which fail to work in vs7.
I tracked down the problem to OnCommandHelp which is where it goes when I press F1 on an area of interest. The following in the vs6 implementation:
LRESULT CFrameWnd::OnCommandHelp(WPARAM, LPARAM lParam)
{
if (lParam == 0)
{
if (IsTracking())
lParam = HID_BASE_COMMAND+m_nIDTracking;
else
lParam = HID_BASE_RESOURCE+m_nIDHelp;
}
if (lParam != 0)
{
CWinApp* pApp = AfxGetApp();
if (pApp != NULL)
pApp->WinHelp(lParam);
return TRUE;
}
return FALSE;
}
What happens is lParam gets a number, and through pApp it points to my application and goes to WinHelp. This all works very well.
In vs7 for some strange reason lParam is zero. This is the first mystery. The other strange thing is that instead of pApp->WinHelp, there is pApp->WinHelpInternal. I wouldn't mind changing the name from WinHelp to WinHelpInternal, but it isn't getting a non zero value for lParam up front.
Can anyone suggest what needs to be changed? I can't convert over to vs7 until I fix this problem.
Thanks,
Ilan
|
|
|
|
|
How create 3 D Push Button control in dialog?
thanks in advance.
|
|
|
|
|
thiyags wrote:
How create 3 D Push Button control in dialog?
http://www.codeproject.com/buttonctrl/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
How can I edit the Active Directory from my application? I mean to add users, to read from Active Directory, etc...
Thanks in advance!
Have a nice day!
|
|
|
|
|
//adding a user
void AddUser(LPWSTR UserName,LPWSTR UserPassword)
{
CoInitialize(NULL);
IADsContainer *container;
LPWSTR ADPath = L"LDAP://serv1/CN=Users,dc=codeproject,dc=com";
hr = ADsOpenObject(ADPath, UserName, UserPassword, ADS_SECURE_AUTHENTICATION, IID_IADsContainer, (void**)&container);
IDispatch *pDisp;
hr = container->Create(L"user",L"cn=Efter",&pDisp);
container->Release();
IADsUser *pUser;
hr = pDisp->QueryInterface(IID_IADsUser,(void**)&pUser);
pDisp->Release();
VARIANT var; VariantInit(&var);
V_BSTR(&var) = L"Yevgeny";
V_VT(&var)=VT_BSTR;
hr = pUser->Put(L"samAccountName",var);
hr = pUser->SetInfo();
VariantClear(&var);
pUser->Release();
CoUninitialize();
return 0;
}
|
|
|
|
|
Hi,
I am working with SDI application in MFC. When I click on the restore button on the system menu of the MainFrame window, the window dimensions should be set to 2/3 the width and height of the screen resolutions.
Can anyone please suggest, where and how to handle this event?
Thanks
Madhavi.
|
|
|
|