|
it is not Clear what you are saying
can you paste some code and go slow
When all else fails look in MSDN
|
|
|
|
|
When we touch a line of the tree, the arquive associated with the line is showed on the right side.
The code on the TreeView is working good, but on RichEditCtrlView don´t
I can send the code
For while the code of the RichEditCtrlView
void CShamaiRichEditView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
CString m_File;
CString m_File1;
TCHAR szBuffer[MAX_PATH + 1];
GetCurrentDirectory(sizeof(szBuffer),szBuffer);
MessageBox(szBuffer, "Current Directory", MB_OK |MB_ICONINFORMATION);
m_File=szBuffer;
CString x("\\");
m_File = szBuffer;
// deveria ler o nome do arquivo na variável
// o código deve ser algo próximo disso...
// estou enviando em anexo o código do programa original
CWzdInfo *pSelInfo;
pSelInfo = GetDocument()->GetSelection();
/////////
MessageBox(szBuffer, "Current Directory3", MB_OK |MB_ICONINFORMATION);
if(pSelInfo->m_nCategory == CWzdInfo::FILE)
{
MessageBox(m_File1, "File kkkkk", MB_OK |MB_ICONINFORMATION);
}
if(pSelInfo->m_nCategory == CWzdInfo::FILE)
{
m_File1=pSelInfo->m_sName;
MessageBox(m_File1, "File", MB_OK |MB_ICONINFORMATION);
// m_File = "K:\\Projetos de VC.net\\Shamai\\file1.txt";
m_File= m_File + x + m_File1;
MessageBox(m_File, "File Completo", MB_OK |MB_ICONINFORMATION);
CMainFrame *pFrame= CShamaiApp::GetApp()->GetMainFrame();
// CFrameWnd *pFrame =(CFrameWnd*) AfxGetApp()->m_pMainWnd;
// CMainFrame *pFrame= CShamaiApp::GetApp()->GetMainWnd
CSplitterWnd *pSplitter=pFrame->GetSplitter();
CShamaiRichEditView *pView;
pView = (CShamaiRichEditView *)pSplitter->GetPane(0,1);
LPTSTR m_File2 = new TCHAR[m_File.GetLength()+1];
_tcscpy(m_File2, m_File);
CFile file(m_File2, CFile::modeRead);
CArchive ar(&file, CArchive::load);
MessageBox(m_File, "File Completo - fim " , MB_OK |MB_ICONINFORMATION);
pView->Serialize(ar);
}
else
;
}
|
|
|
|
|
How can I link F1 (WinHelp) to dialog boxes that are created dynamically, "on the fly" in Visual C++/MFC?
|
|
|
|
|
Hi
I met with trouble with MSComm component.In my application i use one.And it worked correctly under Win98 and Win2000.But when i launch my programm it into other computer under Win98 initializaion routine get error
MSCommLib::IMSCommPtr a;
a.CreateInstance(MSCommLib::CLSID_MSComm);<-error here
hr returned an number what cant recognized ErrorLookUp
Please help.
Thank
|
|
|
|
|
Maybe the library file is slightly different? Try copying the one on your working computer to the other one..
Kelly Ryan
|
|
|
|
|
Hi,
Does anyone know how I could set it so that when I move the mouse over a button in an application I'm writing, the cursor will change to something else?
Right now I have the cursor set to something for the main window, but when the cursor moves over a button it switches bact to the default. I want it to use the same cursor as I'm using for the parent window, but I can't find any way to do this.
Thanks,
Kelly
Kelly Ryan
|
|
|
|
|
Try handling the mouse move message. Check to see if cursor is within the button vis PtInRect(). Set cursor.
Kuphryn
|
|
|
|
|
The only problem is, I don't want to set the actual windows cursor using SetCursor, I want to give the buttons individual cursors in the same way that a cursor would be set such as wndclassex.hCursor = etc
I don't want to have to worry about the program crashing/shutting down etc and not getting back my original cursor, as I've had bad experiences with SetCursor in the past. Maybe there isn't a way to do what I'm asking, or maybe there's a way to manipulate SetCursor to do it for me? Basically my ultimate goal is to only have the cursor changed inside my application, which is what it does now with the parent window, but not with the buttons..
Thanks
Kelly Ryan
|
|
|
|
|
Hello,
I want to convert a UNICODE string to double data type.
With non unicode strings I use the "atof" function.
For converting a UNICODE string to long data type there is
the function "_wtol". In the .net library there is the function
"_wtof".
How do I convert a UNICODE string to double data type in Visual C++ 6.0??
Thanks
Stefan
|
|
|
|
|
|
How can I correct start a program by 'CreateProcessAsUser'.
The calling program is a system-service and runs under the 'SYSTEM'-Account.
How can I start the program as the current user.
Thanks
Harry Diel
Harry Diel
|
|
|
|
|
How can I paint a Bitmap in the background of my window, using VC 6.0
thanks
Christian
|
|
|
|
|
You'll need to override your OnPaint() member function of your window. Then 'Paint' (via BitBlting your desired bitmap onto the windows Device Context.
I Dream of Absolute Zero
|
|
|
|
|
or you can do
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP_BK);
CBrush br;
br.CreatePatternBrush(&bm);
now you can return this brush in the onErasebkground funtion
or select it in to dc and draw
When all else fails look in MSDN
|
|
|
|
|
I register my user messages with ::RegisterWindowMessage().
I fail to identify a technique to deregister such a message - will it automatically be free'ed when the application goes, am I blind and fail to see the appropriate function in MSDN, or is Windows running out of user message codes eventually?
Mind you the OS is likely to die on me before this happens, but the question remains...
Any clues?
TIA,
Bernd
|
|
|
|
|
You should only use RegisterWindowMessage() to send messages to another application running in a different process. For internal window message communication you shouldn't really use this. But don't worry if you do when your application shuts down (providing another application hasn't registered the same message) the operating system will gradually release its mapped resource on this string.
If you are just doing this from within your own application have a look at ON_MESSAGE in MSDN. This is the correct way to deal with custom messages from within your application (unless of course you want to pass messages between GUI threads which would use ON_THREAD_MESSAGE)
|
|
|
|
|
Thanks for the clarification on the resource management issue.
I wonder, though: why is it that I shouldn't use this for inter-thread communication (not GUI threads, but regular workers) within a process?
TIA,
Bernd
|
|
|
|
|
Hi All,
My task is to develop a some editor,roughly speaking like vc++ IDE.I wud like to incorporate Autocompletion,Syntax coloring,cut,copy and paste features,etc to my editor.Is there any tool available other than Scintilla,so that u can use that tool directly.I have gone through the Scintilla site.Finally what I have come up after seeing that site was its not easy to use that tool.Let me know,any one used this tool or any other tool.
Thanks in Advance,Rama.
Deepa D.
Senior Developer.
|
|
|
|
|
I want to format a date according to the system language, for example I want the month name to be displayed according to the system language chosen.
CString strResult;
COleDateTime dMyDate;
dMyDate.SetDate(2003, 12, 3);
strResult = dMyDate.Format("%d %B, %Y");
The result is as follows: "12 December, 2003" but what I want is to show the month name in another language.
Any ideas?
Daed
|
|
|
|
|
Have a gander at the NLS API (e.g., GetLocaleInfo() , GetDateFormat() ).
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Yes i tried GetLocaleInfo to get the locale language.
I set the locale language to be English and the date/time language to be the local language. I needed this because i only want the month name to be displayed in the local language and the numbers and date order to be displayed in English. Most of the languages worked fine except the Right-to-Left languages like Arabic and Hebrew, ??? are displayed instead. What can i do?!
TCHAR strLanguage[256];
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, strLanguage, sizeof(strLanguage));
CString cstrlastLocale;
#ifdef _UNICODE
cstrlastLocale = (CString) _wsetlocale(LC_ALL, _T("English"));
_wsetlocale(LC_TIME, strLanguage);
#else
cstrlastLocale = (CString) setlocale(LC_ALL, _T("English"));
_wsetlocale(LC_TIME, strLanguage);
#endif
|
|
|
|
|
The app I want to create is very simple : just a window displaying an image, which is grabbed from a camera.
To be more clear : there is several steps : acquisition, compression and display to the screen.
So I create a simple MFC dialog (jut one window without control button except one alone). I include grabbing and compressing steps in the OnInitDialog, and also the display function.
I want to process this until the user pushes a button stop.
The problem is that (when I see it in the Debug mode) all is well done, until the image to the screen refresh.
Does anyone know why ?
Thanks,
|
|
|
|
|
Are you talking about a single image displayed like a photo, or a continuously changing image like something grabbed from an active webcam?
And what exactly happens when the problem occurs? When the image to the screen refreshes, it doesn't display properly? Or it's all black? Or what?
Kelly Ryan
|
|
|
|
|
It's a continuously changing image, grabbed from a camera.
When I run the program, the 1st image is well shown. After the image file changes (same name, etc), but the window always shows the first image.
|
|
|
|
|
What I'd probably do is create a global image file that contains the imagine you want to display, and run a loop that just keeps redrawing that image maybe 30-50 times a second. When you grab your next image just set it to your global and then it'll automatically redraw. Otherwise you should be able to just clear the screen and re-blit when the image file changes.
Kelly Ryan
|
|
|
|