|
Thanks I don't have WS_HSCROLL and WS_VSCROLL
I'll insert those styles and re-try
I am at work now will try tommorow night
Thank you very much
|
|
|
|
|
Hi
I added to ES_AUTOHSCROLL and VSCROLL
The Caret seems to appear in the middle of the text but no scrolling here is a snipet of my code
<pre lang= 'cpp'>
in CProgDebug::ONINITDIALOG
long start, end, theline;
myedit = new CProgedit; // allocate the richedit
UpdateData(FALSE); // connect to dilog object
// myedit->SetOptions(ECOOP_OR, ECO_AUTOVSCROLL | ECO_AUTOHSCROLL);
EDITSTREAM es;
// Set the ENM_REQUESTRESIZE event flag
// myedit->SetEventMask( ENM_REQUESTRESIZE ); // set notificate to keep number of charcters in view
// Force the control to issue a EN_REQUESTRESIZE notification
// myedit->RequestResize( );
CStdioFile *fileptr = new CStdioFile;
fileptr->Open(proglisting,CFile::typeBinary);
es.dwCookie = (DWORD) fileptr;
es.dwError = 0;
es.pfnCallback = (EDITSTREAMCALLBACK) readlisting;
myedit->StreamIn(SF_TEXT, es);
myedit->SetFocus();
theline = myedit->LineFromChar(myedit->LineIndex(-1));
myedit->LineScroll(-theline,0);
myedit->HideSelection(TRUE,FALSE);
ShowWindow(SW_SHOW);
CDialog::OnInitDialog();
return TRUE;
}
</pre>
IDD_PROGDBG DIALOGEX 0, 0, 779, 345
STYLE DS_SETFONT | DS_MODALFRAME |WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Debug Dialog"
MENU IDR_HERC_CMDTYPE
FONT 8, "Times New Roman", 400, 0, 0x0
BEGIN
CONTROL "",IDC_RICHEDIT22,"RichEdit20A",WS_CHILD | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | WS_BORDER | WS_TABSTOP,17,39,735,273
END
|
|
|
|
|
I am trying to figure out how to create a emulator that loads multiple generic hid mouse devices in c (or generic mouse devices). Generic drivers are ones that are included with windows already. Anyone know where I should start or if this would be a hard task?
The end result is to make a c driver that emulates mouse input like the sendinput api except with multiple mouse devices.
The programs I was trying to get this to work in are: programs created with Microsoft multipoint sdk and Microsoft mouse mischief.
So far I do not have a c driver but have the technical details of the device on my project page (I want to get rid of dsf since its not 64-bit compatible): http://kinectmultipoint.codeplex.com. The emulator on the project does work now but I want to try and code a better system in.
jeffery
|
|
|
|
|
Hello Every one,
I am adding some key in Registry is not getting into effect until system reboot or by killing explorer.
so how can i achieve it, without rebooting and killing explorer.
please help me out ..
Regards
sarfaraz
|
|
|
|
|
You shouldn't need to reboot unless registry key was in HKLM rather than user's own HKU hive.
Just log out and back in again. What was the reg key?
|
|
|
|
|
What process is it that needs to read the newly added key?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I have done with shell API SHChangeNotify.
|
|
|
|
|
Ok, but that does not answer my question.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I want to ask you something: why CBitmap::CreateCompatibleBitmap() fail on large bitmap files ? I have:
VERIFY(m_Bitmap.CreateCompatibleBitmap(pDC, nWidth, nHeight));
and on large bitmaps, on debug, I get assert error ... why ?
|
|
|
|
|
Call GetLastError() upon failure to know more about the reason.
|
|
|
|
|
Thank you, I had tried to see what GetLastError get me, but get me nothing, I mean 0 ... always 0 ...
|
|
|
|
|
There are situations that GetLastError() returns 0 when the call fails (from MSDN and looking at the source of the MFC function):
- When a bitmap handle is already attached to the
CBitmap (asserts also); - When using Windows 9x (last error is never set, size is limited to 16 MB);
- When this can happen without being documented in the MSDN.
I hope this information helps you to find the reason.
|
|
|
|
|
Hello Everybody,
I am trying to pass some values to char ** (to a third party library). But i am getting some issue in that.
char** ids = new char*[m_Size];
for(int i=0; i<m_Size; i++)
{
ids[i] = mSizes[i].GetBuffer(mSizes[i].GetLength()); }
using that third party function, its creating an output file and in that file the stored value is showing like this.
GROUP : 46,0
GROUP : 44,0
GROUP : 42,0
GROUP : ÝÝÝÝÝÝÝ݆«ãe,0
GROUP : 40,0
GROUP : 38,0
But if I give values like this, then in output file, the values are showing fine.
char* ids[6] = {"38", "40", "42", "44", "46", "48"};
in the output file,
GROUP : 38,0
GROUP : 40,0
GROUP : 42,0
GROUP : 44,0
GROUP : 46,0
GROUP : 48,0
(see the sequence also)
what i am doing wrong? initialization ? or passing values ?
Thanks,
A. Gopinath.
|
|
|
|
|
The code looks fine. Because only one of the strings from your array returns wrong data, this element may be corrupted somewhere else.
Note also that you must call ReleaseBuffer() for each string array element after calling the library function. If not doing so, further accesses may return invalid data.
You should also check the documentation of the library if the passed strings are constant or may be changed. If they may be changed, you must pass the max. allowed length to GetBuffer() .
|
|
|
|
|
char** ids = new char*[m_Size];
Here you create an array of char pointers.
Here:
ids[i] =
you need to create an aray of chars, so it should be ids[i] = new char [<some number="">]
Then copy the data into the char array.
==============================
Nothing to say.
|
|
|
|
|
In the first case, the pointers are pointing to memory maintained by the CStringArray class.
It is likely that CStringArray relocated, resized or moved the memory around.
So you need to allocate memory for each pointer and copy the contents to the allocated memory.
In the second case you have pointers to fixed locations that do not change.
|
|
|
|
|
I am aurpsised it even runs with out crashing since he is setting his array pointers to the values contained in some string!
So if the string was 'this monkley is stupid' the first pointer will have the value of the ASCII codes for 'this', the second pointer ' mon' and so on.
Of course these addresses are completely invalid and point to somewhere in his process. If he manipulated them in any way its bye bye process time!
==============================
Nothing to say.
|
|
|
|
|
Hi,I want to change the string of a menu item,the string contains a '\t',like
"hello\tworld",I use CMenu::ModifyMenu function,I tried many times,the string always "hello",not"hello world",It will lost the string after '\t',Why,How to change it.
Thanks
|
|
|
|
|
Show some more of the actual code; there may be something wrong with it.
Use the best guess
|
|
|
|
|
With menu items, the tab character is used to right align text in a new column (commonly to print accelerator short cuts). See also the MENUITEM statement[^] in the MSDN.
So even when its is working, the result may be not the one expected by you.
I don't know why the text right of the tab is not shown by your application. Did you call CWnd::DrawMenuBar() after changing the menu content? If not, this may be the reason.
|
|
|
|
|
I use vs2010,The Menu item got from CMFCMenuBar,like this:
CMenu *pMenu = CMenu::FromHandle(m_wndMenuBar.GetDefaultMenu());
CMenu *pSubMenu = pMenu ->GetSubMenu(1);
Cstring strText = _T("Hello\tworld");
pSubMenu ->ModifyMenu(ID_CHANGE, MF_BYCOMMAND, ID_CHANGE, strText);
I use DrawMenuBar ,it still doesn't work,why
|
|
|
|
|
I don't know why.
You may check if tabs are shown when using in resource based menus. If not, the problem is application based. You may also check if '\a' is working (same as '\t' but text is left aligned).
|
|
|
|
|
Hi,
I create a derived Cdialog with following code
main_window->progdbg = new CprogDebug();
main_window is main windows I get the pointer to it via AfxGetMainWInd
CMainFrame* main_window = (CMainFrame *) AfxGetMainWnd();
CMainFrame is created on the heap
later on when I try to create the the window modeless dialog it never comes back to me the is that is the create
ret = progdbg->Create(IDD_PROGDBG,(CWnd *)this);
if(ret == 0 )
error = GetLastError();
|
|
|
|
|
|
I use the VC++ 2008 to check this question. I define one function named "max2" using keyword "static" and one function named "min2" using keyword "inline". I think that the compiler will use the code inside the min2 function to replace the function called. And the max2 with static keyword will be compiled to be a function.
But after the Deassembled in Debug model. I found that the exe both use the "call " assemble code to call these two functions. why does the inline not succeed?
modified 14-May-13 10:16am.
|
|
|
|