|
Thanks for reply..
I explain you my need in details.
First the string is like this sTemp="sub m3 PV||add m3 SV||MD||"
Then i have to extract few things and i have to put in to seperate string
Final String, CString StrFinal = "PV||SV||MD"
I know to extract first two things i.e., sub m3
i did like this
int pos2 = sTemp.Find("\n");
sTemp3 = sTemp.Mid(pos2-3);
sTemp=sTemp3;
here STemp = PV||add m3 SV||MD
And then i have to extract add and m3.
But i dont know to extract the middle add m3 . i need this thing
Anu
|
|
|
|
|
Cant you use same logic? i.e.
I assume each sub string you mentioned here is preceded by '\n'.
And what does || stands for ? Is it a kind of separator ? If yes, you can use it,too.
i.e. Find "||" and extarct 2 chararacters preceding it.
Keep appending result string.
|
|
|
|
|
Do you need to get a middle a string like your example?
|
|
|
|
|
Yes,that || is a newline character which is displayed like this in our coding.
Anu
|
|
|
|
|
Is it possible for you to find space between add m3 or you dont have a space in your string
|
|
|
|
|
Hi,
You can use Strcmp function to compare two strings.
Regards
Velayudhan
|
|
|
|
|
use CString::Find if your string isnt exist return value of Find is -1 else its location of string
|
|
|
|
|
I found that some *.cpl have exported many useful functions.
how colud I launch some export function?
for example:
in firewall.cpl,there are some export functions:
CPlApplet
Install
ShowControlPanel
ShowNotificationDialogW
Uninstall
Thank you
|
|
|
|
|
Run control.exe to launch an applet, for example:
control %systemroot%\system32\firewall.cpl
|
|
|
|
|
Thank you. I knew how to launch an applet.
I mean how to launch an export function of an applet.
|
|
|
|
|
I have a strange problem within a CDialogBar. I need to paint some text in a different font, so I used a static box which I paint over. I capture the WM_PAINT message as OnPaint().
What I intended to do was invalidate the static box to cause a paint command, then inside the SetPatInfo() routine (inside the paint), validate the static box. There seems to be a timing problem as first my routine draws to the box and then another message comes along which updates the static box.
I can verify this by making the CDialogBar disappear from the screen and then reappear, in which case there is no invalid area and just my update is performed under the OnPaint().
I went farther to prove it by invalidating just 1/2 of the box in which case only 1/2 of the box is overwritten after I update it. My question is: why doesn't validateRect stop the second update and where is the second update coming from?
A solution to the problem is to update a single pixel in the corner of the box, but I want to know what is going on and why. Here are some code snippets:
void CMyToolbar::OnPaint()
{
CPaintDC dc(this); // device context for painting
SetPatInfo();
}
void CMyToolbar::Invalidate(void)
{
CWnd *wnd1;
CRect rc1;
wnd1 = GetDlgItem(IDC_PATINFO);
wnd1->GetClientRect(&rc1);
rc1.right /= 2; // for test, invalid 1/2 of rectangle
wnd1->InvalidateRect(rc1,0);
}
void CMyToolbar::SetPatInfo(void)
{
.....
wnd1 = GetDlgItem(IDC_PATINFO);
pDC = wnd1->GetDC();
.....
wnd1->GetClientRect(&rc1);
wnd1->ValidateRect(NULL); // NULL validates the whole window
sz1.cx = rc1.right;
sz1.cy = rc1.bottom;
br1.CreateSolidBrush(bkgColor);
pDC->FillRect(rc1, &br1);
.....
}
Any suggestions to telling me what is going on here would be appreciated.
Ilan
|
|
|
|
|
try Validating the rect after completing drawing operation i.e. call ValidateRect after calling FillRect .
|
|
|
|
|
Ovidiu answered my question in previous question which I unfortunately didn't see until after posting this message. His answer is:
As long as you have not handled WM_PAINT in the static control, but you draw text in it from another place, for sure you'll have troubles after another window will overlap; just test it and see if I'm right.
Ovidiu
He is ABSOLUTELY right and now I have to figure out how I can handle just the WM_PAINT for that static control. I see a WM_PAINT for the DialogBar but I can't find a separate one for just the static control.
BTW, in answer to my response, it makes no difference if I do the validateRect before or after the FillRect. I'm sure Ovidiu is on the right track, but I just have to figure out how to do it.
|
|
|
|
|
quite right.
I think you need to override CStatic class to use in you app.
|
|
|
|
|
I would like to know how to write a hidden program (it will not display in the task bar).
Please help!
|
|
|
|
|
Try using the WS_EX_TOOLWINDOW extended style when you create your window.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Is it possible to use MFC to do this?
|
|
|
|
|
Yes. But you'll need to use CWnd::CreateEx instead.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
But what type of application I should chosen to create?
Could you give me more detail steps?
Please help!
|
|
|
|
|
I programm it with vc+++ and mfc,atl.
does this has anything to do with the difference of the operating system? if dose, how to fix it? if not, what could have been the cause?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
can you be more specific? Is that dll links with any dll supported on XP?
use depends.exe in visual studio to see dependency.
|
|
|
|
|
I detected four files my dll depends on with a software named Setup Factory. all of them are located in the system folder of window, which I think will be the reason and I have not had a chance to test it.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
Run depends.exe, on both OS, if its shows some missing dll. Try to ship it with your dll, and test.
|
|
|
|
|
Hello,
I have matther with how to detect the memory infromation in windows platform. I want to get the some memory information, just as memory total size, memory type, memory manufacture, memory frequency, and so on. just the memory information in windows platform. Can you help me? How to do that? I hope your reply, thanks.
Hanson David
|
|
|
|
|