|
Dear All,
I am using CEdit to display a text in an array like below :
wchar_t szData[5];
szData[0] = 'a';
szData[1] = 'b';
szData[2] = 'c';
szData[3] = '\r';
szData[4] = '\0';
m_EDIT.ReplaceSel(szData);
But, when I display the contents, the CR is displaying as boxes, even I tried with '\n' and the result is the same. Since, it is displaying as a box, further text is not displayed on the next line and it is printed in the same line with boxes after every "abc". Please help to solve the issue.
modified on Tuesday, August 25, 2009 5:15 AM
|
|
|
|
|
First, there's an error in your code: you are not increasing the index. Is it only a typpo ?
Second, you need to have both the carriage return and newline characters (I don't remember in which order, you'll need to test it).
|
|
|
|
|
I am really sorry Cedric Moonen. It is a typing mistake in my previous message (now corrected it).
Cedric Moonen wrote: Second, you need to have both the carriage return and newline characters
I agree with your comment, when I use \r\n then it is displaying in the nextline but my real problem is that my input text will come like the following :
"abc\rxyz\rpqr\r"
|
|
|
|
|
Then you will need to convert it so that all the \r sequences are replaced by \r\n sequences. std::string and CString have functions to do that.
|
|
|
|
|
Dear Cedric,
Thank you so much now I solved the proble but only one thing is pending. For instance, if the text has more no. of \r in it then how could I replace all the \r. Please give me your advice.
I have done already for one occurance of \r and the code is below.
char *str = "abc\rxyz";
stdstr = str;
int idx = stdstr.find('\r');
stdstr.insert((idx+1),1,'\n');
const char* rcData = stdstr.c_str();
int lenA = lstrlenA(rcData);
int lenW;
wchar_t *unircData;
lenW = ::MultiByteToWideChar(CP_ACP,0,rcData,lenA,0,0);
unircData = SysAllocStringLen(0,lenW);
if(lenW >0)
{
::MultiByteToWideChar(CP_ACP,0,rcData,lenA,unircData,lenW);
}
unircData[lenW] = 0;
m_EDIT.ReplaceSel(unircData);
|
|
|
|
|
bhanu_8509 wrote: wchar_t szData[5];
szData[0] = 'a';
szData[1] = 'b';
szData[2] = 'c';
szData[3] = '\r';
szData[4] = '\0';
I don't see the purpose behind populating each and every element in a string separately. May be you haven't known of functions like strcpy ? This would work for both Unicode and MBCS builds:
TCHAR szData[4];
_tcscpy(szData, _T("abc"));
m_EDIT.SetWindowText(szData);
For entering a new line, use \r\n and make sure that in the properties of the edit box, "multiline" is set to true.
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Tuesday, August 25, 2009 6:44 AM
|
|
|
|
|
You're were out-of-bounds again!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK OK...
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
OK OK...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I have tab control and two cards (dialogs) in tab control. I put my bitmap picture (from resources) in picture control on main dialog window (parent dialog) and I wanna that picture stays underneath tab control dialogs, so when I called next handler (on change tab cards) I wanna that that picture be on same place for both dialogs(child) in tab control. When I activate particular tab the next handler is called :
void Board_TabCtrl::ActivateTabDialogs()
{
int nSel = GetCurSel();
if(m_Dialog[nSel]->m_hWnd)
m_Dialog[nSel]->ShowWindow(SW_HIDE);
CRect l_rectClient;
CRect l_rectWnd;
GetClientRect(l_rectClient);
AdjustRect(FALSE,l_rectClient);
GetWindowRect(l_rectWnd);
GetParent()->ScreenToClient(l_rectWnd);
l_rectClient.OffsetRect(l_rectWnd.left,l_rectWnd.top);
for(int nCount=0; nCount < m_nPageCount; nCount++)
{
m_Dialog[nCount]->SetWindowPos(&wndTop, l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_HIDEWINDOW);
}
m_Dialog[nSel]->SetWindowPos(&wndTop,l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_SHOWWINDOW);
m_Dialog[nSel]->ShowWindow(SW_SHOW);
}
But when I change tab card that picture flick because I call ShowWindow(SW_SHOW) i.e ShowWindow(SW_HIDE);
. How can I prevent that picture flick. Is there way to not update part of dialog window or some trick with differernt properties (transparent ....)
PS: What I want is like there is a hole on that picture place on child dialog windows, so that there no be flickering due to calls of ShowWindow(SW_SHOW) i.e. ShowWindow(SW_HIDE) for child dialogs in tab control;
Best regards
|
|
|
|
|
First, try showing your new dialog first and then removing the old one, maybe it also does not hurt if you ensure that the new dialog is always on top of the other one in the Z-order. Another thing you can try is simply disabling repainting of the whole window using SetRedraw(FALSE)[^], performing the switch of the dialogs, re-enabling repainting with SetRedraw(TRUE) and then making your new page and maybe the tab control itself redrawn with RedrawWindow[^]. You might have to experiment a bit with it...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi all
I do appologize in advance for my question, because I couldn't find a related forum with my question!!
I'm writting a program in DDK for secure booting of windows XP.
I use NT-Native functions in kernel mode, but unfortunately there is not any reference or example of using these functions!
I want to load some kernel mode dlls there(such as "hal.dll" in system32 folder) and use of "LDRLoadDLL" function whereas there is no good example of it's usage!
I don't know how should I pass those dlls path address in the first input argument of this function? when I set NULL in it, I get error to load some kernel mode dll (Error such as "File not found" where it succeeds in loading only "ntdll.dll"!) and also I don't know how should be the dll's "path" format in first argument of function?
I've seen ntdll.dll's source code for this function, but the correct format of path is some complex for me!!
Here is the ntdll's source including "LDRLoadDll" function:
http://source.winehq.org/source/dlls/ntdll/loader.c#L2007
I extremely hope you could help me!!!!
Thanks in Advance.
|
|
|
|
|
bahareh655 wrote: Here is the ntdll's source including "LDRLoadDll" function:
http://source.winehq.org/source/dlls/ntdll/loader.c#L2007
Well....that's Wine's source, which is not necessarily going to be the same as the Microsoft original....
Looking at a quick Google search for LdrLoadDLL[^] brings up this page[^], which documents A path format. There's also this page[^], which indicates that the Wine source is definitely very different to the Microsoft source.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello and Thanks of your reply!
I saw "http://www.matcode.com/undocwin.h.txt" address, but it only declares the "LdrLoadDll" as below and doesn't use of it with providing a valid path for a dll!
DWORD __stdcall LdrLoadDll( PWSTR *szcwPath, // Optional
PDWORD pdwLdrErr, // Optional
PUNICODE_STRING pUniModuleName,
PHINSTANCE pResultInstance
);
|
|
|
|
|
Did you look in the comments? There, it says this:
szcwPath - Points to a null-terminated
So, setting szcwPath to something like L"C:\\Windows\\System32;C:\\Windows;" should be what you want?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi and thanks!
Unfortunately it doesn't work!
I have already examined this normal way of specifying a module path, but kernel mode is so sensitive and doesn't accept this format.
This comment suggests how to seperate different paths of dlls.
I think it should be in a different way to load dlls in "kernel mode(DDK)" specifically!
|
|
|
|
|
How to Write some data at a particular Sector
for example here is given a sector
4749463839610C000D00F700007587C8
BAC3E2D1D7EC13349E99A7D5193B9D1B
3EA24C69B7526FBAF3F5FA2B509A8099
CE839DCB375E994671966589A38DBB9E
86BA9288C39484BA8D9CD5A5A5D8AE86
BC8E98D4A0A3D8AB78C0807BC28489CE
918CD09581C08981BE8991D09984BB8B
87BC8D7FCC8685CD8C7EC085E8F8E904
B4074CC24E6AD66CA0DFA1ABE4AC00C6
0000C10000BD00009E0005CC050ADB09
0BE30A10AB1116E41616CB151BE61C1C
E61D19C31918A31720DD2119A1181CAD
1B19A0191BA31C20B52020B12126BC26
29B629249F242EB72D2EB92F2FB73130
B73033BB3333B93533B83434BA3534B8
3437BA393ABB3B3CC03D3BBC3C3CBC3C
37A53748C34849BF494FC25051C25252
C15251B5515AC65B5FC9606CE26C63C9
6469C6696ECC6F70CC707DD27E7FD37F
87D58880C8808CD78C99E69A90D89095
DA9698DB98B0F5B09FDE9F99D699A3DE
A3B1E4B1D6F5D6DCF2DCF3FCF3F5FCF5
FAFEFA05BD030995073DBB3C3FBC3E48
CA4644BC4346BE454CC14A4FC24D45AA
4459C5586FEB6D64CC625EBE5D71CD6F
72CD7179D07875C97490DA8F9ADC99A2
DFA1A2DDA1BDEBBCC7EBC6CBEECA87D9
83BDF4BBF5FBF3FBFEFAFAFDF9FFFFFF
FFFFFF00000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
Now i want to write following data at this Sector
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
Sir please tell me how i can do it
|
|
|
|
|
Well, I assume you're running under XP, etc - so user mode does not have normal access to the sectors on a hard drive.
Is this on a floppy?
Another question... How did you get the contents of that sector? I assume whatever read method you used, there will be a write one?
Yours in need of funrther information,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
hi
actually i have read the vale from sector by using "winhex" tools.
i dont need to read value in my project.
i just want to move a sector and want write following value in that particular sector
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
and then i want read next sector and write again the same value in that sector.
please tell me how to do it.
|
|
|
|
|
Shiv Murti Pal wrote: i dont need to read value in my project.
Shiv Murti Pal wrote: and then i want read next sector
As Iain already pointed out - you'll have to be a bit more elaborate.
|
|
|
|
|
Love your new picture! Did your better half dress you up like this?
|
|
|
|
|
Hmm, I just checked, and the only other person who has access to my account (via a PC with "remember me" *is* my better half...
But she disclaims any responsibility!
I now point my finger at a certain Australian adminstrator. J'Accuse, Mate!
I'd quite like to leave the pic alone now, but I suppose I do use the link for more serious stuff, so I;d better go back to a professional picture...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Iain Clarke wrote: so I;d better go back to a professional picture
|
|
|
|
|
I've written DLL and it exports some functions.
But when I link to it given its .lib and .h files from another console project, it links to dll using ordinals but not names.
I dumped the .exe and found that it imports DllName.01, DllName.02 functions from that dll rather than original functions names.
The dumped dll has its exports as original function names
How to overcome it?
Чесноков
|
|
|
|
|
in the def file I guess you might have put ordinal number after the function name. Remove it.
See here[^] for informations.
|
|
|
|