|
Hmm, or maybe you meen that "VIEW" corresponds to queries only?
I guess I'll find out when I try it. Thanks for your help!
regards
/Anders
|
|
|
|
|
Hello
A colleague of mine told me not to use WaitCommEvent() since it's not 100% reliable.
Can anyone back this up?
Thanks,
Jonas
|
|
|
|
|
I had a problem recently on comEvReceive. About once in 3 million times it would OnCommEvent would be called for this but a character had not been recieved so I had to put a condition in my code to cover this.
Elaine (serial fluffy tigress)
The tigress is here
|
|
|
|
|
I want to realize splitter window in mfc extention dll. and i did so
1.Derived a class from CFrameWnd named "CMyFrame"
2.Derived a class from CView named "CMyView"
3.use construct function to declare a frame
CMyFrame myframe
4.Create myframe
myframe.Create(...)
5.Create view
myframe.CreateView(...)
when i execute the project ,there appears seriou error
can you tell me what is wrong?
note:in the function myframe.Create(...),
i set the parameter pContext = NULL. if the parameter can not be set with NULL,where i can get createcontext,because i do all above in extension dll
|
|
|
|
|
I need to reset an ata/ide device, but don't know how to do this. Anyone knows how to do this?
|
|
|
|
|
is it possible to bind a keyboard key [left alt] to a usb controller button?
im working on a project for school and i'v done tons of work and now i cant proceed with out doing this...ugghh im screwed. if anyone could help me that would be amazing.
im running win98 right now.
if you need anymore info i can do so.
thanks.
|
|
|
|
|
I have a LPSTR variable and I need to use the Split method to extract the necessary data.
|
|
|
|
|
Split() is part of VB and JScript. I'm not familar with it in C/C++. Either way, the first parameter is a string or an instance of a Regular Expression object identifying one or more characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. The return value is an array of strings split at each point where separator occurs in the source. The separator is not returned as part of any array element.
|
|
|
|
|
I've never used it, but I would image that the string class from the STL would accomodate you.
|
|
|
|
|
Two methods to consider are using the strtok function or simply doing it yourself in a loop like this:
void ProcessEMailAddresses(char *cpEMailAddresses)
{
char *cpDelimiter;
char *p = cpEMailAddresses;
char caEMailAddress[256];
while (p && *p)
{
caEMailAddress[0] = 0;
cpDelimiter = strchr(p,';');
if (!cpDelimiter)
cpDelimiter = strchr(p,','); // check for comma separator
if (cpDelimiter)
{
memcpy(caEMailAddress,p,cpDelimiter-p);
caEMailAddress[cpDelimiter-p] = 0;
}
else
{
strcpy(caEMailAddress,p);
}
if (caEMailAddress[0])
{
// process it!
}
if (cpDelimiter)
p = cpDelimiter + 1;
else
p = NULL;
}
}
<marquee SCROLLAMOUNT=3 scrolldelay=80 direction=right width=40% style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...</marquee>
|
|
|
|
|
So what's your question?
|
|
|
|
|
I want draw rectangle in win98, and I use MM_LOMETRIC mode to draw.
I need vc source code
pls help me!!!
|
|
|
|
|
hi:
you can use class CDC 's function
virtual int SetMapMode( int nMapMode );
BOOL Rectangle( int x1, int y1, int x2, int y2 );
|
|
|
|
|
Hi,
Where I can find any documentation about this ActiveX control.
I've searched in MSDN with no results.
When I use it in my VC++ project, the Class Wizard generates a wrapper
class called CRichText. It has a lot of functions which I don't know
how to use. I mean I don't know the parameters format. That's why
I need any type of documentation or reference. Can anybody help
me with that ?
Best Regards!
Yasen
|
|
|
|
|
hi!
Do you refer to rich edit control?if so,you can find help in msdn
by CRichEditCtrl.
|
|
|
|
|
No, I don't refer to CRichEditCtrl, I know how to deal with it. But it is an ActiveX control it is not a CRichEditCtrl. So, I can't find documentation about it
Yasen
|
|
|
|
|
which one's better to use in a unicode application?
i mean if its so easy to use CString why go for stuff that will make the application more complex harder to read and debug
i am all ears to suggestions and views..
|
|
|
|
|
It depends what type of operations you nedd to perform on the strings. If you use MFC anyway, and if you need to manipulate strings like deleting characters, and another size-modifying functions, it's best to use CStrings, you rife will be much easier and you can avoid spme bugs.
But if you just need to pass unmodified strings to another functions, LPTSTR is more efficient.
rrrado
|
|
|
|
|
CString uses TCHAR internally. (LPTSTR)
so if you define _UNICODE, TCHAR is defined as wchar_t so CString is also using unicode
where is the problem?
|
|
|
|
|
I have a single line edit control and a class derived from CEdit. Now I want that the CFormView class which contains the edit control gets informed if the user presses the Return key if the Edit control has the input focus.
I've tried to react on the NM_RETURN notification in my form view but I don't get the event in the form view (must I use reflection in my edit class?).
Then I tried to capture the VK_RETURN key in the OnChar method of my edit class, but the OnChar method seems not to get any VK_RETURN events.
So what would be the best way to get my form view informed if the user presses the return key in my edit control?
Thanks in advance.
|
|
|
|
|
Try to set "Want return" style in resource editor for edit control,
i think NM_RETURN could start working then
rrrado
|
|
|
|
|
No luck, it seems not to work. I've already tried it and it makes no difference. The documentation also says that "Want return" only effects multiline edit controls.
|
|
|
|
|
Subclass the edit control like this:
pOldEditWindowProc = (WNDPROC)::SetWindowLong(hWndEdit, GWL_WNDPROC, (LONG)EditWindowProc);
.
.
.
LRESULT CALLBACK EditWindowProc(HWND aHwnd, UINT aMsg, WPARAM aWp, LPARAM aLp)
{
if(Return was pressed) ::SendMessage(::GetParent(aHwnd), aMsg, aWp, aLp);
return ::CallWindowProc(pOldEditWindowProc, aHwnd, aMsg, aWp, aLp);
}
--
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. (Douglas Adams)
|
|
|
|
|
The other way to handle this is in PreTranslateMessage()
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN && GetFocus() == GetDlgItem(ID_OF_CONTROL))
{
// handle it here!
}
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I have added some additional code, which seems to work now. But I still find it a bit ugly to perform the check in the application class. But that's ugly windows
Would be nice if someone could add feedback, if this code is correct or not, e.g. the
CWinApp::PreTranslateMessage(pMsg); part.
Thanks for your help!
BOOL CMyApp::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN))
{
HWND hFocus = GetFocus();
CFrameWnd* pFrmWnd = dynamic_cast<cframewnd*>(GetMainWnd()); if (pFrmWnd == NULL)
{
ASSERT(FALSE);
}
CWnd* pTarget = pFrmWnd->GetActiveView()->GetDlgItem(IDC_EDIT_X);
// We should test, if an active view exists, if we are not sure...
HWND hTarget = NULL;
if (pTarget != NULL)
{
hTarget = pTarget->GetSafeHwnd();
}
if (hFocus == hTarget)
{
// Do what you want
}
return 1;
}
else
{
return CWinApp::PreTranslateMessage(pMsg);
}
}
|
|
|
|