|
I have a loop that first gets a value of "PAGE" for the Cedit WindowText. Why doesnt it stop at
GetWindowText() the second time it comes around? I stepped through and after finding "PAGE" the first time, it sails through the lines in red on a second pass, and of course I never got a chance to change the CEdit entry, so the variable is still "PAGE", and an infinite for loop starts....
bool bExistingEntry;
do
{
<code> m_editAddNewKeyword.SetFocus();
m_editAddNewKeyword.GetWindowText(m_newKW);</code>
bExistingEntry = false;
for (int i = 0 ; i < m_numFields && !bExistingEntry ; i++)
if (bExistingEntry = (m_AddKWFldsHolder[i] == m_newKW))
{
AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
}
}
while (bExistingEntry);
Probably something goofy, but I cant see it....
Thanks,
ns
|
|
|
|
|
It does!! GetWindowText() just gets the text from the edit control into m_newKW . The proper way to validate input is in your dialog's OnOK() handler. Like so:
m_editAddNewKeyword.GetWindowText (m_newKW);
for (int i = 0 ; (i < m_numFields); i++) {
if (m_AddKWFldsHolder[i] == m_newKW) {
AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
return;
}
}
CDialog::OnOK();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
How do I get my UI to pop up again after the messagebox is dismissed. I cant dismiss the messagebox, it keeps looping because I never get a chance to change the entry. I thought setfocus would do it, but it sails through that line I found...
|
|
|
|
|
See my edited reply. I figured I'd left out the essentials.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thanks a bunch! I didnt think of that!
|
|
|
|
|
Here is the message from VC Debug tool ,Can somebody tell me What does it mean?
First-chance exception in DMSClient.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
SIMPLE IS BEAUTY
|
|
|
|
|
ZBUILDER wrote:
First-chance exception in DMSClient.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
What does it mean?
Some code in Kernel32.dll threw an exception.
That is the meaning of that line, and as you choose not to give more information about the context, it is about all one can say about it.
|
|
|
|
|
A first-change exception normally is not a problem: it's the debugger's opportunity to see an exception before it is being handled by an exception handler (or catch-block). If no exception is propagated to your code, that means the writer of the library has foreseen the possibility of this exception and written an appropriate catch-block.
So don't worry about it.
|
|
|
|
|
Thank you very much.See you later?
SIMPLE IS BEAUTY
|
|
|
|
|
I make a program in window 95, In this environment it runs. Now I have took it to windows Millenium but when i run, it gives me a error "Debug Assertion faif, file: barstat.cpp, line 266". I have made a packet but it does not run.
thank in advances.
|
|
|
|
|
Simply look in barstat.cpp at line 266. The expression within ASSERT() (or similar) at that line evaluates to false running under ME, not in Windows95.
Or even easier: open in MS VC++, place somewhere before barstat.cpp 266, and trace the value of the expression.
|
|
|
|
|
Hi,
This is really annoying me.
char *buffer;
GetData(&buffer);
the plan here is that the GetData function will allocate buffer:-
void GetData( char ** ppBuf)
{
*ppBuf = new char [length];
strcpy (*ppBuf,"other data");
}
this appears to work. In fact, back in the original code block:-
printf(buffer);
works correctly.
But when i try and delete the allocated memory in the original code block:-
delete [] buffer;
I get a nasty debug "damage after normal block" type error. Both the main block and the called function exist within the same thread. I've traced through step by step in the debugger, and the address of the block of memory that is allocated by the new keyword is definately the very same block of memory that i am trying to delete.
Why does this occur????
thanks,
Jon
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Whats the value of length and does it include the \0 terminating character?
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Ahah. Roger, you are a top banana. Whereas I am an idiot.
thankyou for your help!
|
|
|
|
|
Does anyone knows where to find documentations (books or tutorials) about the way to work with the visual C++ environment ???
I mean :
- How to work with several sub-projects from different teams ?
- How to integrate and to work with external components such as DLLs without needs to copy files or header in my project ??
- How to use include/lib directories ???
- What is the detailled signification of the Project/Settings parameters ???
what I do not mean :
- How to use visual c++ to create dialog box or progress bars ... (and such things that is described in every VC++ books...)
Thanks,
Vince
|
|
|
|
|
Hi,
I have an automated Ms Word instance running on my application. What I want to do, it's: meanwhile the my program is refreshing the data on the Ms Word Instance, block the keyboard input for the user in My Ms Word Automated instance. Is that possible ?
The problem that I have, is if the user begins to type meanwhile the doc is being refreshed by my App, Word Crashes
Thanks in advance, Greetings
Braulio
|
|
|
|
|
Probably yes,
Just implement ::PreTranslateMessage in the main window class.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Mmmmm....
But ::PreTranslateMessage, will only work for Handles of windows of the same App, ... and my word instance belongs to another process space, is that correct ?
|
|
|
|
|
I am trying to open a cdrom drive using CreateFile() (with Vwin32 vxd) for win98 platform but this gives me permission denied.
How can i read it
|
|
|
|
|
I'm trying to find an ATM based windows code sample.
Need to make a Client/Server application using an ATM protocol.
Have an Interphase SDH card with an ATM interface.
If someone can have me an input, please do.
Thanks in advance.
|
|
|
|
|
hi,
i've to reallocate a CString class member on runtime, i can't change the declaration in the parent class because it's a library but do it in the derived class.
The problem is that assigning to the CString a value the program exit with
HEAP[Sample1.exe]: Invalid Address specified to RtlFreeHeap( 5f0000, 5f4ccb08 ). Using .Empty() .ReleaseBuffer() and similar there's no errors, only assigning something.
It's a problem in the member allocation?
|
|
|
|
|
another thing, i use the debug version of the library with debug mode on.
|
|
|
|
|
I thinh you should post some code of what you are doing so we can better determine your problem.
Best regards,
Alexandru Savescu
|
|
|
|
|
i'm trying implementing a Cdocument derived class for the TX Text Control (www.textcontrol.com). the tx views needs this CTXDoc derived from CDocument. The component is created for an application with only a tx view and nothing else (this is very bad). In OnOpenDocument, OnNewDocument,etc it sets, deletes the contexts of the view,etc so if you call this overloaded funtions the program crash with diffent views. So i've substitued CTXDoc:: with CDocument:: and set the things for the tx init. But opening a created document, when SetPathName is called, there's an assignation to m_strPathName and m_strTitle of the CDocument and there's the Heap. I don't know how to solve, i've created the same variables in the derived class and rewritten SetAppName and GetTitle but in the others part of the application if there's a call to GetTitle it returns the CDocument variable that it's ""
|
|
|
|
|
I have a bit of a problem. I'm trying to write a plugin for Trillian Pro, but the example code is all C, and I've only had any luck modifying their example rather than writing my own dll from scratch.
I really want to use some C++ functionality (namely Ravi's Web Resource Provider)
Is there a simple way I can wrap up a C++ class into a .lib file so I can call it from C code?
--
Help me! I'm turning into a grapefruit!
|
|
|
|