|
Hi
Can someone please tell me how to split a window in vc++ without using splitter windows???? Is it possible to do it??? And if there is no other way than using CSplitterWnd, well what can i do for the border unmoveable!????
Also i'm trying to write something like a window-based chat application ( actually the app will have other modules other than chat ).. if anyone is willing to share his app with me, I'd be very grateful.. :P
Thanx
Hamchoy
|
|
|
|
|
I put in three menu items, but at different times so in my resource.h file I have:
#define ID_SMARTREMUS 32781
#define ID_SMARTORIGINAL 32782
#define ID_Q14 32795
plus lots of ID_s between 32782 and 32795...
I wanted to use ON_COMMAND_RANGE but now my range has gotten messed up because of the intervening IDs.
If I went into resource.h and manually did (these numbers below are unique):
>#define ID_SMARTREMUS 35000
#define ID_SMARTORIGINAL 35001
#define ID_Q14 35002
#define ID_ABSOLUTELAST 35500
#define APS_NEXT_COMMAND_VALUE 35501
would that be okay? Then I would do the range from ID_SMARTREMUS to ID_ABSOLUTELAST in case I add more. So can I slavage my project or did some other stuff get modified when I gave the menu item its ID?
Appreciate your help,
ns
|
|
|
|
|
This is just fine IMHO. Just remember to do a "Rebuild all" after manually touching resource.h (sometimes the compiler does not "see" these changes).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Since you think its safe, I'm checking it out right now....
Appreciate your help,
ns
|
|
|
|
|
Odd thing is, the stuff in red didnt change though I made the manual changes:
<code>
#define ID_SMARTREMUS 50000
#define ID_SMARTORIGINAL 50001
#define ID_Q14 50002
#define APS_NEXT_COMMAND_VALUE 50003
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 138
<code>#define _APS_NEXT_COMMAND_VALUE 32784</code> I dont think I wrote this part (I cant remember), but its not changed. Do I need to change it to 50003?
#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Appreciate your help,
ns
|
|
|
|
|
Everything should be fine: if _APS_NEXT_COMMAND_VALUE is 32784 and your range begins at 50000, there's plenty of room for new commands before they hit you.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Oh I see......so I dont need to put in the line myself:APS_NEXT_COMMAND_VALUE = 50003
.....it seems to ignore it. I was instructed by some article to do this....
Appreciate your help,
ns
|
|
|
|
|
I changed the APS to 50003 even in the ifdef APSTUDIO_INVOKED block, and put in a new menu ID.....and rebuilt all . Well, it gave the new ID the number 32784, and the _APS jumped to 32785 automatically in that block! (in the ifdef). My given value of 50003 is unheeded and unchanged!
Appreciate your help,
ns
|
|
|
|
|
Maybe you are confusing APS_NEXT_COMMAND_VALUE and _APS_NEXT_COMMAND_VALUE (with a leading underscore)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I do seet hat they are different. I am trying to reserve range of numbers for my future use (with ONRANGE), and the _aps_ is the deciding one it seems. According to ITS value., the next menu item gets its ID number. If I set APS = something (no underscore one) its ignored....and the next number comes right after my entries....(the range requested is ignored)
If I'm confusing you dont worry....I am trying to figure this out and wil post again if I get totally bemused.
Appreciate your help,
ns
|
|
|
|
|
Does anybody know how to used the CRecentFileList::GetDisplayName. I have seen it in MSDN, but I am uncertain about its parameters and how to programatically insert it into my code. Can anyone provide any source code for this member function?
|
|
|
|
|
void CMnuApp::MyFun(CString str[] )
{
//AfxMessageBox("In My Fun");
ASSERT_VALID(this);
if (m_pRecentFileList == NULL) // no MRU files
return;
//else
//m_pRecentFileList->UpdateMenu(pCmdUI);
int size = this->m_pRecentFileList->GetSize();
m_pRecentFileList->GetDisplayName( str[0],0 , "D:\\vc-pgms\\TstCtrl", strlen("D:\\vc-pgms\\TstCtrl"), 1) ;
m_pRecentFileList->GetDisplayName( str[1],1 , "D:\\vc-pgms\\TstCtrl", strlen("D:\\vc-pgms\\TstCtrl"), 1) ;
}
|
|
|
|
|
I am trying to something that should be very simple. I am filling a CStatic with text until the GetTextExtentPoint32 function returns a width close to the width of the CStatic.
The end result is that the CStatic has much more room than what GetTextExtentPoint32 is saying the string width will be.
Is there something else I need to do?
The loop ends when it determines that the newSize.cx will be greater than the nWidth (determined by GetWindowRect()). The string returned is much smaller than the width of the window (nWidth). (nMargin = 2).
(Sorry about the tabs, I thought the code button might deal with it)
Thank you!!
SIZE newSize;<br />
::GetTextExtentPoint32(hDC,szNew,szNew.GetLength(),&newSize);<br />
if (newSize.cx < (nWidth + nMargin)){<br />
int nIns = 1;<br />
while (!bFound && (nIns <= szMid.GetLength())){<br />
CString szInsert = szMid.Right(nIns++);<br />
szNew.Format("%s\\...%s\\%s",szDir,szInsert,szFile);<br />
::GetTextExtentPoint32(hDC,szNew,szNew.GetLength(),&newSize);<br />
if (newSize.cx >= (nWidth + nMargin)){<br />
bFound = TRUE;<br />
szRet = szNew;<br />
}<br />
}<br />
}
|
|
|
|
|
Your code looks ok to me, is hDC the right DC?
Hmmm, are you changing the font between this and when you set the text in the static?
Dave_ wrote:
(Sorry about the tabs, I thought the code button might deal with it)
Naaa, it's the pre tag... Like:
if (whatever)
{
something();
}
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I think you had the right idea. I assumed that the CStatic's font had been selected prior to my call. I added the SelectObject() call before calling my function, and things improved greatly.
Thank you very much for your help.
|
|
|
|
|
I would guess that you don't select the correct font into the DC (hDC) before you are calling GetTextExtentPoint32. Get the font from the static control using GetFont(), then select it into the DC before you call GetTextExtentPoint32. Also, don't forget to select the old font back into the DC when you are done.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
That was it. Thank you very much.
When I read the documentation for GetTextExtent32, it mentioned that the current font would be used to determine the extent, but I guess I was assuming (incorrectly) that the font was selected at the time I called it.
Thank you!
|
|
|
|
|
Hello,
I am a C++ programmer trying to write my own email client, and I have come across some parsing problems in the MIME emails I am receiving via POP3 .
1) I get the characters "=20" (amongst others) appearing at the end of some lines of HTML code, as follows:
Hi=20
Mum
<span=20
class=3d918052115-03022003>
Glad=20
the various problems were solved:
<span=20
class=3d918052115-03022003>Windscreen: You were lucky, I had to =
part with=20
=A3110 recently when my rear window motor really did burn out. I =
think I=20
told you I got this fitted for =A310 (back street handyman) rather than =
the =A340=20
quoted by Peugeot dealer
2) I also received the following code in an email:
=3Chtml=3E
=3Chead=3E
=3Ctitle=3ESexual Meeting=2E=2E=3C=2Ftitle=3E
=3Cmeta http-equiv=3D=22Content-Type=22 content=3D=22text=2Fhtml=3B charset=3D=22=3E
=3C=2Fhead=3E
=3Cstyle type=3D^text=2Fcss^=3E
a {font-weight=3A bold=3B color=3A #FFFFFF=3B text-decoration=3A none}
a=3Ahover { color=3A #FF0000=3B text-decoration=3A underline}
body=09{
=09=09background-color=3A #000000=3B
=09=09color=3A #000000=3B
=09=09margin-left=3A 0px=3B
=09=09margin-top=3A 0px=3B
=09=09font-family=3A Trebuchet MS=2C arial=2C verdana=2C helvetica=3B
=09=09font-size=3A 20px=3B
=09}
Barring the actual nature of the second spam email, I am confused by the =09, =3C etc. etc.
Is this code some thing to do with MIME character sets??? What do I convert them to, or is this an encoding problem such as Base64??
I would be very grateful for some explanation of the above emails.
Thanks,
Paul Trimming
|
|
|
|
|
It's encoded with QuotedPrintable
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
Could any of you knowledgable types tell me how to turn a static text control into a hyperlink ? my current system of buttons is somewhat crude.
Any help appreciated
|
|
|
|
|
Check David Calabro's CButtonST [^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a problem . When I want to create .INI file with some SECTIONs and I want to insert SPACE among them . Ex. :
[Section1]
data1 = ...
data2 = ...
<= there I want to create the SPACE
[Section2]
Best regards.
Tomas
|
|
|
|
|
?? huh? Does:
outfile << "data2 = " << data2 << "\n\n" << "[Section2]\n";
not work??
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
this can be right, but I adding rows to the ini file by WritPrivateProfileString and I can`t make the SPACE !!! I tryied many ways to make the SPACE but I don`t be successful .
thank you
Tomas
|
|
|
|
|
I think you would need to flush the file after doing your WritePrivateProfileStrings(), and then go back and open it using something like a CStdioFile to write the blank lines. You could also do it with a binary file, I don't know which would be easier.
The point is that WritePrivateProfileString does not have an option to do this as far as I know. I have been using this function for a long time, and have never seen a way to do this wihtout manually writing to the file. I could be wrong. It's happened many times before.
Good luck.
|
|
|
|