|
Hi all,
I have one class CMyRichEditCtrl:public CRichEditCtrl
i have done some code by which i can get the word when mouse moves on it.
e.g.
asdf as*dff sdfs sdsd
asdasd asdasd asdasd asdasd
if mouse cursor is on the '*' word i am getting asdff. by using CharFromPos.
after getting this word i want to show it's ascii value.
so how can i show this thing.
Means i am doing all these things in mousemove handler.
so in that time if the mouse moves then what will happen?
is it possible?
Thanks and Regards
Harshal Shete
|
|
|
|
|
Im helping out someone with this problem and im stuck, it been sometime since i used c++.
He reads in a file (ios::binary) and
char version [30]; //
...
file.get(version, 30);
Now the in version[0] is a char value, i want the decimal value, for example, 0x18 is "cancle" (looks like a up arrow in text). I want the decimal value 24 from 0x18, or take the char "cancle" and get 24.
the reason i need the decimal value is because it represents the lenght of the data string after version[0]. 30 is the max the string can be so thats why i need the decimal value of version[0]. Its just to tell the user what version the file being read is. Can anyone help me on this?
Thanks.
modified 16-May-21 21:01pm.
|
|
|
|
|
int length = (int)version[0];
cout << "value should be 24 <" << length << ">" << endl;
|
|
|
|
|
Thanks. I swear i though i tried that but had an error and wrote if off.
edit: Well it wasnt an error but a '0'. When i run it through VS2005 i get a zero, but when i go to the .exe and double click it i get 24. Thats why i wrote it off i dont get the right values when running through VS2005. IT was driving me nuts out of the blue i double click the .exe and bam it works. dang VS2005
-- modified at 1:50 Monday 31st July, 2006
modified 16-May-21 21:01pm.
|
|
|
|
|
See Here[^] maybe it is some helpful to you
|
|
|
|
|
codeguru again ??!!
|
|
|
|
|
Hello Mr toxcct,
How are you?did you have a good weekends?
I can say only :
and i say again,
Viens,laissons l'Avenir;laissons nos chagrins fous.
Jouissons du present et si doux!(Khayyam)
|
|
|
|
|
I have an application that places a custom button on the window caption bar. However I am having a problem when running on Windows XP.
I am finding that simply handling the WM_NCPAINT message causes XP to render the caption bar with the old Windows 2000 style. If I comment out ON_WM_NCPAINT() in the message map the caption bar is then drawn with the current XP style, put it back and the Windows 2000 style is used.
To make matters worse GetSystemMetrics returns caption icon sizes that match the XP theme, even when it is rendering the Windows 2000 style. This means I have no way of calculating the icon size and position.
I feel like I am trapped, I can't have the XP style because handling WM_NCPAINT automatically disables it, and I can't have the Windows 2000 style because GetSystemMetrics won't tell me the correct sizes. How does Microsoft expect people to now put icons on the caption bar?
Has anybody put a custom icon on the caption bar of XP and retained the themed style, how did you do it?
P.S. Popup dialog windows are render with the XP style regardless of what I do with the main window.
|
|
|
|
|
'simply' handling WM_NCPAINT does not turn off visual styles as you claim. You are probably calling DrawFrameCtrl / some other API in your nc-paint handler - this is what is turning off the visual styles for the window. Replace all your drawing with a BitBlt and it'll work fine.
|
|
|
|
|
Yes you are right I have confirmed that it is the drawing part of OnNcPaint that is stopping the visual style. Since I do my drawing after the default window processing completes, Windows must work out that I will be calling DrawFrameControl in the future and then render using the old Windows 2000 style.
I think all I have to do now is replace DrawFrameControl with some theme based drawing when running on XP. I have just added to code to load the uxtheme.dll library and get pointers to theme functions I need to call. I think I just need to do the following with appropriate parameters to draw my icon...
if (uxthemeloaded)
{
pOpenThemeData(...);
pGetThemeBackgroundContentRect(...);
if (pIsThemeBackgroundPartiallyTransparent(...))
{
pDrawThemeParentBackground(...);
}
pDrawThemeBackground(...);
pCloseThemeData(...);
}
|
|
|
|
|
John Saunders wrote: This means I have no way of calculating the icon size and position.
U can get the title bar height by taking the difference in the top of the window rect and client rect( do forget to call the ClientToScreen of the client rect ).
nave
|
|
|
|
|
Few days back i posted here the same problem.I want to get some answers pls help me.
In the application one keyboard is made by using a dialog with bitmap.Then by pressing the keys in that keyboard the application will get data like numbers,alphabets,enter key...like that.This keyboard have all buttons like the system keyboard.
I have to enter values to dialog edit control through this keys.So i get sample coding..In that they coded in keyboard class like..PostMessage(WM_KEYDOWN,49,0);
and in the corresponding dialog class where the value should entered they coded as
void CFacePlate::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
case 49:
sSktNumValue += "1";
break;
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
So i debugged the program..When ever the Postmessage function in Keyboard class is executed then the contol is going to OnKeyDown function in Dialog class.How it si going there?
I dont know whats happening there.
I coded like this for my application..but the control is not going to OnkeyDown function..How can i make that?
Anu
|
|
|
|
|
Hi all
i have developed a windows service. rite now i have to manually setup
folders, copy the exe of service to it n then manually install and start the
service from command prompt. Now i want to automate all this process. I want
to make a setup(installer) for that purpose. So that i only need to give that
setup program to somebody n when somebody runs that...everything is
installed, copied on its own......Please suggest me how do i make the
installer code....(something like proffesional software setup
programes).......also in which language it wud be easy to do it........my
service is in C++
thanks
kunal s patel
|
|
|
|
|
|
Hi all
i have a client/server application(infact server is a service and client is
a MFC gui) now i have a situation where i need to transfer username and
password over the network to the server from the gui.........but sending it
in plain text is harmful....so my question is how do i start a secure
connection to the server n send the information to it n then close the secure
connection
thanks
kunal
|
|
|
|
|
void CWDlg::OnBConnect()
{
// TODO: Add your control notification handler code here
strcpy(sessionid ,m_aapi.Login("usid","pssword");
}
|
|
|
|
|
hi
can u elobarate on wat u r trying to say...i didnt get it.....wat is sessionid...a char array???
Also i know how to get username n password information...i want to know how to send it over the network in a secure way....copying to a array n sending it in plain text is harmful.....so please suggest me a way to send it over the network in secure way
thanks
kunal
|
|
|
|
|
|
I have a requirement to find that which bluetooth stack is present(currently active) on the system? can anyone help me??
|
|
|
|
|
hello guys,
1) I have to take data from server and store in my msaccess database and also display the current changes in a text file I am working with dialog based application.And one more thing
If there is any good link pls provide me.
For this function i have create a button and I want by clicking that button the data from server will b display in a text file is that possible.
Any small hint will help to proceed further.
Thanks
-- modified at 1:04 Monday 31st July, 2006
|
|
|
|
|
|
1.One socket with 2 threads do read/write,is that ok?
2.One socket with 2 threads write to that socket with no lock,could the OS provide the receiver's pack oreded,that is,if thread A and thread B send message to the same socket with no sync protected,for exp A send "AAAA",B send "BBBB",is is possible for the receiver socket recive AAAABBBB(ordered) or ABAABAB(disorederd).
3.If using WSASend api to send a buf to several sockets,can we simply use a loop to send like following examples
WSABUF buf;
buf.buf = "test";
buf.len = 4;
Socket list[someNum];
for(i = 0;i++;i< someNum)
{
WSASend(list[0],&buf,1,...);//here we keeping use the same buf!!
}
if its not so correct,is there any good solutions?
Best regards!
|
|
|
|
|
Hello everyone!
I still don't quite get how C works... I always get weird, and I mean weird errors, like this one:
I have a char* string. It's a filename. If I printf() it, it gives me "x5" or other characters that don't have anything to do with it. But if I open the file, it opens correctly, and I can even display a string on the file...
Why is this? Is there a tutorial or something that explains this kind of stuff? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Kixdemp wrote: If I printf()
can you show us your printf() call ?
and, does that char* point to ?
Why donchoo take a peekchur mayn?
OK, cleeeeek
|
|
|
|
|
Interesting - you're learning C ? Do you do embedded work ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|