What should I do? Don't use it if it isn't defined. Use VK_BACK it is defined. Or just define it as 8. Thanks for the help, Bill
Bill Wilson
Posts
-
MFC Keyboard input trouble -
Adding MFC to a non-MFC projectYou probably need to do some more. There is an article in MSDN that describes what you have to do to add MFC support to an ATL project. It is pretty generalizable advice. Search for "Howto MFC ATL" to find the article.
-
Colored GridThe easiest way is to use a grid control like MSFlexGrid. Thanks for the help, Bill
-
Making Autoruns in C++That's a good point. In that case, VB won't work. Although the same is true of any other .exe that has external dependencies that might not be installed. (like common control library or an old version of the ole libs.) Reading the post more closely, the users is simply describing a typical install program. Use the MS windows installer or InstallShield or Wise or any one of a number of other products to build such an install process.
-
Making Autoruns in C++I sure can't think of any reason a program that is launched by autorun canot be written in VB. Try it and see. Create a .exe file. Place its name in a file named autorun.inf Like this [autorun] open = MyVBApp.exe
-
Workspace ModelYes.
-
Word in C++It looks like you have a working technique to communicate with the Word app. If you are asking about the specific commands to issue to word to create the table and do the formatting, I suggest you let the Word program tell you. Turn on the macro recorder, perform the operations of interest (create table). Then turn off the recorder and read the macro. It will contain the commands you need to implement. The implementation is just like the stuff you already have coded.
-
cant figure out the simple logic!!!StartSearch:
for( int i = 0; i)
{
if( m_AddKWFldsHolder[i] == newKW)
{
int nRetMB = AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
m_editAddNewKeyword.SetWindowText(""); m_editAddNewKeyword.SetFocus();
goto StartSearch;Or for those who fear the goto.
BOOL bSearching = TRUE;
while (bSearching)
for( int i = 0; i)
{
if( m_AddKWFldsHolder[i] == newKW)
{
int nRetMB = AfxMessageBox("Keyword already exists in database. Add new Keyword or Cancel");
m_editAddNewKeyword.SetWindowText("");
m_editAddNewKeyword.SetFocus();
bSearching=TRUE;
break;
}
}bSearching = FALSE;
}
-
ADOX and adding two databasesIts too bad you have to do this in VC++. That will be the most ineffective language to use. Your original post posed this question: are there any links/samples that show how to merge database1 and database2 to create a final database I can't imagine that there are. That's a pretty odd thing to do to databases. Using MFC or anything else, the process will be as I described earlier. I have seen code samples of creating a new database and tables from VC, but I can't remember exactly where. With a little effort you should be able to find examples of each of the steps. Good luck, Bill
-
ADOX and adding two databasesDo you just need the result or do you actually need a program that does this. If itst the result you're looking for. Do it in Access by importing data from one DB into the other ( or import both into a new DB). Create a table with all the fields you want. Use Insert queries to move the data from the old tables to the new one. Even if you need to be able to repeat the process. I'd recommend doing this in Access. Just write a VBA script to do the job.
-
pardon my frenchOpen up the project .dsp (or maybe .dsw) You should find a line that sets the language. Something like: Just delete it. I had this problem with some code from China several years ago. Unfortunately, I don't remember the details.
-
Error controlYou could do something like this... in the calling program
try {
int x = SomeProcedure();
...}
catch (CMyException *e)
{
// Do something with the error return
LogError(e->nMyErrorNum....delete e;
}
int SomeProcedure()
{
n = new CMyClass();
if (!n) {
CMyException* pErr = new CMyException(TRUE);
pErr->errNum = ERRORNUMBERIWANTTOUSE;
throw pErr;
}
...Define class CMyException
class CMyException : public CException {
int nMyErrorNum;...
Hope this helps
-
positioning problemsYou can use CWnd::GetWindowRect to get the location of the controls you wish to align to.
-
Error controlPretty hard to tell what this code is supposed to accomplish. Is the variable error assigned somewhere? It appears to be undefined in your code. Maybe you need something like int error = g_eventStart.ResetEvent(); although that is just a guess. The code you presented would, of course, not even compile, unless error is some kind of global, set by the ResetEvent method?
**You wrote:
I've already use Exception but I found that not very usefull...
I've tried with a specific thread which uses a loop. Like this:**This makes it sound like you are trying to use a thread in a loop to perform the same function as exception handling. Sorry, but that makes absolutely no sense. Handling errors is one topic, but I fail to see what a separate thread has to do with anything. I think you should try harder with exceptions.
-
How to prohibit users from changing the system time?I think you will need to set the rights using the Domain Controller Security Tool, you mentioned in your original post. I'm not familiar with that tool, but if you can figure out how to launch it from your program, if you can get the the gui of the tool you need opened, you can send messages to it and any controls in it. That gives your program control of the tool.
-
free() problemIn addition to Chris' suggestions, you need to allocate nFibo+1 elelents. FiboArray[0] is element #1 FiboArray[1] is element #2 so minimum allocation is 2 = (nFibo=1) + 1 (like Chris said) FiboArray[2[ is element #3 so minimum allocation is 3 = (nFibo=2) + 1 & etc.
-
How to prohibit users from changing the system time?Are you asking how to prevent the system administrator from adminstering the system? Why not have the user logon as something other than Administrator? Even if you do this, what keeps the Administrator from simply resetting the right manually? (Or does it not matter). You can post messages to any window. So if you can get the the gui of the tool you need opened, you can send messages to it and any controls in it. That gives your program control of the tool.
-
COM ContainmentThe line ppCrypt->Release(); should read ppA->Release(); Thanks for the help, Bill
-
std::string questionAlexpro wrote: it is better than std::string SACRILEDGE!! Alexpro wrote: CString is a very good class BLASPHEMY!! Oh NO! STr o k e... BTW CString is part of MFC. (Microsoft Foul Code). Everyone knows was developed as part of a feindish plot to undermine portablilty with Unix/Linux.:rolleyes:
-
std::string questionSHAME! SHAME! You should know better than to show MFC examples. People will get the mistaken impression its easier to use than the beloved STL. :-D