|
Turning from visual c++ (version6) to visual studio c++ 2005 recently i've got errors when compiling this code:
#include "mave.hpp"
template <typename T> class matrix : virtual public mave<T>
{
public:
enum enLineSolver { GAUSS, HOUSEHOLDER, GIVENS, SHOLESKY};
protected:
static enLineSolver lineSolver;
};
// Initialization of lineSolver:
template <typename T> matrix<T>::enLineSolver matrix<T>::lineSolver = matrix<T>::GAUSS;
/* With Visual C++ (Version 6) above line is translated correctly without any
message. With Visual Studio 2005 compilation fails with these messages:
warning C4346: 'matrix<T>::enLineSolver' : dependent name is not a type
e:\007-chera\006-mavex3\matrix.hpp 274
error C2143: syntax error : missing ';' before 'matrix<T>::lineSolver'
e:\007-chera\006-mavex3\matrix.hpp 274
error C4430: missing type specifier - int assumed.
Note: C++ does not support default-int
e:\007-chera\006-mavex3\matrix.hpp 274
I've tried several changes to resolve this error without success. template
is necessary because of indentifier T. matrix<T>::enLineSolver cannot
be replaced by simple int for another error then appears (different type).
*/
Any idea what's wrong?
-- modified at 9:54 Saturday 27th January, 2007
|
|
|
|
|
From the help on C4346:The typename keyword is required if a dependent name is to be treated as a type. You're using the dependent type matrix<T>::enLineSolver (meaning, it depends on the template parameter T ) so you have to add typename before it:
template <typename T>
typename matrix<T>::enLineSolver matrix<T>::lineSolver = matrix<T>::GAUSS;
|
|
|
|
|
Hi everybody.
I wanna write an application which has a database created using SQL-Server2000.
In this app I need to have a beautiful graphical user interface and on the other hand have to be able to work with the data tables in an mfc application that is created with vc 2003.(not .net)
what do you suggest?
i think a web service would help if so, can i write it with .net2.0 using c# and asp.net and use the web service with mfc 1.1?
please help me!!!!!!
Sepehr
|
|
|
|
|
How do you convert a array of bitmap bits to a HBITMAP?
I cannot seem to figure it out.
|
|
|
|
|
|
|
Hi,
i am using the function :
FindWindow(LPCTSTR lpszClassName,LPCTSTR lpszWindowName )
and i need to input the lpszClassName of my main frame window created using MFC MDI application.
anyone knows how?
tks.
|
|
|
|
|
From MSDN:
lpClassName
[in] Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.
If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.
You can use that parameter as NULL. and then the program will search for any window with that specific name.
If you want, you can call the functions RegisterClass or RegisterClassEx in order to set the name of that class.
Hope this helps.
|
|
|
|
|
You can use the GetClassName() API on the HWND of your main frame window to get its class name.
You can also set the class name, as Joan Murt suggested.
Mark
|
|
|
|
|
Mark Salsbery wrote: You can use the GetClassName() API on the HWND of your main frame window to get its class name.
Actually, he wanted class name to find window in question. If he had window handle, then there is no question of getting class name.
As somebody already answered, passing NULL for classname he can find window.
|
|
|
|
|
Gotcha, thanks
I was thinking if he needed the classname that MFC uses when it registers the class. Just
do it once so he'd know whe string to use in the other app. It made sense to me when I typed
the vague reply Using the title is much easier.
Thanks for the correction!
Mark
|
|
|
|
|
I have gone through the directX SDK. I am a bit confused with the routines given in the MS Visual C++ documentation of using DirectX API's. I would need a small help in getting the sequence of calling the API's to show an image(just pixel values) stored in memory.I can do it only in a plain Win32 project or MFC based project.
|
|
|
|
|
I have a CListBox that get some text. I want to go to the last input so I can see what text its comming. How can I do that?
|
|
|
|
|
Hello Larsson,
You should get the number of items using GetCount();
and then use GetText(int A, CString &CS);
Where A must be the index of the last item.
Where CS must be a receiver CString.
Hope this helps.
|
|
|
|
|
I cant get this to work, can you please typ a exemple here so I can see.
I hace try to use this,
iGo = m_AddLogg.GetCount();
m_AddLogg.GetText(iGo, sText);
But this dont make me go down in the list. Note that sText in this case is emty.
|
|
|
|
|
Larsson wrote: iGo = m_AddLogg.GetCount();
m_AddLogg.GetText(iGo, sText);
Index is zero based, so you need to use following code,
iGo = m_AddLogg.GetCount();
m_AddLogg.GetText((iGo-1), sText);
|
|
|
|
|
Weekend, sorry, I hope that the answer from prasad_som has been useful.
Good luck...
|
|
|
|
|
Please help me,
When does user insert CD into driver CD.I want my program will automatically detect and show all of them(file and folder) are showed in a listbox.
My program is written y MFC
Thank you very much.
|
|
|
|
|
You need to create an AutoRun.Inf file that will inform Windows which program to run when the CD is inserted into the drive.
You can have it run your special program with the list in it you want.
|
|
|
|
|
Forgive me is this is a stupid question, but I'm kinda new to DirectX. I'm drawing 2D images using textured quads. Is it possible to draw two textures at the same time onto a single quad? I could do this by swapping the texture and drawing the sprite twice, but surely there is a way to do this in one blow.
|
|
|
|
|
Hi
I have an SDI application. The CMainframe currently has a CSplitterWnd embedded in it. In order to prevent over-crowding, I would like to add a CTabCtrl to intervene in between the CMainframe and the CSplitterWnd, such that the first tab shows the CSplitterWnd, and the other tabs show different views, and the user can move between the views without the views re-initialisaing. (Much like the "Contents / Index / Search / Favourites" tabs in the help system of VC++.)
What's the simplest way to achieve this please?
cheers,
Neil
|
|
|
|
|
I created a edit box just fine, but when i trying to select the text in it, the application for some reason does not do it, Im not sure what's missing. Here is the part of the code that Im talking about:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
#define IDC_MAIN_EDIT 1
#define IDC_SEDIT 2
#define IDC_BUTTON 3
HWND iEdit, rEdit, button;
switch(msg)
{
case WM_COMMAND:
if( wParam == IDC_BUTTON )
{
MessageBox( hwnd, "Button was clicked.", "Notification", MB_OK );
SetDlgItemText(iEdit, IDC_MAIN_EDIT, "testing");
}
break;
case WM_CREATE:
{
iEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL |
}
...
}
when the WndProc receives the button message, a message box will appear saying i pressed the button, and the text in the iEdit control is suppose to be set to "testing" right? I really don't know what Im missing.
|
|
|
|
|
actually i just solved it myself. I didnt realize that when calling the SetDlgItemText(iEdit, IDC_MAIN_EDIT, "testing"); command, the first parameter corresponds to the parent window that the target edit box belongs to, no wonder we need to specify the edit box control id in the second parameter.
|
|
|
|
|
Can anyone provide a pointer to a class or library that supports adding extra buttons to a window's caption bar? Support for XP themes is required.
|
|
|
|
|