|
I am developing a chat system on a dialog based application. To display the text I used a CRichEditCtrl-derived class. The EN_LINK event-mask flag is set, and the EM_AUTOURLDETECT is applied. The text is displayed as a link, that works nice. My problem is that I seem unable to intercept the EN_LINK notification when someone clicks on that link. Has anybody some suggestions what I am doing wrong? (Surely it is my fault )
Thanx alot
Klymer
|
|
|
|
|
Did you specified ENM_LINK flag when sending EM_SETEVENTMASK message to rich edit control?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Yes,I did, thanx anyway as well... I found my error by the time I think I should post more often such things, cause 5 mins later I come up with the answer myself
|
|
|
|
|
As per the MS Docs I'm calling:
AfxGetApp()->SelectPrinter(dlg.m_psd.hDevNames, dlg.m_psd.hDevMode);
after CPageSetupDialog::DoModal()
On Win98 I get two ASSERTs in AfxGlobalFree(). Doesn't happen on W2K. This happens in a Debug Build of the Wordpad sample app as well as in my app.
I've read that setting the bFreeOld param of SelectPrinter() to FALSE causes other problems.
Does anyone have a work around/solution for this.
Thanks.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
I don't have a code at hand, but remember this problem. I think you'll be running fine if you pass FALSE as third parameter to SelectPrinter. It used to work on Win9x and NT 4.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I've created an MFC application using DAO to access a DBASE database. It works great on my system, but when trying to run the MFC application on a clean win98 system, i get a
"Unable to initialize DAO/Jet db engine." error. Does anyone know how i can fix this?!?! I've tried installing the newest version of MDAC...but this did'nt help.
|
|
|
|
|
Latest MDAC version - 2.6 - doesn't contain Jet engine. You also need to install Jet 4.0 Service Pack 3.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks for the info! But i'm still having trouble...
I tried installing the Jet 4 SP3 (it contains the Jet engine right?), and then re-installing MDAC 2.6. After doing this...I still receive the same error message.
Have I done something wrong here?
Rob
|
|
|
|
|
Make sure the TEMP environment variable points to a directory that actually exists. That is usually the cause of this problem.
|
|
|
|
|
They say that you should install MDAC 2.6 first, then Jet 4.0 SP3. Unfortunately, the KB article link on Jet download page is broken, so I can't give you more detailed info.
If problem persists, I'd try to install MDAC 2.5 - it comes with Jet.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Still no luck...
What do you guys think of the idea of migrating my application to using ADO instead of DAO... I'm thinking of re-writing the code to use ADO instead of DAO...but i'm currently using DAO to access DBASE database files. Is this possible with ADO?
Would my application be easily distributed to clients using ADO instead of DAO?
I'm willing to do anything to get this problem fixed!
Rob
|
|
|
|
|
I'm trying to write a program to get my machines system properties.
I need to find:
-Total Free Memory
-Total Memory
-Total Free Hard disk space
-Total Hard Disk space
-processor speed
if anyone knows if there is a header file or a standard set of functions to do this, please let me know.
Thanx,
Stan
Stan
|
|
|
|
|
Hi,
Help, I can't seem to get this code right.. it's part of a file loading routine, what I am trying to do is basically find the 'fieldname', and fill 'out' with the next line that comes after it.. It works if the fieldname is present, however, if the fieldname is not present in the input file, the routine just gets stuck in the do..while loop, all help is appreciated!!
bool pPolyhedra::getfield(char *fieldname, CString& out)
{
CString a;
// Eat lines untill we encounter the fieldname, or after we have exhausted the file
do
{
ifile->getline(linebuffer, 255, '\n');
a=linebuffer;
} while (a.Find(fieldname)==-1 || ifile->eof());
if (!ifile->eof())
{
ifile->getline(linebuffer, 255, '\n');
out=linebuffer;
out.TrimRight();
return true;
}
return false;
}
|
|
|
|
|
Assuming your ifile->eof() function performs a valid test for end of file, try it this way:
bool pPolyhedra::getfield(char *fieldname, CString& out)
{
BOOL bFoundField = FALSE;
while (!ifile->eof())
{
ifile->getline(linebuffer, 255, '\n');
a = linebuffer;
if (a.Find(fieldname) == -1)
{
bFoundField = TRUE;
break;
}
}
if (!bFoundField)
{
return FALSE;
}
ifile->getline(linebuffer, 255, '\n');
out = linebuffer;
out.TrimRight();
return true;
}
If it were me, I'd also use the MFC CStdioFile class for reading the file.
|
|
|
|
|
Hi,
I'm creating an NT Service class. I'm having trouble making it shutdown.
It responds to the SERVICE_CONTROL_STOP message okay but when it receives the SERVICE_CONTROL_SHUTDOWN message it doesn't terminate at all.
I'm running it on NT Server 4.0 no service packs.
Does anyone know of anything special I need to do to shutdown my service. Any help would be appreciated.
Thanks for reading.
Flit.
|
|
|
|
|
Hi there!
I have created an owner-drawn listbox which I am using to wrap text in the same string onto a new line, so that all of the lines containing the string can be selected at once.
However, I cannot seem to use tabstops!? Guessing it is to do with the fact that it is an ownerdrawn listbox...?
Anyway, I don't know where to handle this issue - the MFC code and MSDN are crap and don't mention anything about this, in the context of ownerdrawn stuff. Can anyone help please?
Yours very frustratedly!
Baz
|
|
|
|
|
Did you specified DT_EXPANDTABS flag in call to DrawText inside OnDrawItem handler?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Cheers for that! Got it sorted now...
|
|
|
|
|
Hello, I'm trying to hide that messageboxes, using:
SetErrorMode(SEM_FAILCRITICALERRORS);
this makes some of the messageboxes to appear, I've thought to use:
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
but then I get worse results, how should I do this?
Note: after all the process the system hangs.
Notes about the process:
CreateFile(...);
CreateDirectory(...);
for (...) { CopyFile(...); }
CloseHandle(...);
As always, thank you in advance.
|
|
|
|
|
It may be not related to the msgbox problem, but why are you keeping some file open during series of CopyFile calls?
Please post code with real parameters instead of "..."; This will make diagnosing easier.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
uiErrorModeANT = SetErrorMode(SEM_FAILCRITICALERRORS);
hArxiuLog = CreateFile (filename,GENERIC_WRITE,FILE_SHARE_WRITE | FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_ARCHIVE,NULL);
if (hArxiuLog != INVALID_HANDLE_VALUE)
{
dwFileSize = GetFileSize(hArxiuLog,NULL);
SetFilePointer (hArxiuLog, dwFileSize, NULL, FILE_BEGIN);
::CreateDirectory(TCCApp.GetAccesRegistre()->GetRefsPathRespatllar(),NULL);
::CreateDirectory(TCCApp.GetAccesRegistre()->GetProgramesPathRespatllar(),NULL);
iLimit = dlgPare->m_clbRestantsRespatllar.GetCount();
while ((iComptador < iLimit) && (!dlgPare->m_bCancelThread) && (!bTrobatError))
{
dlgPare->m_clbRestantsRespatllar.GetText(0,dlgPare->m_vstatRespatllantACT);
dlgPare->m_clbRestantsRespatllar.DeleteString(0);
dlgPare->UpdateData(FALSE);
dlgPare->m_clbRestantsRespatllar.RedrawWindow();
// the paths change in each loop iteration (here's not that piece of code...
iRetornOperacioCopia = CopyFile(csFullPathOrigenReferencia, csFullPathDestiReferencia, FALSE);
if (iRetornOperacioCopia == 0)
{
iErrorsTrobats++;
csAuxiliar += " : registrado error en éste proceso";
bTrobatError = true;
}
iComptador++;
}
// Posicionar el punter en l'arxiu (anar al final...)
dwFileSize = GetFileSize(hArxiuLog,NULL);
SetFilePointer (hArxiuLog, dwFileSize, NULL, FILE_BEGIN);
// csArxiuLog is a String that changes in each copy operation.
WriteFile(hArxiuLog,csArxiuLog,strlen(csArxiuLog),&dwNBWritten,NULL);
CloseHandle(hArxiuLog);
csArxiuLog.ReleaseBuffer(0);
}
// Get back to the original err mode.
SetLastError(0);
SetErrorMode(uiErrorModeANT);
|
|
|
|
|
when exactly messageboxes are displayed? During CopyFile?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hello, I'm trying to get some data written into the registry when the user updates a password in my app.
I'm using:
RegOpenKeyEx(HKEY_LOCAL_MACHINE,csPathSubClau,0,KEY_ALL_ACCESS,&Key);
RegSetValueEx(hKey,csValor,0,REG_SZ,(BYTE *)csNouValor.GetBuffer(iLength),iLength);
RegFlushKey(hKey);
RegCloseKey(hKey);
but the data is only flushed when I close my app, could you give me an idea?
thank you in advance.
|
|
|
|
|
I want to extract the first char from a string and test if it is equal to an int in a for loop.
char c;
for (int i=1, i
|
|
|
|
|
cast it.
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|