|
hi, all.
since the COM program must include the afx.h(once include afx.h, cannot include windows.h), and the project setting must "use mfc in a share library(or static library)", does that mean the COM must require MFC support?
|
|
|
|
|
Not at all, COM and MFC have no dependencies on each other, although you certainly can use them together. Are you still having trouble compiling with a reference to IActiveDesktop* ?
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Thanks Mike. my problem has been solved since i include the afx.h, afxdisp.h, and wininet.h, i just got a little bit confused about that, so i answer that question.
well, as you said, COM and MFC have no dependencies on each other. but on the other hand, i still cannot complied that program with the project setting "Not using MFC". could u explain that, or give a simple example.;)
|
|
|
|
|
IIRC your original code didn't use MFC, right? #include'ing afx*.h is not the right thing to do, since those are MFC headers. #include wininet.h before shlobj.h and you should be set.
(If your program is using MFC, then just change that combo box to the proper MFC type [shared DLL or static LIB].)
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Oh, i see. Thank you very much.
|
|
|
|
|
I have a *.chm file already. but how can I display it when menu item Help->Help Topics is clicked?
|
|
|
|
|
When I input text in a multiline edit box, if I type the text
to the edge, it automatically word wraps to the next line.
If I check HSCROLL, it does not word wrap, but it continues
on horizontally indefinitely. How can I make a multiline edit
box NOT word wrap without activating HSCROLL? That is, when
text gets to the edge of the box, it sticks until the
user hit carriage return forcing it to the next line.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
What you want to do is to disable an edit control's word wrap. I am not sure you can directly do that. But you can use the EM_SETWORDBREAKPROC message to set your own word wrap handler and then do nothing in the handler. It might work, might not work! It's worth a try anyway!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
In the resource editor, turn OFF Auto HScroll and make sure Want Return is turned ON.
---Shog9---
Extreme ways are back again, extreme places i didn't know
I broke everything new again, everything that i'd owned -- Moby, Extreme ways
|
|
|
|
|
Shog9 wrote:
In the resource editor, turn OFF Auto HScroll and make sure Want Return is turned ON
Woah! That'll turn word-wrap off???
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
That'll turn word-wrap off???
Oh, that was the question? Oops...
---Shog9---
Extreme ways are back again, extreme places i didn't know
I broke everything new again, everything that i'd owned -- Moby, Extreme ways
|
|
|
|
|
Sorry, i misread the question; my previous response should have been:
In the resource editor, turn ON both Auto HScroll and Want Return.
---Shog9---
Extreme ways are back again, extreme places i didn't know
I broke everything new again, everything that i'd owned -- Moby, Extreme ways
|
|
|
|
|
Is there any way of removing word-wrap without clicking
Auto HScroll? If I click HScroll, then the user and
type text horizontally forever. I just want them to
go to the edge of the edge box.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danyell (an overworked graduate student)
|
|
|
|
|
Ouch, why do you want to do that?
I think you could probably implement it by handling the EN_CHANGING notification and just discarding keypresses after they'd reached the end of the line. To make it a bit easier, you'll need to use a fixed-width font and calculate the maximum allowed width ahead of time.
--------
A closed mouth gathers no foot. --Shog9 --
|
|
|
|
|
How about this, when the focus is away from that edit box, how can I
insert carriage returns at the end of the line? If I type in
long line really, long
line
and it automatically word-wrap, then I see two (2) lines, but using
these vc++ commands, I have only managed to count 1 line and that's
driving me nuts. If I could force \r\n to exist at the end of the
first line, then I would be happy.
Please, any response any one can give me will be greatly appreciated.
|
|
|
|
|
Alright, that's a bit easier. Here's what you can do:
- Retrieve the text
- Retrieve the inner width of the list box
- Get a screen DC (used only for measuring the text): (MFC)
CClientDC dc(NULL); - Get the font used in the edit box: (MFC)
pWndEdit->GetFont(); - Parse out the string one word at a time, measuring each word, and accumulating the lengths (don't forget to measure spaces & tabs). When you are unable to add another word without exceeding the width of the list box, insert "\r\n" and reset the accumulated length. Use (MFC)
CSize sizeWord = dc.GetTextExtent(strWord);
Have Fun!
--------
A closed mouth gathers no foot. --Shog9 --
|
|
|
|
|
I've been getting an odd crash within Microsoft's STL, something to do with locales... The scenario is a bit complicated so here goes...
I have a class in a static library that derives from ostream, like this:
<br />
class __declspec(dllexport) CMessageLog<br />
: public std::ostream<br />
{<br />
} ;<br />
Then, in a DLL that links in this lib, I have another class that derives from it:
<br />
class __declspec(dllexport) CSysLog<br />
: public CMessageLog<br />
{<br />
} ;<br />
Then, in my app (which uses the above DLL), doing this:
CSysLog log ;
log << x ;
causes a crash if x is anything other than a char*, std::string or char.
Stepping through in the debugger, the crash is caused by basic_ostream calling use_facet() which seems to be trying to get a facet, gets NULL and then tries to deference it.
Is there some special magic I need to do to get locales working from a DLL...?
|
|
|
|
|
Make all components of your app (main program, DLLs, libs) use the DLL version of the C run-time library. That should fix your problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
im still new in c++.im searching for a visual c++ code for stacks. infix to postfix. can anyone tell me how to get examples? i cant seem to find it!
|
|
|
|
|
I believe that you're looking for std::stack, found in the header <stack>.
stack is an adaption of deque.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
i want to play .mpeg video clips in my application but i need helpful wrapping MFC classes or sample Windows MCI APIs to implement into my APP.
i have succeded in playing .avi files (not converted from Mpeg into Avi) but i could not do the same playing .Mpeg files...
i tried to change MciSendCommand(...) parameters and MCI_DGV_OPEN_PARMS structure members in my sample Application but i haven't done it.
What should i do?
i need help
Thanks for all,
Atilla Selem
just listening to you...
|
|
|
|
|
Atilla Selem wrote:
i want to play .mpeg video clips in my application
I think you can do it with media player activex.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Look up direct show in the MSDN - it's part of DX and makes playing movie files a snap.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hi again,
Please introduce to me USEFUL documents-tutorials-SAMPLES about Drag-Drop pictures ...
I need help FAST !
It's my next project
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If you don't mind a bit of .NET you can see :-
http://www.codeproject.com/dotnet/csdragndrop01.asp
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|