|
Are you sure that it is at the push_back where it is failing? Is your pDoc pointer valid? What is the context of this call? Where has pDoc come from in the current context? The only reason I'm going down this path is that I can't see where your vector code would be failing. It looks perfect to me.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
get pDoc from GetDocument() in the view class. pDoc->vec.clear() does just fine, then bombs on the push_back. I thought maybe you cant do stuff to a vector in the doc class, from a view . Anyways, I am going to make it a global object and hopefully that'll work..
Thank you for your interest,
ns
|
|
|
|
|
nss wrote:
Anyways, I am going to make it a global object and hopefully that'll work..
If it belongs in the Doc then it belongs in the Doc. Are you sure tempStr exists. My guess is not.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Nope. TempStr definitely exists. I also tried using just a literal string, but that didnt work either.
|
|
|
|
|
Is it possible to use a BHO to add a new menu item to IE? I'm new to API hooking, so I read API Hooking Revealed. Ivo mentions BHO, but doesn't go into any depth. I also read the article on the Microsoft website
Browser Helper Objects: The Browser the Way You Want It. It talks about manipulating the document itself. I just don't see an documentation on manipulating the menus. Can anyone point me in the right direction? I'm also new to COM, so please bear with me.
Thanks in advance.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
My apps been working fine, but to my horror I have found that some of my globals are declared before the messagemap, some after...and they are still global!! Is this weird ?
Also if I declare a vector
std::vector<CString> vec; before the msgmap, the linker groans, but after the msgmap and theres no problem. Heres the situation:
(format explanation: my angled brackets have vanished in the post, but I do have the types for the maps etc where they should be in angled brackets)
Is this weird ?or are things still global no matter if they are before or
after the mesagemap?
#include <iostream>
#include <fstream>
#include <atlconv.h>
extern CTrain1App theApp;
#define BIF_NONEWFOLDERBUTTON 0x0200
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;
BOOL g_FlagNoPhotoDB;
BOOL g_fResetToFullDB; char* xDontCare;
std::vector<CString> vec;
IMPLEMENT_DYNCREATE(CTrain1View, CFormView)
BEGIN_MESSAGE_MAP(CTrain1View, CFormView)
ON_COMMAND(ID_SELECTDATABASE, OnSelectdatabase)
)
ON_MESSAGE (KEYWORDS_READY, OnKeyWordsReady)
ON_UPDATE_COMMAND_UI(ID_INDICATOR_TEST, OnUpdateIndicatorTest)
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()
std::map<int,CImages> imageMap;
std::map<CString,CTrio> trioMap;
std::vector<CString> vec; CString gDatabaseName;
CString gImageFolderLoc;
int globaln_popDisplayFlag =1;
PALETTETYPE globalPaletteType = OriginalPaletteType;
RGBQUAD* pGlobalPalette = 0;
int globalZoomFactor = 100;
double globalBaselineImageWidth = 20;
float globalBright = 0.5;
float globalContrast = 0.5;
CImages::CImages(void)
{
imageSize = 0;
There are globals at the start, like they should be. Then there a bunch of
globals AFTER the messagemap, If I make a global vector there(after msgmaps)
it compiles, but making it before the messagemaps it doesnt
compile.
|
|
|
|
|
hi
is it possible to remotecontrol the windows mediaplayer from within
another (written in vc++) program?
thanks
mb
|
|
|
|
|
Maybe... There's a WMP SDK out on Micrsoft's website somewhere, you could give that a look.
Donno if it'd do what you need, but you can also embed WMP into your app as an ActiveX control; DDJ had an article mentioning this in their October issue - the source is here.
Shog9
------
Crazy lady with the shiny shoes, where are you?
Kick your feet and calm the space that makes you hollow
Live, Insomnia And The Hole In The Universe
|
|
|
|
|
Ok, I have not a clue what this error means, any ideas?
<br />
--------------------Configuration: Date - Win32 Debug--------------------<br />
Compiling...<br />
hw4c.cpp<br />
Linking...<br />
Time.obj : error LNK2001: unresolved external symbol "public: int __thiscall Time::GetMin(void)" (?GetMin@Time@@QAEHXZ)<br />
Time.obj : error LNK2001: unresolved external symbol "public: int __thiscall Time::GetHour(void)" (?GetHour@Time@@QAEHXZ)<br />
Debug/Date.exe : fatal error LNK1120: 2 unresolved externals<br />
Error executing link.exe.<br />
<br />
Date.exe - 3 error(s), 0 warning(s)<br />
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
the linker cant find the functions, Time::GetMin(void) and Time::GetHour(void).
This could be because the functions have not been defined, or the library is not included in your project properties.
|
|
|
|
|
Thanks Josh, that was it, damn I hate it when things happen like that. It always seems like it's the littlest things that throw me way off. Thanks again.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
How to gray the radio button?
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
Using Win32 SDK
BOOL EnableWindow(
HWND hWnd, // handle to window
BOOL bEnable // enable or disable input
);
|
|
|
|
|
Hello,
I am seeing some weird List View behaviors.. I am trying to resize all my columns when the window is re-sized.. When i make the window bigger the header resizes fine, when I make the window smaller the header still resizes fine but I get a scroll bar at the bottom of the view (every other time its sized smaller). If I click on the scroll bar it goes away (because it should never have been drawn).. Anyone seen this? Here is a snip of the WM_SIZE..
void CMyListView::OnSize(UINT nType, int cx, int cy)
{
GetListCtrl().SetColumnWidth(0,cx);
GetListCtrl().SetColumnWidth(1,0);
GetListCtrl().SetColumnWidth(2,0);
GetListCtrl().SetColumnWidth(3,0);
GetListCtrl().SetColumnWidth(4,0);
GetListCtrl().SetColumnWidth(5,0);
CListView::OnSize(nType, cx, cy);
}
|
|
|
|
|
Never mind, I tried doing the SetColumnWidth inside the MainFrame Size function.. and every thing works as expected.
|
|
|
|
|
I'm trying to draw a button in my active x control.
I just need simple button/text elements, so I thought I could just use the ResourceView->Dialog to add the components visually.
However, it seems I'm only able to create Dialogs, and I'm not able to add directly to the normal visual area of the active x control.
So... my question is how do I draw, say, a simple CButton in the OnDraw area of my control?
something like:
void CAChatCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
CButton testButton = new Button();
CRect bBounds = new CRect( rcBounds->r - 30, rcBounds->b - 30, rcBounds->r, rcBounds->b );
testButton::Create("DrawnButon",BS_DEFPUSHBUTTON,bBounds,?,??);
}
Sorry about asking such an easy question
|
|
|
|
|
I need to change the background colour of a CButton? Is there any way to do it
a) without creating a new class?
b) if creating a new class, without owner-draw?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
chech out msdn article # Q132080 or # Q117778
"If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
|
|
|
|
|
cannot find them on msdn.microsoft.com. have a link?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
got it
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Anybody know what's supposed to happen if you do this? I've got a project where it seems like both of these .dll's are present, and I seem to be getting a lot of heap warnings in the dbug build. I open up depends, and lo and behold, both of the runtimes are there.
I think I should be using the MSVCRTD alone, but it appears that the MSVCRT is getting loaded as a dependency of shell32.dll. I am calling SHGetFileInfo.
Is there a debug shell32.dll? If so, how do I get it instead of the release one?
Thanks,
Aaron
|
|
|
|
|
Is there an easy way to sort the contents of a CMenu in mfc ?
Thanks!
|
|
|
|
|
I have a class derived from CPropertyPage which contains a modeless dialog. On dialog creation I pass a client rect structure of the property page. I also handle OnSize() and OnShowWindow() in the property page class to resize/show/hide the dialog. But at startup this dialog is not correctly aligned in the property page. It is displayed beyond the property page's edges. If I move to another property page and then go back to the malicious one everything is fine. Anybode knows a solution for this....
The funny thing is that this bug happens only with Windows 98/ME - Windows 2000/XP is fine...
Gero
|
|
|
|
|
and I am using Windows 2000.
Anybody has any idea how to solve it? Thanks a lot!
|
|
|
|
|
The dialog is not properly aligned at the first time only, is because that the property sheet was moved after the first active property page was shown. This is the message handling sequence:
CMyPropertyPage::OnShowWindow()
{
}
CMyView::OnInitialUpdate()
{
m_sheet.MoveWindow(&sheetRect, TRUE);
}
so the solution is: reshow the property page after the property sheet is moved to a correct position. My method is:
CMyView::OnInitialUpdate()
{
m_sheet.MoveWindow(&sheetRect, TRUE);
m_sheet.GetActivePage()->SendMessage(WM_SHOWWINDOW, FALSE, 0);
m_sheet.GetActivePage()->SendMessage(WM_SHOWWINDOW, TRUE, 0);
}
HTH.
|
|
|
|