|
I'm glad you figured it out, because I would not have guessed that given your original post.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Well it turns out that was only part of problem.
The enrionment vars get expanded but they still don't seem to get refreshed.
I can run the installer, and open the System Properties and see hte new values correctly, but if I start a command prompt, and type the executable (whose path was added to the Users PATH env var) name, it just craps out and says it can't run the program. So apparently I still am doing something wrong
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Jim Crafton wrote:
...but if I start a command prompt, and type the executable (whose path was added to the Users PATH env var) name...
So at the command prompt, the PATH environment variable is correct, but the executable cannot be started. Is that right? If so, it appears that deeper issues are at play here.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am trying to get some value in a particular cell on CDataGrid specifiying
the field name. When there is nothing in a cell, always return me error saying
type is not much. I am not sure what is wrong with my code. please
help me looking at the following code.
CColumns Cols = m_DataGrid.GetColumns();
VARIANT varCol;
varCol.vt = VT_BSTR;
CString str_MyColumn = "MyColumn";
varCol.bstrVal = str_MyColumn.AllocSysString();
CColumn Col = Cols.GetItem( varCol );
VARIANT varValue = Col.GetValue();
CString str_WhatisValue = varValue.bstrVal;
Thanks
shin
|
|
|
|
|
hello!
I´m working with MFC. I´m making same threads where I execute a Query in a database. It use same CString, int and command variables.
It is an Example:
void STLogLatido::DoWork(void *pThreadContext)
{
_set_se_translator(SeTranslator);
try
{
CString id = GetParamID(2,msg);
//ejecutar comando
_bstr_t sql;
sql = "execute dbo.sp_latido @id_empleado=" + id;
pConn->Execute( sql ,NULL ,0);
}
catch (...)
{
}
delete this;
}
That work greate, but when the thread finish the memory process have been increased 4k.
Does anybody can help me?
|
|
|
|
|
VietDelphi wrote:
...when the thread finish the memory process have been increased 4k.
What did you expect to happen?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Well.... I believed that when the thread was finished, It had to free all the memory which was used by the thread.
Am I wrong??
|
|
|
|
|
VietDelphi wrote:
Am I wrong??
Yes, in a way. See the last section of this article for a better description than I can type.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanx!!... I´ll read
|
|
|
|
|
Hi guys,
I'm working on my first MFC app and have hit a small issue with a palette window which needs to sit above the main view but all other dialog's should appear above it in the Z order. Currently the extended style is set to WS_EX_PALETTEWINDOW but this keeps the window on top of everything else. So even my File Open dialog disappears beneath it.
How can I specify this palette should always appear above the main window but below all else?
Thanks for any help,
Simon
|
|
|
|
|
The extended style WM_EX_TOPMOST (Part of WM_EX_PALETTEWINDOW) causes the palette window to be ALWAYS on top Z order, like stated in the Reference.
To overcome this problem, remove the style flag, and always when you create new dialogs or windows, or a window of your choice has focus, use SetWindowPos to place it's Z-order.
For example, when user opens your application, after the window objects are created but before they are shown, you place them with subsequent calls to SetWindowPos member methods to place their Z-orders in the way you please. Or, when your mainframe gets focus, you place the mainframe window under the palette window. Simple.
Again, when user clicks on the button to create the File Open dialog, then first position the windows, then create the dialog and make it modal to the application. This way it will always be on top of your app.
The key is to reposition the windows always when something, which would change the window display order, happens (Like gaining/losing focus, modal messageboxes/dialogs etc)
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Great, thanks for your help Antti.
|
|
|
|
|
Sorry to bother you again but I'm still tearing my hair out with this palette window problem. I've added a handler in the MainFrame class to pick up MoveWindow notifications. This works okay. It gets a pointer to the View class and calls the UpdatePalettePos function.
Inside the UpdatePalettePos function I try to use SetWindowPos to move the palette and bring it back on top of the mainframe. However, the minute I try to access anything within the palette object the application bombs. Even m_dlgPropertySheet->GetWindowRect(rPropsRect); causes a crash. Yet the exact same function is called elsewhere within the View class and works fine.
Ahhhhhhh!
Please help!?
Simon
|
|
|
|
|
Run the debugger, setting a breakpoint before the call to UpdatePalettePos. Enter this call, and see where your application crashes. Now, debug again, this time paying attention to different variables and pointers, if they point to correct locations (For example, the m_ptrPalette in CMainFrame must match with 'this' in CPaletteWnd).
After you have specified the position of the crash, take note of the error it gives you. Is it an assertion error ? An access violation ? What is the error message with the crash ? Note that you won't see these error messages unless you use the debugger.
With this information, post the error code, and a exerpt from the code flow. Post the point where you call UpdatePalettePos and the declaration of this function.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
How can I pass a function that sorts an array of test scores in ascending order?
|
|
|
|
|
std::sort does sorting. The easy version uses your test scores' operator< for determining sort order. It gets a little more complex if you want to sort by other orders.
Or do I misunderstand your question?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
dynamicall allocate an array large enough to hold any number of test scores to user wishes to enter. the array should then be passed to a function that sort them in ascending order. I can use std:sort under namespace std; to do that. I thought a num++ or num-- or a if statement?
confused on what to do
|
|
|
|
|
iasaber wrote:
I thought a num++ or num-- or a if statement
num++/num-- do increase/decrease num. They do not change their position in the array!
To do that you need to copy one array member to a local variable, copy the one to exchange to its position and copy your local copy to the position where the other one has been.
Dynamical allocation of your array can be done by the STLs std::vector, but I think the point is you learning to handle objects
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Have you looked at qsort() ?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am using common color Dialog box in console Application, but when I move that Dialog the previous image of Dialoge not erased, any suggestion please
|
|
|
|
|
In here, you need to create a Windows (or MFC) program with a view. Then bind console entry to that view. Now you can use dialogs normally.
If you created a console application that supports MFC and then tried to create a dialog inside the program, I believe it might show symptoms like that.
Paste some code on how you do it now.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am using OPENGL for creating console base window with in the Console Application, from that window I am opening Color Dialog, may be the window created by OPENGL causing this problem, but I am not sure, any way I am sending the code which Creates the window and does some other tasks,Take a look on it , if u know OPENGL and tell me something please.
int main ( int argc, char** argv )
{
glutInit ( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutInitWindowSize ( 640, 480);
glutCreateWindow ("Solar System Simulator");
glutKeyboardFunc (keyboard);
glutDisplayFunc (display);
glutMainLoop ( );
return 0;
}
|
|
|
|
|
Okay,
You see, you use the standard C/C++ entry point function 'main' to start your program. This is ok if you were creating a pure console based application. However, a Windows programs starts from 'WinMain' function, and have a bit different parameters. What is happening here is that the pure console application is not very good at working with windows. Not even with OpenGL enabled. To summarize, you have a wrong style of approach to the problem, if you don't mind me saying
The difference between a pure console program and a Windows program is that in a Windows program, the thread can start a full-flexible message pump to handle messages from the main window or it's children. In a pure console program, this message pump is much more limited.
For instructions on how to create a Windows-based console application, read Lanz Jean-Claude's article "QuickWin" located here http://www.codeproject.com/dialog/quickwin.asp?target=windows%7Cconsole%7Capplication[^]
That tutorial will show you how to move your application from the console-based version to a Windows program which has a console redirection enabled.
If you need OpenGL, you can follow the same tutorial, but instead, when creating the splitter frames, create a view which uses OpenGL. The basic idea behind this all is, that now when your program is executed, it will have a full-fledged message pump attached to it, and if you create a new window, it will work properly.
If you are not needing the redirection from the standard console (as is, the DOS prompt in old OS), you can always use the same approach, but instead of creating a frame window, just create a small window with OpenGL view inside it. This is the way most of the small-scale 3D apps (like demos or similar) are made.
The key issue beyond everything is that you use a Windows program entry point, instead of the standard console (DOS) entry point. In order to make everything quick & convenient for yourself, just grab a copy of all code files in your project at this moment, then create a new blank Win 32 Application project in Visual Studio, paste your code files and change the 'main' function to match the correct 'WinMain' call. Now you have a fresh start working under a thread which has a full-fledged message pump support. Remember to add necessary headers and libraries to the new project to use OpenGL, if needed.
To carry on from here, just create a main window with OpenGL view, then start a message pump for the thread. The rest is functionality
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Changing the color of a CDialog or a CFormView, no problem!
But how to do this on a CDialogBar?
I want to put a bitmap into my dialog bar, so the image background is the same color of my daliog bar. The problem is that if the user changes the default colors in it control panel, then the dialog bar will be created with the systems default color.
I would like to change my Dialog Bar background to a different color. This is a MDI so the Dialog Bar is been created in CMainFrame OnCreate event.
Help please!
Alfredo
|
|
|
|
|
How to change the cursor shape in console applications
I tried the fillowing code but no result
HCURSOR hc=LoadCursor(NULL,IDC_HELP);
SetCursor(hc);
|
|
|
|