|
|
|
Hi,
I have a dialog based project in vc++ 6.0, I need to add Menu bar to the dialog box. So I have inserted a Menu(IDR_MENU1) and created it the way I want.But I do not know how to add it to the dialog box. Please do help me.
Thanks
|
|
|
|
|
CDialog::SetMenu() should do the trick.
Nick
|
|
|
|
|
I am using Microsoft Visual C++ 6.0. I ahve tried #include <stdlib> and #include <stdlib.h> and both are not accepted. Is their a header file associated with this function?
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
cout << number << endl;
Thank You
|
|
|
|
|
Try using #include<algorithm>
|
|
|
|
|
I have used #include <stdlib.h and="" #include="" <stdlib=""> and it does not work with the following function.
int pos = input.find(',');
while (pos != -1)
{
input.replace(pos, 1, "");
pos = input.find(',');
}
number = atoi(input.c_str());
cout << number << endl;
Thanks
|
|
|
|
|
#include <string>
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi!
In my app I've declared 2 dialogs via 2 classes. In dialog 1 I use a variable, that works well (of course..). Now I have to use the same var in dialog 2 (class 2) -> that won't work:
error C2597: illegal reference to data member
'CPIADlg::m_workdays' in a static member function
Has anybody the solution? Thanks, Thomas
PS: declaring as static ->
PIADlg.obj : error LNK2001: unresolved external symbol "public: static int CPIADlg::m_workdays" (?m_workdays@CPIADlg@@2HA)
Settings.obj : error LNK2001: unresolved external symbol "public: static int CPIADlg::m_workdays" (?m_workdays@CPIADlg@@2HA)
hmmm???
|
|
|
|
|
Hi everybody.
I need to open some files from my app. So I used do parse the register in order to obtain the default program and run it. For example, to open a pdf file I parsed the HKEY_CLASSES_ROOT for the ".pdf" key and got AcroExch.Document as value. Then I parsed again HKEY_CLASSES_ROOT for the "AcroExch.Document\shell\comman\open\" key and got the whole path of Acrobat Reader. Finally I opened the file using spawnl command.
With Acrobat it's almost all OK, but I neede to open html files too. And Internet Explorer doesn't work as Acrobat does, besides I got the right value of Ecplorer's path.
Any suggestion?
Is there any other way to open a file using its default program?
Thanks,
|
|
|
|
|
Use ShellExecute() or ShellExecuteEx().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hey can anyone help me out with video compression? i have tried to look into virtual dub's code but i didnt get anything.
Saba
|
|
|
|
|
Hi ....
In my application I build functions that convert Arabic text to UCS2 coding this function will take it parameter from DB nvarchar field as follow:
*****************************************
CString CTryNewDlg::ToUCS2(CString txt)
{
USES_CONVERSION;
int xlen = txt.GetLength();
wchar_t *wsz = T2W(txt);
CString c,cc,x;
cc="";
int j=0,i=0;
for (i=j; i
|
|
|
|
|
Hi again ....
i found VB function to do what i want as follow:
************************************************
Public Function UCS2Str(strtext As String) As String
Dim s As String, h As String, i As Integer
i = 1
s = ""
While i < Len(strtext)
h = Mid(strtext, i, 4)
i = i + 4
h = CLng("&H" & h)
h = ChrW(h)
s = s & h
Wend
Hex2Str = s
End Function
************************************************
for CLng i used atol
but for CHrW i do not know what i should use i tried different convertion but i am only gettin strang char
(ex 0634 i should get ش )
plz any hint ...
|
|
|
|
|
Maybe someone can help me on this: I'm creating a MFC custom control which is a combination of a CEdit and a CSpinButtonCtrl . The control is created solely by code, i.e. no resource editor.
The problem is that the edit control paints itself incorrectly. Let me explain:
1.) Directly after showing the dialog with the custom controls it looks this way (the control in question is the control labeled "Breite der Bilder"):
<a href="http://www.magerquark.de/data/misc/mfc-cedit-01.png">Screenshot 1</a> [<a target=_blank title='New Window' href="http://www.magerquark.de/data/misc/mfc-cedit-01.png">^</a>] As you can see, the border around the CEdit is missing and the text ("640") is hanging on the upper left border.
2.) If I move the mouse over the control it looks this way:
<a href="http://www.magerquark.de/data/misc/mfc-cedit-02.png">Screenshot 2</a> [<a href="http://www.magerquark.de/data/misc/mfc-cedit-02.png" target="_blank" title="New Window">^</a>] I.e. now it paints the border but the text is still in the upper left corner, now partially hidden by the border.
3.) The control resizes when the user sizes the dialog. Now when the size was change, suddenly it looks correct, as in this screenshot:
<a href="http://www.magerquark.de/data/misc/mfc-cedit-03.png">Screenshot 3</a> [<a href="http://www.magerquark.de/data/misc/mfc-cedit-03.png" target="_blank" title="New Window">^</a>] As you can see, now the "640" has 'snapped down' to the correct position (in contrast to the control labeled "Breite der Vorschaubilder", which doesn't scale). Also, the CEdit border now is always visible.
So something must happen upon scaling. I already examined the styles of the CEdit before and after scaling with Spy++ and also compared with CEdit controls created with the resource editor. The styles are always the same, so these are not the cause of the display-error.
Question: Can someone enlighten me about why this display-error occures an how I can get rid of it?
Thank you
Uwe
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
I do not know why the error occurs, but I have seen some controls appear one way and then readjust as if they have received a second invalidate rectangle command (or a resize command).
It occurs to me that when Chris Maunder designed the MFC grid control 2.25, he may have ran into that problem. So it might be worth looking at.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
|
I assume that the edit control is not a direct child of the dialog - it's a child of an intermediate container control. Can you tell if there are any messages (WM_NCPAINT comes to mind) that are being blocked by the container on initialisation, but are allowed to pass to the edit control later on.
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"
|
|
|
|
|
I've seen something similar before... I forget exactly what I was doing, but a call to
control.SetWindowPos ( NULL, 0, 0, 0, 0,
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_FRAMECHANGED ); made the control redraw properly. (The SWP_FRAMECHANGED flag is the important part)
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
|
|
|
|
|
Tried that and some other methods, unfortunately without succeess. I already thought that the CEdit thinks it is "maximized" (without border) and when sizing it gets "restored" (with border).
I now examined with Spy++ and logged all messages that appear right before and right after the sizing.
These are the messages:
<a href="http://www.magerquark.de/data/misc/spy.png">Screenshot</a> [<a href="http://www.magerquark.de/data/misc/spy.png" target="_blank" title="New Window">^</a>] I now start investigating, maybe someone already has an idea which message causes the correct repaint.
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
What finally helped me is the following solution:
CRect rect;
control.GetWindowRect( rect );
control.GetParent()->ScreenToClient( rect );
control.ModifyStyleEx( WS_EX_CLIENTEDGE, 0 );
control.ModifyStyleEx( 0, WS_EX_CLIENTEDGE );
VERIFY(control.SetWindowPos(
NULL,
rect.left,
rect.top,
rect.Width(),
rect.Height(),
SWP_FRAMECHANGED )); I've tested under Windows XP so far only, I will see whether it works on other systems, too.
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
I am currently trying to add variable names to radio buttons and combo boxes. Once I add a variable name to the radio buttons, my program no longer runs properly, if at all.
Please help!!
|
|
|
|
|
Changing names on buttons is a simple matter (SetWindowText). So there must be more to this problem. Are you running the debug version with a memory validator turned on (that would help a little). There is also the possibility that the cause occured because of an error in your code that happen before you changed the name, but that usualy results in a runtime error.
Insuffient information!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
what is the error you are getting when you compile the project ?
|
|
|
|
|
I am not getting an error message. That is the weird thing. My dialog window just doesn't pop up when I hit run. My program runs fine until I right click on the button and go to add variable. These are the lines that are making it mess up, because if i comment them out, it runs fine again:
This is declared in my .h file:
CButton m_remOff;
This is generated in the dodataexchange function:
DDX_Control(pDX, IDC_RADIO_REMOFF, m_remOff);
Also if I make a line like m_remOff.setCheck(true) that causes problems.
Is there another line of code that should be generated automatically somewhere else? I am using .net 2003.
|
|
|
|