|
RedZenBird wrote:
duplicate keys will bounce off of a map [if someone knows how to 'turn this off' please clue me in ]
Do you mean 'std::multimap'?
It can hold the same key more than once, but finding an entry gets slightly more complicated, as you cant possibly know how many entrys gou get.
|
|
|
|
|
Never used them, but multimaps accept duplicate keys I believe...
Thanks so much for the responses. I finally had to use a vector with a two element structure type precisely because of bouncing off of duplicate keys.
Appreciate your help,
ns
|
|
|
|
|
I want to create array of CArray.
If I have this below CArray
CArray<unsigned char,="" unsigned="" char=""> m_data;
I want to create Array of m_data. Do you know how to do that ?
|
|
|
|
|
CArray m_array [ 5 ] ;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I'm working toward checking this out myself, but am curious. If I write a buffer to a CFile object, then Write buffer#2, followed by buffer#3, all before closing the file, one after another, the output file wil have the three buffers concatenated. Is that correct? I'll have three binary buffers so I dont know if I can tell if they are in order etc....want to be sure. They dont start afresh at the beginning of the CFile at each Write, right?
Thanks,
ns
|
|
|
|
|
no they dont start at the begining each time, they get concatenated
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks again! Its great to have you around!
Appeciate it,
ns
|
|
|
|
|
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am trying to draw an xy scatter graph using MSchart (ActiveX) but there is only documentation for VB. I want to draw a y=x^2 graph. This is what I have but returns an error saying "Index is out of bounds".
m_chart.GetPlot().GetAxis(VtChAxisIdX, v).GetAxisTitle().SetText("x");
m_chart.SetTitleText("Simple graph");
m_chart.SetColumnCount(4);
m_chart.SetRowCount(10);
int x,y;
for(y=0;y<4;y++){
m_chart.SetColumn(y);
for(x=0;x<10;x++){
m_chart.SetRow(x);
int a = x*y;
m_chart.SetColumn(a);
}
}
A small example would be helpful
Any ideas?
|
|
|
|
|
Try setting the index to 1 instead of 0:
for(y=1;y<=4;y++){ ...
for(x=1;x<=10;x++){ ...
|
|
|
|
|
I get the same error, I think it has something to do with m_chart.SetColumn().
I have a feeling this may not be the right Function but don't know what I'd put in it's place.
|
|
|
|
|
http://softwaredev.earthweb.com/msnet/vc/article/0,,12081_629511,00.html Sorry outside CP
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi, I found this article yesterday and this works fine for a bar graph. I tried to manipulate this for an xy scatter graph without much luck. The problem lies in setting x and y values.
|
|
|
|
|
Folks,
Does anyone know who to disable the accelerator keys temporarily in a MFC application? I would like to disable the functionality of the entire menu bar when doing lengthy operation. Currently, I call the following function to disable the menu bar.
CMainFrame::EnableWindow ( FALSE );
Apparently, it works ok. The menu bar is grayed out and does not response to mouse clicks. However, when as user press "Alt", the menu bar turn ON again and start to operate. It seems like the "Alt" button enable the menu bar.
Anyway, to disable accelerator keys feature temporarily?
Thank you.
bluntagain
|
|
|
|
|
MSDN:
If the accelerator command corresponds to a menu item, the application is sent WM_INITMENU and WM_INITMENUPOPUP messages, as if the user were trying to display the menu. However, these messages are not sent if any of the following conditions exist:
The window is disabled.
The menu item is disabled.
The accelerator key combination does not correspond to an item on the window menu and the window is minimized.
A mouse capture is in effect. For information about mouse capture, see the SetCapture function.
So chose wisely!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have a VC++ project; I’m exporting a class with static public data members, declared in the .h file and initialized in it’s .cpp file. (OK)
When I see the dll’s depends it’s all ok; I can see the class and its attributes, but when I try to use it from another dll (like className::attributeName ), at I linking time, I got an ‘unresolved external symbol’ error, but it compiles well.
Can someone help me to resolve this?
Thanks
|
|
|
|
|
you need to create an import list for the linker to know what symbols you are linking from your DLL.
You can either report the symbols that you want to import in the import section of your .def file,
Or you can create a header file for you DLL that declares the symbols that you would like to import.
If you create a default DLL that exports some symbols in VC++, it creates a basic framework that will allow the same header file to be used in both the exported DLL and the imported EXE. This is done by changing the declspec(export) command to a declspec(import) with preprocessor defines
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I already tried that;
The situation is this:
I have a dll with several classes that I export (one of them is this one, with static members), and I’m using them from another dll. For the other classes I had no troubles (I included the header files and used them normally) but I don’t know what happens with this one.
I’ve tried:
- Include the class header file with __declspec(dllimport) in the dll that uses it
At linking time returns ‘error LNK2001: unresolved external symbol’
- Make a header file with extern sentence ( extern string className::attributeName; );
At compiling time returns: file.h(53) : error C2720: [attributeName] : 'extern ' storage-class specifier illegal on members
- The same header file, but with extern “C” sentence
( extern “C” string className::attributeName )
At linking time return:
file.obj : warning LNK4006: "public: static class string className::attributeName already defined in file2.obj; second definition ignored
I don’t know what else to do or try.
Paranoico? yo???
|
|
|
|
|
Hello!
I have an app which until recently have worked very well, but now I get an Unhandled Exception when I run the program in Release mode. It works in Debug mode. Since the error is in MFC and I can't find any of my code in the calling stack I'm stuck!
I get this error messages:
"Unhandled exception in COMSmartist.exe (MFC42.DLL): 0xC0000005: Access Error"
When I press OK I wind up in Wincore.cpp (line: 231).
The calling stack look like this:
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 231 + 10 bytes
AfxWndProc(HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 368
AfxWndProcBase(HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 220 + 21 bytes
USER32! 77e71303()
USER32! 77e71962()
NTDLL! 77f763ef()
CView::OnPaint(CView * const 0x00000007 {CView hWnd=???}) line 183
MFC42! 6c371fb5()
CWnd::WindowProc(CWnd * const 0x00000007 {CWnd hWnd=???}, unsigned int 15, unsigned int 0, long 0) line 1585 + 27 bytes
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 218
AfxWndProc(HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 368
AfxWndProcBase(HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 220 + 21 bytes
USER32! 77e71303()
USER32! 77e71962()
NTDLL! 77f763ef()
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 231 + 10 bytes
AfxWndProc(HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 368
AfxWndProcBase(HWND__ * 0x046a0cc0, unsigned int 20, unsigned int 3422620807, long 0) line 220 + 21 bytes
USER32! 77e71303()
USER32! 77e71962()
NTDLL! 77f763ef()
CView::OnPaint(CView * const 0x00000007 {CView hWnd=???}) line 183
MFC42! 6c371fb5()
CWnd::WindowProc(CWnd * const 0x00000007 {CWnd hWnd=???}, unsigned int 15, unsigned int 0, long 0) line 1585 + 27 bytes
AfxCallWndProc(CWnd * 0x00000000 {CWnd hWnd=???}, HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 218
AfxWndProc(HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 368
AfxWndProcBase(HWND__ * 0x046a0cc0, unsigned int 15, unsigned int 0, long 0) line 220 + 21 bytes
USER32! 77e71303()
USER32! 77e71962()
NTDLL! 77f763ef()
If anyone can light some light about this I would be very greatful!
// Mike
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Just some first thoughts...
1. Had you noticed there seems to be some recursion here? Why does CView::OnPaint end up calling CView::OnPaint ??
2. Why is the CWnd * parameter to AfxCallWndProc = zero?
3. Why is the CWnd * parameter (this pointer) to CView::OnPaint = 7
Perhaps a breakpoint at line 183 of CView::OnPaint would help you to lever your way in.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Thank You!
This was just the help I needed to find the error! Which by the way was due to an attempt to do resizable windows and not understanding what I was doing I copied some code from CodeProject and now I can't find this article anymore. So maybe the author got the same error and revoked the article.
Anyway, thanks to your pointers I manage to make my application bug-free(.???.) AND resizable!
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Pleased to be able to help, and pleased to get your grateful reply.
Cheers!
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
It looks like an invalid window handle. Are you trying to draw something on the View before it has been properly created?
Michael
"Time and tide melts the snowman."
-- The Doctor (Doctor Who: Time and the Rani
|
|
|
|
|
In the following:
char* tempBuffer = NULL;
std::vector <char*> nBuffer;
int nRetNewDB;
CFileDialog fileDlg1(TRUE, ".*", NULL, OFN_EXPLORER|OFN_ALLOWMULTISELECT, "All Files(*.*)|*.*||",NULL);
nRetNewDB = fileDlg1.DoModal();
if (nRetNewDB == IDOK)
{
POSITION Pos;
Pos = fileDlg1.GetStartPosition();
while (Pos != NULL)
{
CString sPathName = fileDlg1.GetNextPathName(Pos);
int nSize = ReadPMAFile(sPathName, tempBuffer);
if(nSize !=0)
{
tempBuffer = new char[nSize+1];
ReadPMAFile(sPathName, tempBuffer);
nBuffer.push_back(tempBuffer);
}
}
}
I am getting compile errors regarding 'new':
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
help! I've used 'new' a thousand times but somethings gone wrong here.....
Thanks,
ns
|
|
|
|
|
Are u using namespace std??
And i see that ur vector isnt given a type, why??
Deal with the first error first:
identifier 'THIS_FILE'
And generaly u gotta move some header include before or after
#define THIS_FILE
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|