|
|
Michael Dunn wrote:
How to Implement Drag and Drop Between Your Program and Explorer[^] is my favorite.
hmmm.. I wonder why
Regards,
Brian Dela
|
|
|
|
|
I'll check it out Mike thanks
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
When I output a string of text like:
"This is some text\nThis is some more text"
using DrawText() is there any way to get the newlines to NOT render as vertical bars with DT_SINGLELINE specified...?
I have tried DT_WORDBREAK | DT_SINGLINE and other combinations, but it seems newline are destined to render while in singleline...I can't exactly go into the string and pull out newlines prior to rendering either...
Any ideas...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Did you try '\r\n' instead of '\n'?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Actually i'm afraid the DrawText() buffer is fed by a multiline CEdit control so I can't see how I owuld do that...?
Unless I poke those characters in the buffer some how...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Honestly, I'm not sure of what is going on here. However, in the ::DrawText (Win32 API, not MFC) documentation it says:
DT_WORDBREAK
Breaks words. Lines are automatically broken between words
if a word would extend past the edge of the rectangle
specified by the lpRect parameter. A carriage return-linefeed
sequence also breaks the line.
That being said, I have used DrawText in one of my apps for multi-line text and it uses line feeds only '\n'. What you could try is to strip off all of the '\r' characters (you could just use CString::Replace method). Let me know if that doesn't do it for you.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Thats the solution I eventually used...works great, but not as elegant as a style bit like DT_IGNORELINEFEEDS . This is what I was hoping someone might have told me...some undocumented style bit...ah well...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
using DrawText() is there any way to get the newlines to NOT render as vertical bars with DT_SINGLELINE specified...?
DT_SINGLELINE causes the renderer to ignore newlines completely; vertical bars just happens to be the placeholder for them in your font. Unfortunately, your only solutions are to either render the string yourself, stripping newlines as you go, or to strip them out (or replace them with spaces or something) before passing the string into DrawText() . As perlmunger stated, CString::Replace() is prolly your best bet...
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
|
|
|
|
|
Shog9 wrote:
Unfortunately, your only solutions are to either render the string yourself, stripping newlines as you go, or to strip them out (or replace them with spaces or something) before passing the string into DrawText()
I was afraid of that...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am trying to push stuff (of the right type) onto a pDoc vector, in my view class. iT crashes!!!
get doc etc;
pDoc->m_Vec.push_back(tempStr); //crashes at the push_back
its a vector of strings. I can push stuff onto local vectors just fine....
Incidentally it sails through:
pDoc->m_Vec.clear();
|
|
|
|
|
What does your declaration of m_Vec look like?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
std::vector< CString> vecSortFields;
|
|
|
|
|
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.
|
|
|
|